Upgrading Apache


Like MySQL, upgrading or rebuilding Apache follows the same process as installing the software in the first place. Windows users have the benefit of an Installer application, which automatically detects the previous version, removes core components, and installs new ones. The Windows Installer will, however, retain existing configuration files. You are responsible for upgrading any other version-specific modules, such as mod_ssl, which are tied to specific versions of Apache.

For UNIX/Linux users, the process also follows the same path as the original installation. When you unpack your new distribution, it creates a directory named with the new version number. For example, if your previous version was 2.0.54 and you are upgrading to 2.0.55, your directories will be named httpd-2.0.54 and httpd-2.0.55, respectively.

The actual installation directory for Apache is determined by you, when you run the configure script, as in this example:

# ./configure --prefix=/usr/local/apache2


After running the configure script to build the new version of Apache, just go through the make and make install process as you did when installing Apache in the first place.

Now, should you want to install your new version of Apache directly over your old version, you caneven with the old httpd binary still running. Just be sure to back up your configuration files in case something goes awry. However, if you are more comfortable installing your new version in a different directory, that's fine, tooyou'll just have to move all your Web-related files (that is, everything in the document root) to the new directory and make all appropriate edits to your fresh, new httpd.conf file. Whichever method you choose is up to you; one method just requires more file movement and reconfiguration than the other.

After upgrading Apache on UNIX/Linux, you should also rebuild your PHP module. Windows users do not have a module to rebuild but should ensure that the appropriate PHP-related changes are still present in the httpd.conf file, related to loading the module residing in the PHP directory tree.

Modifying Apache Without Upgrading

Suppose you need to add or remove functionality from Apache but are not upgrading to a new minor version. An example would be to add a new module or to upgrade the version of OpenSSL used on your system.

In this case, UNIX/Linux users should go to the existing source directory (such as httpd-2.0.55) and type make clean at the prompt. This will, essentially, reset the makefiles so that you can rebuild Apache without relying on previous, cached values. After the make clean command, run the configure script with your new parameters, and go through the make and make install process again. You would not need to rebuild the PHP module in this situation.

Windows users would activate the prebuilt modules by uncommenting the appropriate lines in httpd.conf or by adding the lines if they do not already exist.




Sams Teach Yourself PHP, MySQL And Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (3rd Edition)
ISBN: 0672328739
EAN: 2147483647
Year: 2004
Pages: 327

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net