The Apache Webserver

The Apache Webserver was named because it was a "Patchy" Webserver; it was patched together by many different people, in a sporadic and uncoordinated fashion. Because it is so complicated, a full explanation of how to configure it is beyond the scope of this paper. Further, by the end of the study, it still was not working perfectly on Ariel, so this information is incomplete. It does provide a good base from which to begin, however.

The first step is to install the Webserver and all the necessary packages that come with it. This can be accomplished during the install of the RedHat packages.

If the install is a custom install, make certain to install these packages:

The Webserver package does *not* automatically install the mod_perl package; make sure to select it for install.

After the installation is complete, su to root, and cd /etc/httpd/conf. In this folder are four files, three of which need to be edited to correctly configure the Apache webserver.


The portions of the access.conf file which may need to be edited are listed with comments below:
# First, we configure the "default" to be a very restrictive set of
# permissions.

Options None
AllowOverride None
In other words, don't allow anything to be visible unless specifically told otherwise.
# This should be changed to whatever you set DocumentRoot to.

This is where you put the first page that people see when they go to Ariel's front page goes here.
# /home/httpd/cgi-bin should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.

AllowOverride None
Options ExecCGI 
Put all CGI scripts into /home/httpd/cgi-bin.


The important portions of the httpd.conf file that may need to be edited are listed with comments below:
# Extra Modules
#LoadModule php_module         modules/ 
#LoadModule php3_module        modules/   
LoadModule perl_module        modules/
If the perl_module line is not uncommented, embedded perlscripts will not work. (They still don't on Ariel.)
# Extra Modules
#AddModule mod_php.c   
#AddModule mod_php3.c 
AddModule mod_perl.c
This tells the server where to find the extra modules and whether to load them or not.
# User/Group: The name (or #number) of the user/group to run httpd as.
#  On SCO (ODT 3) use User nouser and Group nogroup
#  On HPUX you may not be able to use shared memory as nobody, and the
#  suggested workaround is to create a user www and use that user.
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 60000;
#  don't use Group nobody on these systems!

User nobody
Group nobody
This is the name of the account the webserver runs under. Depending on how the server is to be configured, it may be necessary to change these names if the account name is changed.
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.

ServerAdmin root@localhost
If the email should go to someone else, this is the place to change the address.


# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.

DocumentRoot /home/httpd/html

# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is recieved.

UserDir public_html
These are standard.
# To use CGI scripts:
AddHandler cgi-script .cgi

# To use server-parsed HTML files
AddType text/html .shtml
AddHandler server-parsed .shtml
It may be necessary to uncomment these lines; if the server is to parse server-side includes, also known as embedded scripts, the html files containing them should have the extension .shtml and these lines must be uncommented.
# To enable the perl module (if you have it installed), uncomment
# the following section
Alias /perl/ /home/httpd/perl/

SetHandler perl-script  
PerlHandler Apache::Registry
Options +ExecCGI
This should allow perl scripts to be embedded in documents.
Once these documents have been edited, reboot your machine to have them take effect, and the Web Server should be up and running.

The next step is to set up user web pages and the front page. The first page that comes up upon loading the site should be put into /home/httpd/html/index.html. Any other pages can be put into subfolders of this directory, which means that their URLs will be:

User pages should be put into folders called public_html in the user directories. /home/juniper/public_html/index.html would translate to

Apache comes configured to disallow directory listings; thus if the request comes for and there is no index.html file inside the /home/juniper/public_html/images directory, the server will return a "You are not allowed to access that directory message."

Also, the public_html folders must be chmodded to allow them to be visible to the server. What this means is that the user must:

This is the basic setup for all server-readable folders. Any folder that the server is to have access to must be contained within other readable folders, and must have either a graphic or an html document directly referenced.

Other Resources

Other resources for the Apache Webserver are available on the web. The Apache Webserver FAQ is likely to be the best place to start looking, however.
Return to the Index Page.

  • Created: May 14, 1999
  • Last updated: May 14, 1999