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:
For dependencies
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.
# First, we configure the "default" to be a very restrictive set of # permissions.In other words, don't allow anything to be visible unless specifically told otherwise.Options None AllowOverride None
# 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 wherever.wellesley.edu. 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.Put all CGI scripts into /home/httpd/cgi-bin.AllowOverride None Options ExecCGI
# Extra Modules #LoadModule php_module modules/mod_php.so #LoadModule php3_module modules/libphp3.so LoadModule perl_module modules/libperl.soIf 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.cThis 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 nobodyThis 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@localhostIf 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_htmlThese are standard.
# To use CGI scripts: AddHandler cgi-script .cgi # To use server-parsed HTML files AddType text/html .shtml AddHandler server-parsed .shtmlIt 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/This should allow perl scripts to be embedded in documents.SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI
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: http://sitename.wellesley.edu/Foldername/pagename.html.
User pages should be put into folders called public_html in the user directories. /home/juniper/public_html/index.html would translate to http://ariel.wellesley.edu/~juniper/index.html.
Apache comes configured to disallow directory listings; thus if the request comes for http://ariel.wellesley.edu/~juniper/images/ 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: