<-
Apache > HTTP Server > Documentation > Version 2.4

Upgrading to 2.4 from 2.2

This document describes changes in Apache HTTP Server 2.4 that might require you to change your configuration or how you use the server in order to use IHS 9.0 (Based on Apache 2.4) as you are currently using IHS 7.0 or 8.x (based on Apache 2.2) . For step by step instructions on migrating a configuration file, see the "Migrating a configuration" section below.

More information on what has changed is contained in the New Features document and in the CHANGES file. Application and module developers can find a summary of API changes in the API updates overview.

This document describes only the changes going from 2.2 to 2.4. If you are upgrading from version v6.x, you should also consult the 2.0 to 2.2 upgrading document.

See also

top

Migrating an IHS configuration file from a previous release

The preferred method of migration is to apply your customizations over the new default configuration. If this is prohibitively complicated, it is possible to manually migrate a configuration from a prior release.

The following are steps to change an IHS 7.0, 8.0, or 8.5 httpd.conf such that it is useable on an IHS 9.0. This procedure assumes the installation paths of the old and new releases differ.

For information about migrating in-place, see the following technote: https://www.ibm.com/support/pages/node/6590897

  1. Copy your prior releases configuration file(s) to the new installation path.
  2. Update paths if the install root has changed. Many absolute paths within the configuration contain the install root. Replacing old paths can be done quickly using the sed command, e.g.
                    cp /opt/IBM/IHSv9/httpd.conf /opt/IBM/IHSv9/httpd.conf.premigration
                    sed "s@/opt/IBM/IHSv8/@/opt/IBM/IHSv9/@" /opt/IBM/IHSv8/httpd.conf > /opt/IBM/IHSv9/httpd.conf
    This command copies httpd.conf from the prior releases installation directory to the new installation directory, and replaces all instances of /opt/IBM/IHSv8/ with /opt/IBM/IHSv9/.
  3. Remove <IfModule worker.c> and the </IfModule> that follows it, leaving the contained directives. On Linux, IHS uses the "event" MPM and this <IfModule worker.c> would hide the MPM configuration.
  4. Replace authz_default_module with authz_core_module; i.e. replace
    LoadModule authz_default_module modules/mod_authz_default.so
    with
    LoadModule authz_core_module modules/mod_authz_core.so
    If the module is not replaced, you will receive an error similar to the following:
        httpd: Syntax error on line 141 of /IHS/install/path/conf/httpd22.conf: Can
        not load modules/mod_authz_default.so into server: EDC5205S DLL module not
        found. (errno2=0xC40B0025)
  5. Update access control. Take only one of the following actions:
    • Replace the old access control directives Order, Allow, and Deny with the new Require directive. Refer to the Access Control section below. This is preferred.
    • Otherwise, load the mod_access_compat module by adding the following line to the configuration:
      LoadModule access_compat_module modules/mod_access_compat.so
    • Remove AuthSAFAuthoritative if present (see information at the bottom of this document for more details)
    If neither step is taken, the resulting error message resembles the following:
        AH00526: Syntax error on line 289 of /IHS/install/path/conf/httpd22.conf:  
        Invalid command 'Order', perhaps misspelled or defined by a module not included 
        in the server configuration
  6. Load the mod_unixd security module by adding the following line to the configuration:
    LoadModule unixd_module modules/mod_unixd.so
    Otherwise, the following error occurs:
        AH00136: Server MUST relinquish startup privileges before accepting connections.  
        Please ensure mod_unixd or other system security module is loaded.
  7. Update the WAS plugin by changing the LoadModule line from:
    LoadModule was_ap22_module  /PLUGIN/install/path/mod_was_ap22_http.so
    to:
    LoadModule was_ap24_module  /PLUGIN/install/path/mod_was_ap24_http.so
  8. Update third-party modules to their Apache 2.4 versions. There are no general instructions for this step; contact the third-party module's vendor for explicit instructions.

    If modules are not compatible with Apache 2.4, you can receive one of two types of error messages. The examples below are how the message is reported on z/OS -- the operative parts of the message are problems with symbols similar to "ap_my_generation" or "ap_log_error".

    The first form resembles this:
        CEE3559S External variable ap_my_generation was not found in DLL apachecore.dll.
        From compile unit FLASH108:/u/WASTST1/2.4.x/srclib/apr/dso/os390/dso.c 
        at entry point apr_dso_load at statement 68 at compile unit offset +000000000D5B
        CCEA at entry offset +00000000000000C2 at address 000000000D5BCCEA.             
    
        CEE3561S External function ap_log_error was not found in DLL apachecore.dll.    
        From compile unit FLASH108:/IHS/install/path/srclib/apr/dso/os390/dso.c 
        at entry point apr_dso_load at statement 68 at compile unit offset +000000000D5B
        CCEA at entry offset +00000000000000C2 at address 000000000D5BCCEA.
    To figure out which module is causing the problem, start the server with the -e debug option, e.g.
    bin/apachectl -e debug
    This should partially output your configuration file, and then output the error. The line of the configuration after the last line which is printed should be a LoadModule directive containing the name of the failing module. The other type of error message that may be shown when a module is incompatible with Apache 2.4/IHS version 9.0 looks like this:
        httpd: Syntax error on line 1007 of /IHS/install/path/conf/httpd22.conf: API 
        module structure 'myap22_module' in file /mymodule/install/path/modules/mod_myap22.so 
        is garbled - expected signature 41503234 but saw 41503232 - perhaps this is not 
        an Apache module DSO, or was compiled for a different Apache version?
    The problematic module's name is contained within the error message - in this case, myapp22_module.
  9. Search your configuration for directives such as Include, AuthUserFile, AuthGroupFile, and KeyFile. These directives may either point to files under the old installation root that need to be copied.
  10. If using the 'BFlagEscapeAllNonAlnum' parameter to RewriteOptions, remove it. It's the default and only behavior in this and future releases.
  11. Linux only: Add a line to dynamically load the Event MPM, e.g. 'LoadModule mpm_event_module modules/mod_mpm_event.so'?
  12. Attempt to start the server with the updated configuration. Review the output of the start command and the error_log to make sure no errors were reported. If a directive has been removed or has moved to a new module, you may see an error resemlbing this message:
    AH00526: Syntax error on line 924 of /web1/httpd.conf:
    Invalid command 'Foo', perhaps misspelled or defined by a module not included in the server configuration

    Consult the rest of this document for informaton about the specific directive, then check http://publib.boulder.ibm.com/httpserv/manual24/mod/directives.html to find the proper module to load.

    This step will likely require a number of rounds of iteration, as only 1 error is detected at a time.

  13. Optional: Review and apply other changes to the default configuration (httpd.conf.default) in the new release:
    • ReportInterval has been reduced to 300 seconds.
    • TrackModules On, TrackHooks allhooks, SlowThreshold 60, TrackHooksOptions logslow have been added.
    • mod_backtrace is now loaded on some platforms where it was unintentionally omitted in previous releases.
    • The default 'LogFormat' now has additional columns appended for serviceability.
    • The default config has been updated to deny access to all directories by default and then explicitly allow access to the document root, icons, CGI-BIN, etc.
      DocumentRoot /var/www/ihs1/htdocs
      ...
      <Directory />
          Options FollowSymLinks
          AllowOverride None
          FileETag All -INode
          Require all denied
      </Directory>
      <Directory "/var/www/ihs1/htdocs">
          Options FollowSymLinks
          AllowOverride None
          Require all granted
      </Directory>

