Apache DevCenter

oreilly.comSafari Books Online.Conferences.

We've expanded our LAMP news coverage and improved our search! Search for all things LAMP across O'Reilly!

Search
Search Tips

advertisement

Listen Print Discuss Subscribe to Apache Subscribe to Newsletters
Apache 2.0 Basics

Migrating from Apache 1.3 to Apache 2.0

06/19/2001

In my last article, we discussed how to configure and install Apache 2.0. That's a good start, but it doesn't go far enough for anybody who is currently running a server on Apache 1.3. Not only do you want to configure and install Apache 2.0, but you also need to ensure that when migrating, you upset your service for as little time as possible.

All of the lessons learned in this article come from porting the apache.org web server to Apache 2.0. This was done last December, long before the first beta was released, so while some of the details will not apply anymore, the lessons learned are all still valid. I also need to give credit where it is due: I never did get apache.org running Apache 2.0. I started it and then, for personal reasons, I left the job for Greg Ames to finish. I watched what he did, and helped with some of the problems that were encountered, but Greg is the person who succeeded in getting apache.org onto a 2.0 server.

When planning for making the change over, our first priority was to not interrupt service on apache.org at all. Apache.org is not the busiest site on the Web, but in the middle of the day we can get hit pretty hard, and when our site goes down people take notice. With that in mind, we planned to put an installation of Apache 2.0 on port 8091 and announce that server so that we could watch how well it handled. After a week of allowing people to stress test the server, we would turn it on live on port 80.

Decisions on Multiprocessing

Even before trying to setup our server, we had to make some decisions. Apache 2.0 is much more flexible than Apache 1.3 when it comes to configuring the server. The first decision to make is which Multiprocessing Module (MPM) to use. (For a full description of MPMs, see my first article in this series.)

I suggest starting with the prefork MPM. Enough has changed with Apache 2.0 that it will help to start with a model that is well understood and is known to work. Once your new Apache 2.0 server is up and serving pages, you can start to experiment with new MPMs to determine which will work best for your site.

Comment on this articleInterested in asking Ryan a few more questions? Post them here, and we'll try to find the answers to help your migration.
Post your comments

Related Articles:

Installing Apache 2.0

Getting, Installing, and Running Apache

Deploying Web Applications to Tomcat

Securing Your Apache Server

AxKit: An XML-Delivery Toolkit for Apache

MPMs can affect your server beyond just how processes and threads are created. The best example of this is mod_cgid. Most versions of Unix do not fork threaded processes well; instead of creating a new single-threaded process, they tend to copy the entire process, including all of the threads, and then kill off all but one thread. Obviously, this is not a very efficient way to create processes.

The solution that the Apache developers have created is to have a CGI daemon that Apache uses to create new CGI processes. This daemon process is created before any child processes are created, and it is a single-threaded process. When a CGI request is received, it is sent to the CGI daemon, and that daemon process forks to create the CGI process. The CGI process then sends the resulting data back to the child process to be sent to the client. This module is not as advanced as the standard mod_cgi, so if you are setting up your server with a threaded MPM, and you find CGI requests are causing trouble, you may want to downgrade to mod_cgi to determine if the problem still exists. mod_cgi will still work with threaded MPMs, but its performance will not be optimal.

Setting Filters

The final major difference between Apache 1.3 and 2.0 is the addition of filters. For programmers, filters are a powerful way to modify data that another module creates. For administrators, filters require that some topics be completely rethought. The only standard module that implements a filter is mod_include, so we will focus on that module. In Apache 1.3, if you wanted all .shtml files to be parsed for server-side includes, you would use a line like

AddHandler server-parsed .shtml

In Apache 2.0, there is no server-parsed handler, so this does not work. Instead, you need to add the INCLUDES filter with a line like

SetOutputFilter INCLUDES

This directive can be specified in Files, Directory, or Location containers to make sure that any data being sent to the client can be parsed for server-side includes. This does mean that your config file may get larger and harder to read. It also means that mime-types aren't as important as they once were in Apache, and Handlers are no longer very important, either. Most modules that generate data will just use the default-handler to read a file from the disk, and use a filter to modify that data.

Difficulties with IPv6

Unfortunately, setting up our server proved much harder than we originally expected. The first problem we hit was specifying virtual hosts; one machine hosts all of the Apache.org sites, so obviously we consider this an important ability for the server. The problem we had was that apache.org runs on a platform that understands both IPv4 and IPv6. Apache 2.0 supports IPv6 automatically, but the problem is that on platforms that support IPv6, it is supported too well.

Apache: The Definitive GuideApache: The Definitive Guide
By Ben Laurie & Peter Laurie
Table of Contents
Index
Sample Chapter
Full Description
Read Online -- Safari

If your platform supports IPv6, it is very difficult to make Apache 2.0 use IPv4. The Apache developers have discussed using a configuration flag to determine which type of address to use; however, this directive has not been implemented yet. For now, if you find that you have problems accessing your server, the problem is likely to be the IPv6 support. To solve this problem, you can use the * specifier throughout your config file to specify IP addresses. This will cause your server to bind to the same port on all addresses.

