Upgrading Apache Web Server in Unix
Roamer - 11/27/00
Recently, Russ asked me to upgrade the Apache Web Server for SecurityHorizon.com. Having had a little experience with Apache
upgrades, I told him that I would be glad to. Upgrading a critical application such as a web server can be an intimidating task to
some System Administrators. Fortunately, upgrading Apache Web Server for Unix platforms is a very quick and easy process. This
paper will present step by step instructions for upgrading Apache Web Server in Unix.
The first and most obvious step is to backup your web files. A proper upgrade of the Apache server will not overwrite your existing
files, however, you should always back up critical files prior to making changes to your configuration. Especially important is
backing up the httpd.conf file. This file contains all of the information used by Apache to process web activity at your server.
To locate the httpd.conf file, type:
find / -name httpd.conf -print
Make sure to take note of the path to httpd.conf as it will be required later in the installation. Create a directory to house your
backups and copy the httpd.conf and all of your html files, graphics etc into that directory.
After you have downloaded the latest version of the software from www.apache.org you will need to create a directory to hold your
install files:
cd $HOME
mkdir apache
mv apache_1.3.14.tar.gz $HOME/apache/
Now you will need to uncompress the files:
cd $HOME/apache
guznip apache_1.3.14.tar.gz
tar -xvf apache_1.3.14.tar
Now you will need to stop the running version of Apache. There are two ways to do this. The best way is to use the apachectl
utility that comes with Apache. To do this, cd into the directory where your httpd.conf file was located. Next cd into the bin
subdirectory and type apachectl stop. The other option is to kill the process manually:
ps -ef |grep httpd
kill -9 <process number for httpd>
Avoid using the second method if possible.
Now change back to the $HOME/apache directory. Now the actual upgrade will take place. This is an extremely easy process. It is
important to understand that the location of your httpd.conf file is the "prefix." For example only, I will be using /apache/httpd/
for a prefix. The upgrade is accomplished by the following four steps:
./configure --prefix=/apache/httpd/
make
make install
/apache/httpd/bin/apachectl start
The final step will restart your web server. It is important now to test the functionality of your web server and ensure that it is
actually up and running correctly. It should be, and you can now move on to other tasks. If it isn't, copy the httpd.conf file from
your backup directory to the prefix directory. That should take care of any problems. Any further complications are beyond the
scope of this paper.
As you can see, upgrading Apache Web Server for Unix to the latest version is a quick and easy process. Because an upgrade can be
accomplished in less than five minutes, your web server will be down for a very short period. By undertaking the upgrade during off
peak hours, you can reduce the impact even more.