After taking all the above steps, the configuration should be ready to be loaded by IHSv9.0. The remainder of the document serves as a reference for what has changed between Apache 2.2 and 2.4.

top

Compile-Time Configuration Changes

The compilation process is very similar to the one used in version 2.2. Your old configure command line (as found in build/config.nice in the installed server directory) can be used in most cases. There are some changes in the default settings. Some details of changes:

top

Run-Time Configuration Changes

There have been significant changes in authorization configuration, and other minor configuration changes, that could require changes to your 2.2 configuration files before using them for 2.4.

Authorization

Any configuration file that uses authorization will likely need changes.

You should review the Authentication, Authorization and Access Control Howto, especially the section Beyond just authorization which explains the new mechanisms for controlling the order in which the authorization directives are applied.

Directives that control how authorization modules respond when they don't match the authenticated user have been removed: This includes AuthzLDAPAuthoritative, AuthzDBDAuthoritative, AuthzDBMAuthoritative, AuthzGroupFileAuthoritative, AuthzUserAuthoritative, AuthSAFAuthoritative, and AuthzOwnerAuthoritative. These directives have been replaced by the more expressive RequireAny, RequireNone, and RequireAll.

If you use mod_authz_dbm, you must port your configuration to use Require dbm-group ... in place of Require group ....

Access control

In 2.2, access control based on client hostname, IP address, and other characteristics of client requests was done using the directives Order, Allow, Deny, and Satisfy.