Once we did get the server running on port 8091, we let it run for a week before turning it on live. When we did, we found that the server was not really stable enough to go live, and the machine stopped responding after a few hours.

Why did that happen? Just because a server is tested, that doesn't mean it will work as a live server. There are many subtle differences between browsers that can cause small bugs that are difficult to find.

Conclusion

The above issues are the ones that caused us the most trouble as we migrated the apache.org site from 1.3 to 2.0. While this article does not cover every problem you will have while moving to Apache 2.0, I hope that I have provided an answer to the most common issues, and given you a starting point for your own migration.

I would remind you that Apache only gets better when users provide feedback to the developers, so if you find a problem that you can not solve, please post bugs to the bug database at http://bugs.apache.org and use the newsgroups mentioned there for more help. Many of the Apache developers spend time on the newsgroups, and are happy to help in any way we can.

In my next column, I'll explain how to write filters, a new mechanism for enabling one module to modify another.

Ryan Bloom is a member of the Apache Software Foundation, and the Vice President of the Apache Portable Run-time project.


Read more Apache 2.0 Basics columns.

Return to the Apache DevCenter.


Interested in asking Ryan a few more questions? Post them here, and we'll try to find the answers to help your migration.
You must be logged in to the O'Reilly Network to post a talkback.
Post Comment
Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • apache 2.0
    2006-09-11 04:56:26  senkumar [Reply | View]

    Hi,

    i want to know differ's between the apache 1.3 and apache 3.0.Is there any different platform can be enable?
  • Migration from 1.3 to 2.0.46 problems
    2005-01-11 06:27:30  surya24 [Reply | View]

    I recently migrated from apache 1.3 on redhat7.2 to 2.0.46 on rhel 3.0 . I am running a proxy server with the new apache by calling a proxy.conf file with ProxyPass and ProxyPassReverse ,this will inturn redirect to another webserver. This setup was perfectly working in previous apache .But with the new apache it is not working . Just in case to check whether the other components are working fine or not I compiled the old apache again on this machine and checked ,which is working absolutely fine . SO I understand that some changes in the new apache are causing problem .
    Normal functionality of the entire website is fine but when you click on a particular link to view an activex based document , it will downlaod an activex component and then tries to show the document and goes to page not found error . I enabled log level to debug but not able to find anything unusual. When something is wrong in my setup elsewhere why is the old apache working . I am trying to understand how to debug this problem . If someone can help me to debug I am ready to provide more information ..

    Btw I am using the standard apache provide by redhat which is compiled with following options
    $/usr/sbin/httpd -V
    Server version: Apache/2.0.46
    Server built: Sep 25 2003 09:26:39
    Server's Module Magic Number: 20020903:4
    Architecture: 32-bit
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D HTTPD_ROOT="/etc/httpd"
    -D SUEXEC_BIN="/usr/sbin/suexec"
    -D DEFAULT_PIDLOG="logs/httpd.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="logs/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="conf/mime.types"
    -D SERVER_CONFIG_FILE="conf/httpd.conf"
    ------------------------------------------------------

    Thanks in advance .

    Rgds
    Surya
  • Need to reconfigure Apache?
    2002-10-29 21:06:16  anonymous2 [Reply | View]

    I recently switched IPs. To my chagrin, I've discovered this IP blocks port 80, which I need for my web server. I'm using a service which associates my domain name with my dynamic IP address. With their help, I have correctly configured my client to redirect to port 8111. Now, do I also have to reconfigure Apache to work via port 8111, or does that happen dynamically? If I do need to do this, how do I go about it with a dynamic IP address? Thanks.
  • Serving PDF Documents
    2002-08-06 09:08:17  gschultz [Reply | View]

    We are migrating from Apache 1.3.26 to 2.0.39 on WindowsNT 4 Service Pack 6. Large PDF Documents (over 200k) that we're served OK from the 1.3.26 server are not serving OK from 2.0.39. Is there anything we're missing in our migration?

    Gary Schultz
    Web Administrator
    Wisconsin Department of Commerce
    gschultz@commerce.state.wi.us


Tagged Articles

Post to del.icio.us

This article has been tagged:

apache

Articles that share the tag apache:

Multiuser Subversion (38 tags)

Introducing LAMP Tuning Techniques (32 tags)

Apache Web-Serving with Mac OS X: Part 1 (26 tags)

Introducing mod_security (25 tags)

Location, Location, Location: Tips for Storing Web Site Files (22 tags)

View All

linux

Articles that share the tag linux:

Managing Disk Space with LVM (74 tags)

Use Your Digital Camera with Linux (60 tags)

mdadm: A New Tool For Linux Software RAID Management (59 tags)

Asterisk: A Bare-Bones VoIP Example (43 tags)

View All

reference

Articles that share the tag reference:

What Is Web 2.0 (328 tags)

Rolling with Ruby on Rails (116 tags)

Top Ten Mac OS X Tips for Unix Geeks (113 tags)

Very Dynamic Web Interfaces (39 tags)

Top Ten Digital Photography Tips (36 tags)

View All

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

O'Reilly Media

©2009, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
O'Reilly FYI
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com