CGS3993, Assignment 4
Due Thursday 3/11 at the start of class.
You are to add several links to your server's home page. List the links in
the left frame, have the contents display in the right frame. You will also
add several Aliases to your document root, as well as adding some error documents
and scripting ability. You will need to create some files and modify your
srm.conf and access.conf files. Hand in printouts of your srm.conf and
access.conf files.
-
Create the following directories if you don't have them already
-
3993.server/cgi-bin
-
3993.server/errors
-
3993.hw4files
-
3993.data/links
-
Create the following aliases
-
ScriptAlias /3993.cgi-bin to the cgi-bin in your server root directory.
-
Alias /3993.errors to the errors directory in your server root.
-
Alias each of the following to the 3993.hw4files directory
-
/ssi
-
/cgi
-
/noexec
-
/none
-
/all
-
/language
-
Allow files with the extensions .cgi and .pl to be executed as scripts
-
Allow files with the extension .shtml to be server parsed
-
Allow language negotiation, but do not turn it on. Allow for English (.en)
and French (.fr)
-
Create HTML error documents in the errors directory for 403, 404, and 500
errors. When such errors occur on your server, then these files are the ones
that should display.
-
Place the following perl script named 500error.pl in your cgi-bin directory.
Be sure it has world execute permission.
#!/usr/local/bin/perl
print "This will cause a 500 error when called from the web\n";
-
Create the following files in the 3993.hw4files and 3993.data/links directories
-
Create a file named noaccess.txt that contains the text "No Access". Change
the mode of this file to 000.
-
Create an HTML page named errors.html that will contain the following links
-
A link to a file that doesn't exist. When selected, the 404 error document
you created should be displayed.
-
A link to the 500error.pl script in your cgi-bin directory. When selected,
the 500 error document you created should be displayed.
-
A link to the noaccess.txt file. When selected, the 403 error document you
created should be displayed.
-
A link to language.html. Do not create the file. This link will be used for
language negotiation.
-
Create a soft link to the errors.html page
ln -s errors.html soft_link.html
-
Create two files for language negotiation. Indicate in each file that it
represents either English or French. Be sure that you include the
<meta http-equiv="pragma" content="no-cache">
in the header
of each file.
-
language.html.en
-
language.html.fr
-
Create a cgi-script named table.cgi in this directory that will display a
table. Be sure it has world execute permission. Change the font color
of the table, and the background color of the table depending on the seconds
of the current date. You can change the background of the entire table by
placing the bgcolor attribute in the <table> tag. You will need to
use a <font> ... </font> on each data element in the table to
change the color of the text. Get the seconds from the command
/usr/bin/date +%S
. If the seconds are less than 30 then display
a light background with dark text, otherwise display a dark background with
a light text.
-
Create two files as follows
-
A file named paragraph1.html that contains an H1 header and a paragraph that
is aligned in the center.
-
A file named paragraph2.html that contains an H2 header and a paragrpah that
is aligned to the right.
-
Create a file named includes.shtml that will implement the following server
side includes
-
Include the current time
-
Inlcude the date that this file was last modified
-
Execute the system command
/usr/bin/ls
-
Execute the cgi script table.cgi.
-
Include the file paragraph1.html
-
Include the file paragraph2.html
-
Add <Location> .. </Location> tags to the access.conf file for
the following directories
-
/ssi, allow directory indexes and server side includes
-
/noexec, allow directory indexes and server side includes, excluding execute
statements
-
/language, allow directory indexes and content negotiation
-
/cgi, allow directory indexes and cgi scripting
-
/all, allow all options including content negotiation
-
/none, allow no options
-
Add a <Directory> .. </Directory> tag in the access.conf file
for 3993.data/links. Allow directory indexes and following symbolic links.
-
Add links in the left frame of the server's home page to the following
directories
-
/ssi
-
/noexec
-
/cgi
-
/all
-
/none
-
/language
-
/links