In 2.4, such access control is done in the same way as other authorization checks, using the new module mod_authz_host. The old access control idioms should be replaced by the new authentication mechanisms, although for compatibility with old configurations, the new module mod_access_compat is provided.

Mixing old and new directives

Mixing old directives like Order, Allow or Deny with new ones like Require is technically possible but discouraged. mod_access_compat was created to support configurations containing only old directives to facilitate the 2.4 upgrade. Please check the examples below to get a better idea about issues that might arise.

Here are some examples of old and new ways to do the same access control.

In this example, there is no authentication and all requests are denied.

2.2 configuration:

Order deny,allow
Deny from all

2.4 configuration:

Require all denied

In this example, there is no authentication and all requests are allowed.

2.2 configuration:

Order allow,deny
Allow from all

2.4 configuration:

Require all granted

In the following example, there is no authentication and all hosts in the example.org domain are allowed access; all other hosts are denied access.

2.2 configuration:

Order Deny,Allow
Deny from all
Allow from example.org

2.4 configuration:

Require host example.org

In the following example, mixing old and new directives leads to unexpected results.

Mixing old and new directives: NOT WORKING AS EXPECTED

DocumentRoot "/var/www/html"

<Directory "/">
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Location "/server-status">
    SetHandler server-status
    Require 127.0.0.1
</Location>

access.log - GET /server-status 403 127.0.0.1
error.log - AH01797: client denied by server configuration: /var/www/html/server-status

Why httpd denies access to servers-status even if the configuration seems to allow it? Because mod_access_compat directives take precedence over the mod_authz_host one in this configuration merge scenario.

This example conversely works as expected:

Mixing old and new directives: WORKING AS EXPECTED

DocumentRoot "/var/www/html"

<Directory "/">
    AllowOverride None
    Require all denied
</Directory>

<Location "/server-status">
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow From 127.0.0.1
</Location>

access.log - GET /server-status 200 127.0.0.1

So even if mixing configuration is still possible, please try to avoid it when upgrading: either keep old directives and then migrate to the new ones on a later stage or just migrate everything in bulk.

In many configurations with authentication, where the value of the Satisfy was the default of ALL, snippets that simply disabled host-based access control are omitted:

2.2 configuration:

Order Deny,Allow
Deny from all
AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
Require valid-user

2.4 configuration:

# No replacement needed
AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
Require valid-user

In configurations where both authentication and access control were meaningfully combined, the access control directives should be migrated. This example allows requests meeting both criteria:

2.2 configuration:

Order allow,deny
Deny from all
# Satisfy ALL is the default
Satisfy ALL
Allow from 127.0.0.1
AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
Require valid-user

2.4 configuration:

AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
<RequireAll>
  Require valid-user
  require ip 127.0.0.1
</RequireAll>

In configurations where both authentication and access control were meaningfully combined, the access control directives should be migrated. This example allows requests meeting either criteria:

2.2 configuration:

Order allow,deny
Deny from all
Satisfy any
Allow from 127.0.0.1
AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
Require valid-user

2.4 configuration:

AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
# Implicitly <RequireAny>
Require valid-user
Require ip 127.0.0.1

In many configurations with authentication, where the value of the Satisfy was the default of ALL, snippets that simply disabled host-based access control are omitted:

2.2 configuration:

Order Deny,Allow
Deny from all
AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
Require valid-user

2.4 configuration:

# No replacement needed
AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
Require valid-user

In configurations where both authentication and access control were meaningfully combined, the access control directives should be migrated. This example allows requests meeting both criteria:

2.2 configuration:

Order allow,deny
Deny from all
# Satisfy ALL is the default
Satisfy ALL
Allow from 127.0.0.1
AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
Require valid-user

2.4 configuration:

AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
<RequireAll>
  Require valid-user
  Require ip 127.0.0.1
</RequireAll>

In configurations where both authentication and access control were meaningfully combined, the access control directives should be migrated. This example allows requests meeting either criteria:

2.2 configuration:

Order allow,deny
Deny from all
Satisfy any
Allow from 127.0.0.1
AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
Require valid-user

2.4 configuration:

AuthBasicProvider File
AuthUserFile /example.com/conf/users.passwd
AuthName secure
# Implicitly <RequireAny>
Require valid-user
Require ip 127.0.0.1

Other configuration changes

Some other small adjustments may be necessary for particular configurations as discussed below.

top

Misc Changes

top

Third Party Modules

All modules must be recompiled for 2.4 before being loaded.

Many third-party modules designed for version 2.2 will otherwise work unchanged with the Apache HTTP Server version 2.4. Some will require changes; see the API update overview.

top

Common problems when upgrading