CSCI A348/548
Lecture Notes One

Spring 2001 (Second semester 2000-2001)


Building the latest Apache server from scratch.

This installation should last about 40 minutes.

1. Log into your burrowww account.

2. Make sure you're in the home directory (cd).

3. Create a new, empty apache directory, and move there.

cd ~
mkdir apache
cd apache
You can, if you want, skip to step 10, now.

4. Start netscape in the background (netscape &) then connect to:

http://www.apache.org
5. Click seventh link on left, "Apache Server".

6. Click first link on the column at right, "Download".

7. Click on the apache_1.3.14 link on the page that reads

[img] apache_1.3.14.tar.gz      10-Oct-2000 13:34   1.7M  1.3.14 gzipped source
As of the time stamp of this page it's about 20th or 22nd link, so it may change.

8. The dialog window that will pop up should offer to save the file as

/u/username/apache/apache_1.3.14.tar.gz
Press OK, then wait for the download to complete (may take4 more or less depending on the load).

9. Exit Netscape.

10. You could also start by copying this from my account:

/u/dgerman/public/apache_1.3.14.tar.gz
11. Uncompress the file using gunzip.

12. Unpack the resulting archive using tar (with xvf as command-line switches).

13. From here on you will need to check your quota (quota -v) frequently, so do it now, once.

14. Remove the .tar file, check quota.

15. Go into the apache_1.3.14 directory and look around.

16. Use more to look at

  1. ABOUT_APACHE
  2. INSTALL
  3. LICENSE
  4. README
plus any other files that look interesting to you.

17. Run configure:

./configure --prefix=/u/username/apache/apache_1.3.14
Here's my run through it:
burrowww.cs.indiana.edu% pwd
/nfs/paca/home/user1/dgerman/apache/apache_1.3.14
burrowww.cs.indiana.edu% ./configure --prefix=/u/dgerman/apache/apache_1.3.14
Configuring for Apache, Version 1.3.14
 + using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for Solaris 270 platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + checking for system header files
 + adding selected modules
 + checking sizeof various data types
 + doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/lib/expat-lite
Creating Makefile in src/modules/standard
burrowww.cs.indiana.edu% 
18. Now run make.

Here's my run:

burrowww.cs.indiana.edu% make
===> src
make[1]: Entering directory `/nfs/paca/home/user1/dgerman/apache/apache_1.3.14'
make[2]: Entering directory `/nfs/paca/home/user1/dgerman/apache/apache_1.3.14/src'
===> src/os/unix
gcc -c  -I../../os/unix -I../../include   -DSOLARIS2=270 -DUSE_EXPAT -I../../lib/expat-lite -DNO_DL_NEEDED `../../apaci` os.c
gcc -c  -I../../os/unix -I../../include   -DSOLARIS2=270 -DUSE_EXPAT -I../../lib/expat-lite -DNO_DL_NEEDED `../../apaci` os-inline.c
[lots deleted] 
sed apxs \
    -e 's%@TARGET@%httpd%g' \
    -e 's%@CC@%gcc%g' \
    -e 's%@CFLAGS@% -DSOLARIS2=270 -DUSE_EXPAT -I../lib/expat-lite -DNO_DL_NEEDED `../apaci`%g' \
    -e 's%@CFLAGS_SHLIB@%%g' \
    -e 's%@LD_SHLIB@%%g' \
    -e 's%@LDFLAGS_MOD_SHLIB@%%g' \
    -e 's%@LIBS_SHLIB@%%g' && chmod a+x apxs
make[2]: Leaving directory `/nfs/paca/home/user1/dgerman/apache/apache_1.3.14/src/support'
<=== src/support
make[1]: Leaving directory `/nfs/paca/home/user1/dgerman/apache/apache_1.3.14'
<=== src
burrowww.cs.indiana.edu% 
19. Then run make install.

Here's my run through it:

burrowww.cs.indiana.edu% make install
make[1]: Entering directory `/nfs/paca/home/user1/dgerman/apache/apache_1.3.14'
===> [mktree: Creating Apache installation tree]
./src/helpers/mkdir.sh /u/dgerman/apache/apache_1.3.14/bin
[lots deleted]
./src/helpers/install.sh -c -m 644 ./conf/magic /u/dgerman/apache/apache_1.3.14/conf/magic.default
[PRESERVING EXISTING CONFIG FILE: /u/dgerman/apache/apache_1.3.14/conf/magic]
<=== [config]
make[1]: Leaving directory `/nfs/paca/home/user1/dgerman/apache/apache_1.3.14'
+--------------------------------------------------------+
| You now have successfully built and installed the      |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the         |
| (initially created or preserved) configuration files   |
|                                                        |
|   /u/dgerman/apache/apache_1.3.14/conf/httpd.conf
|                                                        |
| and then you should be able to immediately fire up     |
| Apache the first time by running:                      |
|                                                        |
|   /u/dgerman/apache/apache_1.3.14/bin/apachectl start
|                                                        |
| Thanks for using Apache.       The Apache Group        |
|                                http://www.apache.org/  |
+--------------------------------------------------------+
burrowww.cs.indiana.edu% 
20. Read the summary note (see above).

21. Configure httpd.conf in the new server's conf directory.

This file was generated automatically by the installation process.

(Copy it into httpd.conf-backup before making any changes.)

Here are the changes I made:

burrowww.cs.indiana.edu% diff httpd.conf httpd.conf-backup
76c76
< LockFile /tmp/apache1.3.14.lockfile.dgerman
---
> #LockFile /u/dgerman/apache/apache_1.3.14/logs/httpd.lock
238c238
< Port 20000
---
> Port 8080
252c252
< User dgerman
---
> User nobody
260c260
< ServerAdmin dgerman@indiana.edu
---
> ServerAdmin dgerman@burrowww.cs.indiana.edu
952,958d951
So I only changed:
  1. The LockFile directive (please be careful with that!)
    Use: /tmp/apache1.3.14.lockfile.username
  2. The Port
    Your port will be 20xxx as listed on the students page.
  3. The User
    Please use your username.
  4. The ServerAdmin address.
    Use your @indiana.edu address.
22. You can now start the new server.

/u/username/apache/apache_1.3.14/bin/apachectl start
23. Check your new web server over the web at burrowww.cs.indiana.edu:20xxx

Here's mine. (Change your index.html accordingly).

Note: also try the Korean or Japanese version.

24. Set your crontab for your server to be re-started (gracefully) every morning at 8:10am.


Last updated on Jan 9, 2001, by Adrian German for A348/A548