Due Thursday 2/5 at the start of class
You are to run your own version of the Apache web server on mongoose.aul.fiu.edu
and set up some directories with specific permissions. You will create a
home page for your server using frames and a clickable image map.
Creating the directory structure
Set up the following directory structure
-
server3994
-
conf
-
icons
-
cgi-bin
-
data
-
logs
You can achieve this with the following commands
-
cd ~
-
mkdir server3994
-
cd server3994
-
mkdir conf
-
mkdir icons
-
mkdir cgi-bin
-
mkdir data
-
mkdir logs
[Back to Top]
Copying the configuration files
Next, get a copy of the configuration files for the server
-
cd ~/server3994/conf
-
cp /home/mongoose2/http/conf/*.conf .
-
cp /home/mongoose2/http/conf/mime.types .
[Back to Top]
Editing the configuration files
Next, edit each of the following files in your conf directory, you can use
the pico editor
-
httpd.conf
-
You must select a port number between 1024 and 65535. Send me an e-mail
requesting the port number that you would like to use. I will let you know
if another student has already requested that number.
Request a port number. Change the
Port option to your confirmed port number. It is still possible that
some other process is using that port. In that case you will receive a message
that your server couldn't bind to that port. Then you will need to request
a different port number from me.
-
Comment out the User and Group options by placing a # at the
start of the line.
-
Change the ServerAdmin address to your e-mail address.
-
Change the ServerRoot to your root directory:
/home/mongoose2/users/dlette07/server3994, replacing dlette07 with your mongoose
user name.
-
Change MinSpareServers to 1
-
Change MaxSpareServers to 1
-
Change StartServers to 1
-
Change MaxClients to 5
-
Change MaxRequestPerChild to 10
-
access.conf
-
The first <Directory ... > tag should be for your data directory:
/home/mongoose2/users/dlette07/server3994/data, replacing dlette07 with your
mongoose user name.
-
Options None
-
AllowOverride All
-
order allow,deny
allow from all
-
srm.conf
-
DocumentRoot should be for your data directory:
/home/mongoose2/users/dlette07/server3994/data, replacing dlette07 with your
mongoose user name.
-
UserDir www3994
-
DirectoryIndex home.html
[Back to Top]
Now you are ready to start the server
-
Create a symbolic link to where the server software is (only create this
link once)
-
cd ~/server3994
-
ln -s /home/mongoose2/http/bin ./bin
-
Start the server
bin/httpd -d ~/server3994
If you can't get the ln command top work, then just do it the long way:
/home/mongoose2/http/bin/httpd -d ~/server3994
[Back to Top]
To kill the server
-
cd ~/server3994/logs
-
kill -TERM `cat httpd.pid` (note that this is the back tick `, not
the apostrophe '. The back tick is the lower case of the ~ key)
If this fails, you can find the process ID (PID) of your server with the
ps command. Then you can just stop the server with the command kill
-TERM pid, where pid is the number you get from the
ps command. However, you must be using the correct version of
ps, and give it two options g and x. You will see several
servers listed, the one with the lowest pid is the original server:
stopping it will stop all the others. To see your server processes
[Back to Top]
Creating directories and setting access rights
Here is the rest of the assignment
-
Create five directories in your data directory (use the mkdir command
to create a directory)
-
ssi
-
cgi
-
index
-
ssi_cgi
-
noaccess
-
For each of these directories, add a .htaccess file (do not put a .htaccess
file in the data directory)
-
ssi: allow indexes and SSI include directives
-
cgi: allow indexes and CGI executables
-
index: only all indexes
-
ssi_cgi: allow indexes, SSI, and CGI
-
noaccess: do not put a .htaccess in the noaccess directory
-
Each directory should contain the files in the
~downeyt/public_html/cgs3994/assign2 directory
-
Change to each directory and issue the following command
-
cp ~downeyt/public_html/cgs3994/assign2/*.* .
Be sure to change Please note: The final space and period are very important.
The command won't work without them.
Be sure that the hello.cgi file has world execute in each directory,
or the cgi script won't work:
chmod 501 hello.cgi
-
Create a home.html file in your data directory
-
It should have two frames, left and right
-
The left frame should not have scroll bars, and should be 200 pixels wide
-
The right frame should take up the rest of the screen and be scrollable
-
The left frame should contain a clickable image map that will take you to
each of the five directories you have created. For examples of image maps
see the book, pages 423 and 426-427. Also, my home page
has a signature at the bottom that is a clickable image map, as well
as the URL we discussed in class:
www.cnnsi.com
-
Do not have a home.html file in any of the five new directories. Only have
one in the data directory.
-
When you click the appropriate area of the image map, it should bring up
the corresponding directory into the frame on the right. The left frame should
always contain the image map.
-
Suggestion: do the image map last. First get the frames working by having
a list in the left frame. Later, add the image map. AOLPress in the AUL can
create the image map info for you. Double click the image, and then choose
the menu, Element, Image Map .... You can use Paint or Paintbrush
to create the image in BMP format, then upload it to mongoose and use convert
to change it to JPG ot GIF. Keep the picture simple so that you can create
the image map by hand if you need to. Also, there is a program in the AUL
that will convert for you, or just use it to create the image in a BMP or
JPG format.
-
Send me an e-mail with your server address and port when you are done.
[Back to Top]