Submitter: Bill Parker

Tested on: OpenLinux 2.3

This document is designed to replace the existing Apache 1.3.4 Web Server on OpenLinux 2.3 with 1.3.20 (numerous bug fixes and security issues patched). This does NOT cover adding various module support like php3, ssl, etc.

I would have your CD handy in case you mess this up, and have to go back to 1.3.4 (I use a test box for stuff like this, so if I screw it up, I just start over).

1. type: locate httpd > <your home dir>/httpd.file.locations

2. type: cat /var/lib/LST/installed/apache

these steps give you a good readout on where the apache web server files were installed on your OpenLinux 2.3 system.

3. Obtain the latest apache 1.3 version from www.apache.org

4. cd /usr/local/src <enter>

5. unpack the apache tarball in this directory with:

tar zvxf <apache file name>

6. cd apache_1.3.20 <enter> (this is the latest version as of this date)

7. vi config.layout <enter> (this allows you to add the stuff below to the file (which I borrowed from a Apache 1.3.19.src.rpm for OpenLinux 3.1 and modified for OpenLinux 2.3)

# needs leading empty line!

<Layout OpenLinux>
prefix: /usr
exec_prefix: $prefix
bindir: $exec_prefix/bin
sbindir: $exec_prefix/sbin
libexecdir: /usr/lib/apache
mandir: $prefix/man
sysconfdir: /etc/httpd/apache/conf
datadir: /home/httpd
iconsdir: $datadir/icons
htdocsdir: $datadir/html
cgidir: $datadir/cgi-bin
includedir: $prefix/include/apache
localstatedir: /var
runtimedir: $localstatedir/run
logfiledir: $localstatedir/log/httpd
proxycachedir: $localstatedir/cache/httpd
</Layout>

8. after adding the information to the bottom of the config.layout file, type:

./configure --with-layout=OpenLinux <enter>

9. next, type:

make <enter>

Now before doing the install, you will want to do the following things:

10. cd /etc/httpd/apache/conf <enter>
mkdir old <enter>
cd old <enter>
cp ../* . <enter>

This backs up your existing configuration files for reference

11. cd .. <enter> (goes back one level to /etc/httpd/apache/conf)
rm * <enter> (blows away existing conf files)

12. /etc/rc.d/init.d/httpd stop <enter> (stops apache server)
/etc/rc.d/init.d/httpd stop <enter> (for good measure)

13. cd /usr/sbin <enter> (go to dir where httpd.apache is stored note, when the make is done, your binary will be httpd, not httpd.apache (which can cause a problem with the init script in /etc/rc.d/init.d for httpd).

14. mv httpd.apache httpd.apache.orig <enter> (backs up httpd binary)

15. cd /usr/local/src/apache_1.3.20 <enter>

16. make install <enter> (will install everything to your system)

Now for some fun stuff...I ran into some problems getting httpd working with init scripts, but not with apachectl (default control system for apache), so here is what I did.

17. On OpenLinux 2.3, the logging for the default apache installation is stored in /var/log/httpd/apache, and on this new version it's /var/log/httpd (this convention is followed for apache 1.3.14 which is installed on eServer 2.3, btw). If you use the above layout, you can remove /var/log/httpd/apache from your OpenLinux 2.3 box

18. cd /etc/httpd/apache/conf <enter>

19. vi httpd.conf <enter> (edit default apache config file)

take NOTE of the ServerRoot directive on Line 63 or so, on my original httpd.conf this was /etc/httpd/apache, so that is what it should be for this installation of 1.3.20.

20. the ErrorLog Directive at Line 457 or so should be

/var/log/httpd/error_log

on my old httpd.conf it was

/var/log/httpd/apache/error_log

ditto for the CustomLog Directive at line 482 or so

21. VERY IMPORTANT, make sure in /etc/httpd/apache there is a directory called 'logs', if there is not, cd to /etc/httpd/apache and use mkdir to make one, otherwise you may get a message in /var/log/httpd in the error_log file which looks like this (took me 15 mins to figure this one out):

httpd: [Tue Jun 26 19:02:15 2001] [emerg] (2)No such file or directory: Parent cannot open lock file: /etc/httpd/apache/logs/accept.lock.12090

(all because there was no 'logs' directory below the value defined for ServerRoot in httpd.conf (nasty)

22. cd /usr/sbin <enter> (this is to correct httpd so it works with apachectl as well as /etc/rc.d/init.d/httpd script)

23. ls -al httpd* <enter> (by default, you may only see the following)

rwxr-xr-x 1 root root 493823 Sep 19 2000 /usr/sbin/httpd.apache

on my system, I now have the following

$ ls -al /usr/sbin/httpd*
lrwxrwxrwx 1 root root 12 Jun 26 19:16 /usr/sbin/httpd -> httpd.apache -rwxr-xr-x 1 root root 516484 Jun 26 18:49 /usr/sbin/httpd.apache

Now notice that httpd is actually a symlink on my system, this is due to the fact that when apache 1.3.20 installs, it names the binary 'httpd' instead of 'httpd.apache' as the init script in /etc/rc.d/init.d/httpd expects it. By doing this, I can stop and start apache with the init script or with apachectl.

24. updatedb <enter> (updates locate database)

25. The final test (hopefully it works)

cd /etc/rc.d/init.d <enter>
./httpd stop <enter> (stops web server, just in case)

System should respond:

Stopping apache httpd: httpd.

./httpd stop <enter> (for good measure)

System should drop down to next bash prompt:

to see what is really going on, check the error_log in
/var/log/httpd and it should look like this:

[Tue Jun 26 18:50:11 2001] [notice] caught SIGTERM, shutting down

./httpd start <enter> (starts web server)

System should respond:

Starting WWW services (apache): httpd.

if you do a ps ax <enter> you should see:

12346 ? S 0:00 httpd -f /etc/httpd/apache/conf/httpd.conf
12348 ? S 0:00 httpd -f /etc/httpd/apache/conf/httpd.conf
12349 ? S 0:00 httpd -f /etc/httpd/apache/conf/httpd.conf
12350 ? S 0:00 httpd -f /etc/httpd/apache/conf/httpd.conf
12351 ? S 0:00 httpd -f /etc/httpd/apache/conf/httpd.conf
12352 ? S 0:00 httpd -f /etc/httpd/apache/conf/httpd.conf

In /var/log/httpd/error_log you should see:

[Tue Jun 26 20:39:53 2001] [notice] Apache/1.3.20 (Unix) configured
-- resuming normal operations

If you run apache with the 'apachectl' command, you type in:

apachectl <enter>

you will get the listing below:

usage: /usr/sbin/apachectl (start|stop|restart|fullstatus
|status|graceful|configtest|help)

start - start httpd
stop - stop httpd
restart - restart httpd if running by sending a SIGHUP or
start if not running
fullstatus - dump a full status screen; requires lynx and mod_status enabled
status - dump a short status screen; requires lynx and mod_status enabled
graceful - do a graceful restart by sending a SIGUSR1 or start if not running
configtest - do a configuration syntax test
help - this screen

so in this case, after shutting down httpd with the init script, I
decided to start httpd with apachectl, so I typed:

apachectl start <enter>

The system responded:

/usr/sbin/apachectl start: httpd started

a 'ps ax' listing showed the following:

12378 ? S 0:00 /usr/sbin/httpd
12379 ? S 0:00 /usr/sbin/httpd
12380 ? S 0:00 /usr/sbin/httpd
12381 ? S 0:00 /usr/sbin/httpd
12382 ? S 0:00 /usr/sbin/httpd
12383 ? S 0:00 /usr/sbin/httpd
12384 pts/1 R 0:00 ps ax

a 'tail -80 /var/log/httpd/error_log' showed the following:

[Tue Jun 26 20:44:24 2001] [notice] Apache/1.3.20 (Unix) configured
-- resuming normal operations

and so forth.

The final test is to see if your web browser can bring up the default caldera systems web page by going to:

http://<IP addr> <enter> (in a browser)

or

http://localhost <enter> (in a browser)

or

http://<full URL> <enter> (in a browser)

and if you get the page:

Caldera Systems OpenLinux 2.3 Online Help

Default Home Page for Apache Web Server

You are up and running!!!

Note: Make sure to check that you are running the version you compiled (in my case 1.3.20) by checking information in /var/log/httpd error_log (I found I was running my old version of 1.3.4 due to the httpd not being named httpd.apache for OpenLinux 2.3)

Also: if you are running any sort of modules like PHP3/4, mod_ssl, etc you will probably have to configure 1.3.20 to make use of those modules which you compiled. I know that eServer 2.3.x makes use of perhaps JSERV, PHP3, and mod_ssl (if started with it).

-Bill
 
 

Index