CGS3990, Fall 1998, Assignment 5
Due Tuesday 10/27 at the start of class
Implement all of the following in either mime.types, httpd.conf, srm.conf,
or access.conf. Do not implement the following in .htaccess files.
-
Hand in a printout of your mime.types, httpd.conf, srm.conf and access.conf
files.
-
Send me an e-mail when your page is done. Include the password that you will
choose for me below. Include your mongoose user name in the e-mail, too.
-
I have a server running on mongoose:
http://mongoose.aul.fiu.edu:65432,
and a virtual host at 65433.
-
Enable fancy indexes for all directories.
-
Create a directory in your document root named ipaddress that only
allows access from the following IP addresses. In other words, even you won't
have access to this directory, just me!
131.94.130.21
131.94.125.142
-
Create a directory in your document root named valid that only allows
access from valid users. The only valid users will be me and thee.
-
Create a directory in 3990.server named etc
-
cd ~/3990.server/etc
-
Create the password file and an account for me. Give me the user name
downeyt. Choose a password for me. Include the password in the e-mail
that you send me:
/depot/http/bin/htpasswd -c passwd downeyt
after this you will enter a password for me, and then you will have to re-enter
it. Remember this password and include it in your e-mail to me. Notice that
the -c option creates the passwd file, deleting the file if it already exists,
so only use it once.
-
Add yourself to the passwd file. Select your own user name and password.
/depot/http/bin/htpasswd passwd your-user-name
Notice that the -c option is not included when you add users to a passwd
file that already exists. If you use -c the second time, you will delete
me from the file.
-
The path to your passwd file will be
/home/mongoose2/users/user-name/3990.server/etc/passwd, you will need
this in your access.conf file. Replace user-name with your mongoose
user name.
-
For the directory, the AuthName should be cgs3990, the AuthType should be
Basic and the AuthFile should be the path to your passwd file.
-
Add a mime type to your sever.
-
Edit the mime.types file in your conf directory and add a type
for text/x-your-name. Replace your-name with your name!
-
Make the extension your name.
-
Create an icon for your new mime type and place it in your icons directory.
Suggestion:
-
Copy an icon that you would like to modify from the /depot/http/icons
directory
cp /depot/http/icons/file.gif .
where file.gif is the icon that you would like to modify.
-
Convert an existing icon to a .bmp file using the convert program
on mongoose.
convert file.gif file.bmp
-
Download the .bmp file and edit it to you hearts content in PaintBrush
or Paint.
-
Upload the modified icon to your icons directory and use convert to
change it to a .gif file
convert file.bmp file.gif
-
You created an icons directory in the 3990.server directory. Create an alias
to your icons directory named /myicons/
-
Change the icon for your new mime type to your new icon using the new alias.
-
Add a virtual host to your server. Use the next sequential port to the one
you were assigned (or the previous one). If the virtual host directive isn't
working properly on mongoose, try using the statement <VirtualHost
*:port>, where port is your new virtual host port number.
Ignore the error message you get when you restart the server. Be sure to
Listen to your old port as well as your new port.
-
Create a directory 3990.virtual that will be the document root for
the virtual host.
-
Make the DirectoryIndex 3990.default.html
-
Make the UserDir 3990.www (this is the same as the original server)
-
Make the HeaderName HEADERvirtual for the virtual host
-
Add two pages to the 3990.www directory
-
3990.index.html - a personal page in your original server
-
3990.default.html - a personal page for the virtual host
-
If you view this directory in one server, you will get one page, if you view
it in the other server, you will see a different page.
-
Create a subdirectory of 3990.www named mime
-
Add a file to this directory that has the extension for your new mime type.
-
Change the icon for your new mime type on just the virtual host. Choose an
icon from the /depot/http/icons directory, or create another new one. If
you view this directory in your old server, you will see the new icon you
created for your mime type. If you view it in the virtual host, you will
see the icon that you selected here.
-
Add some other files to the 3990.www/mime directory. For instance .txt, .gif,
.jpg. Change the icons for all of these so that they are different when viewed
from the original server and the virtual server. Select icons from the
/depot/http/icons directory.
-
Create a file HEADERvirtual.html that will change the background color, text
color and link color. Include some text that explains the contents of this
directory. When viewed from the virtual host, you will see the index with
the HTML formatting, when viewd from the original server, you will see the
default layout for the index. You could also change the ReadMeName to
READMEvirtual in the configuration file, and then start some HTML in
HEADERvirtual.html and close the tags in READMEvirtual.html. This allows
you to do fun things, like include the listing in a table, or change the
font size.
-
I have completed this for my ~tdowne01 account on mongoose. You may try looking
at this account through your server to see if your server is doing everyhting
properly. You can compare with how it looks on my server. It doesn't have
to be exact, becasue I have also added some extra fun stuff.
-
Add language encoding to your original server
-
Enable language negotiation on your original server, disable it on your virtual
host.
-
Create versions of a file named language.html file for English,
Spanish and German in the document roots of both servers. They don't have
to be in these languages, they should just mention the name of the language
they are supposed to be in. So make a header that identifies the language:
<h1>English</h1> or <h1>Spanish</h1> or
<h1>German</h1>. Also include an indication of which document
root the file is in: virtual or original.
-
Add the meta tag in the head section of each page
<META http-equiv="pragma" content="no-cache">
-
Add a priority in your server in case the browser doesn't specify a preference.
-
The original server should show you the correct page, depending on the language
specified. The virtual host should give you a 404 error.
-
Create your own error messages
-
Create a 404 html page for your original server that will be displayed for
type 404 errors.
-
Create a 404 html page for your virtual host that will be displayed for type
404 errors.
-
Create a 500 html page for your original server that will be displayed for
type 500 errors.
-
Create a 500 html page for your virtual host that will be displayed for type
500 errors.
-
There is a file called create500error.cgi in the ~tdowne01/mime
directory that will create a 500 error. To generate a 404 error, just request
a document that doesn't exist.