![]()
This document describes how to install the version of the Apache web server that is located on the class website, version 1.3.26. You may obtain this version either by clicking here or by going to the class web page and clicking on Download Course Software. If you choose to use this version of Apache, you may follow the detailed instructions below. Otherwise you may download another version from the the Apache web site, but in that case you will have to follow the installation instructions included with the software. If you need assistance you should read the documentation that comes with the Apache package (see the htdocs subdirectory) or go to the online documentation at http://www.apache.org/docs/.
The following procedure describes how to install the Apache 1.3.26 binary,
so that you do not need to compile the software. Once again,
this procedure works ONLY FOR the version of Apache located on the course web site,
namely 1.3.26.
Download and Unpack Apache Package
Step 1: Download the 1.3.26 binary version of the Apache web server from the class website by clicking here or go to the course home page and click on Download Course Software.
Assume your user account directory is /home/scf-03/myname/, and you want to unpack the apache files there.Step 2: unpack the tar package by running "tar xvf apache_n.n.n.tar"
Step 3: you should delete apache_n.n.n.tar which is no longer needed
Step 4: A directory tree /home/scf-03/myname/apache_n.n.n will be created.
Install Apache 1.3.x Binary
Connect to the Apache binary distribution directory just created and do a "pwd" command to get the full path to the apache directory. Then type the following command to install the binary files.
install-bindist.sh /absolute/path/to/apache/directory
Note: The directory /absolute/path/to/apache/directory/
can be a new directory, e.g. /home/scf-03/myname/apache, or the same as the
source distribution, e.g. /home/scf-03/myname/apache_n.n.n. We
recommend that you use the same directory for installation since this way no binary distribution directory will need to be deleted.
If instead you use a new directory for installation,
you may delete the binary distribution directory after the installation has completed. During installation, which could last as long as 5 minutes, you should see this output:
csci571.usc.edu(1): install-bindist.sh /home/scf-03/myname/apache_1.32.26
Installing binary distribution for platform sun4u-sun-solaris2.280
into directory /home/scf-03/myname/apache_1.3.26 ..
[Preserving existing configuration files.]
[Preserving existing htdocs directory.]
Ready.
+--------------------------------------------------------+
| You now have successfully installed the Apache 1.3.26 |
| HTTP server. To verify that Apache actually works |
| correctly you should first check the (initially |
| created or preserved) configuration files: |
| |
| /home/scf-03/myname/apache_1.3.26/conf/httpd.conf
| |
| You should then be able to immediately fire up |
| Apache the first time by running: |
| |
| /home/scf-03/myname/apache_1.3.26/bin/apachectl start
| |
| Thanks for using Apache. The Apache Group |
| http://www.apache.org/ |
+--------------------------------------------------------+
csci571.usc.edu(2):
Configure Apache
The only configuration file Apache uses is conf/httpd.conf. PLEASE examine the directives shown below and make sure they are properly set. You probably do not need to modify the parameters if you installed Apache by its configuration program. However, you must ensure the paths in the configuration files are correct.
o ServerRoot /absolute/path/to/apache/directory
o DocumentRoot your_document_root
o
your document root directory.
<Directory your_document_root>
...
...
</Directory>
The default setting is /absolute/path/to/apache/directory/htdocs/, e.g. /home/scf-03/myname/apache/htdocs/. However, you can change it to any other directory you like.
The following set of directives must be changed. Several of these are quite important as ISD has requested that each of your servers take up only a minimum amount of resources. So please make sure to make all of the following changes:
o MinSpareServers 2
o MaxSpareServers 2
o StartServers 2
o MaxClients 2
o LockFile /var/tmp/httpd.lock (You need to "uncomment" the LockFile line i.e., remove the '#' sign and then change the line as shown above. If you do not change this value you may encounter a problem with the lock file. Check error_log file for more info)
o Port port_selected (for port_selected use the last 5 digits of your class ID as the base for this value)
o ServerAdmin your_email
Starting and Stopping Apache
Students MUST run their server on csci571.usc.edu. To start the server, in directory bin, type apachectl start. The following ouput should be displayed:
csci571.usc.edu(47): apachectl start
apachectl start: httpd started
It is a good practice to check the error log file, e.g. /home/scf-03/myname/apache/logs/error_log, to ensure your server is properly running. You can also check that the Apache 'httpd' processes are running, using the 'ps' UNIX command:
csci571.usc.edu(2): ps -gx
PID TT S TIME COMMAND
21476 ? S 0:01 /home/scf-03/myname/apache_1.3.26/bin/httpd -d /home/scf-03/myname/apache_1.3.26 -R /home/scf-03/myname/apache_1.3.26/libexec
21477 ? S 0:00 /home/scf-03/myname/apache_1.3.26/bin/httpd -d /home/scf-03/myname/apache_1.3.26 -R /home/scf-03/myname/apache_1.3.26/libexec
21478 ? S 0:00 /home/scf-03/myname/apache_1.3.26/bin/httpd -d /home/scf-03/myname/apache_1.3.26 -R /home/scf-03/myname/apache_1.3.26/libexec
Similarly, to stop the server, in director bin, type apachectl stop. The following output should be displayed:
csci571.usc.edu(48): apachectl stop
apachectl stop: httpd stopped
Testing Your Server
By issuing the URL
http://csci571.usc.edu:port_selected/
you should see the Apache default page. Find the page and replace it by the one you create, to make sure your new server is loading the page you think it is.
Remember to allow EVERYONE to have EXECUTE rights (permissions) to your cgi-bin directory and scripts (chmod go+x). You can test it at
http://csci571.usc.edu:port_selected/cgi-bin/test-cgi
Finishing Up Your Web Server Configuration
Below are 2 additional tasks to perform.
please run your server on csci571.usc.edu; DO NOT run your server on nunki.usc.edu or aludra.usc.edu, otherwise, your account will be suspended.
Useful Links for Installing and Configuring the Apache Web Server
File
Download - http://www.apache.org/dist/
Server Documentation - http://www.apache.org/docs/
![]()