Apache Migration HOWTO

Abstract


Table of Contents

1. Naming and filesystem changes
1.1. Packaging changes
1.2. Filesystem changes
2. Migrating your configuration
2.1. Global Environment
2.2. Main server configuration
2.3. Virtual Hosts
2.4. Modules
A. Packaging Changes

1. Naming and filesystem changes

1.1. Packaging changes

1.2. Filesystem changes

2. Migrating your configuration

2.1. Global Environment

2.1.1. Selecting which interfaces and ports to bind to

Example 1. Apache 1.3 port configuration

Port 123
ServerName www.example.com

Example 2. Equivalent Apache 2.0 port configuration

Listen 123
ServerName www.example.com:123

2.1.2. Server-pool size regulation

2.1.3. Dynamic Shared Object (DSO) Support

2.1.4. Other changes

2.2. Main server configuration

2.2.1. UserDir mapping

2.2.2. Logging

2.2.3. Directory Indexing

2.2.4. Content Negotiation

2.2.5. Error Documents

2.3. Virtual Hosts

2.4. Modules

2.4.1. mod_ssl

Example 3. Apache 1.3 SSL virtual host configuration

##
## SSL Virtual Host Context
##

<VirtualHost _default_:443>
    # General setup for the virtual host
    ServerName ssl.host.name
    ...
</VirtualHost>

Example 4. Equivalent Apache 2.0 SSL virtual host configuration

##
## SSL Virtual Host Context
##

<VirtualHost _default_:443>
    # General setup for the virtual host
    ServerName ssl.host.name:443
    ...
</VirtualHost>

2.4.2. mod_proxy

2.4.3. mod_include

Example 5. Apache 1.3 mod_include configuration

AddType text/html .shtml
AddHandler server-parsed .shtml

Example 6. Equivalent Apache 2.0 mod_include configuration

AddOutputFilter INCLUDES .shtml

2.4.4. mod_auth_dbm and mod_auth_db

Example 7. Apache 1.3 mod_auth_db configuration

<Location /private/>
  AuthType Basic
  AuthName "My Private Files"
  AuthDBUserFile /var/www/authdb
  require valid-user
</Location>

Example 8. Equivalent Apache 2.0 mod_auth_dbm configuration

<Location /private/>
  AuthType Basic
  AuthName "My Private Files"
  AuthDBMUserFile /var/www/authdb
  AuthDBMType DB
  require valid-user
</Location>

Table 1. Migrating from dbmmanage to htdbm

Actiondbmmanage command (Apache 1.3)Equivalent htdbm command (Apache 2.0)
Add user to database (using given password)dbmmanage authdb add username passwordhtdbm -b -TDB authdb username password
Add user to database (prompts for password)dbmmanage authdb adduser usernamehtdbm -TDB authdb username
Remove user from databasedbmmanage authdb delete usernamehtdbm -x -TDB authdb username
List users in databasedbmmanage authdb viewhtdbm -l -TDB authdb
Verify a passworddbmmanage authdb check usernamehtdbm -v -TDB authdb username

2.4.5. PHP

Example 9. Apache 1.3 PHP configuration

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Example 10. Equivalent Apache 2.0 PHP configuration

<Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
</Files>

2.4.6. mod_perl

Example 11. Apache 1.3 mod_perl configuration

<Directory /var/www/perl>
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
</Directory>

Example 12. Equivalent Apache 2.0 mod_perl configuration

<Directory /var/www/perl>
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    Options +ExecCGI
</Directory>

2.4.7. mod_python

2.4.8. suexec

Example 13. Apache 1.3 suexec configuration

<VirtualHost vhost.example.com:80>
    User someone
    Group somegroup
</VirtualHost>

Example 14. Equivalent Apache 2.0 suexec configuration

<VirtualHost vhost.example.com:80>
    SuexecUserGroup someone somegroup
</VirtualHost>

A. Packaging Changes