CGS4825 Assignment 1

Due 7/11 at 11:59 pm.

To hand in the assignment, zip your webapps directory and upload it via the web: Submitting homework on-line via the Web.

Be sure that all your files and subdirectories are included in the zip file.
Do not modify your files on ocelot until after your assignment has been graded.

Configure the Apache web server.

  1. Request the port number for your Apache server.
  2. Set up your Apache server on ocelot.
  3. Create a file named cgs4825.html in the document root of your Apache server. Add all the codes for a basic web page, including the DOCTYPE and meta tags.
  4. Validate the cgs4825.html page.
  5. When a directory is requested from the web server, the server will look for a default page to display from the directory. Typically, this page is named index.html. Configure your Apache server so that the default page is named cgs4825.html.
  6. Create a directory named errors in your docRoot directory.
  7. When a page that does not exist is requested from the Apache server, a reponse code of 404 is returned to the browser along with a default page that describes the error. Configure the Apache server so that your own custom error page is returned for a 404 error. Place your custom page in the errors directory.
  8. When a restricted page is requested from the Apache server, a reponse code of 403 is returned to the browser along with a default page that describes the error. Configure the Apache server so that your own custom error page is returned for a 403 error. Place your custom page in the errors directory.
  9. Test that your error pages work by creating two hypertext links in the cgs4825.html page
    1. Create a hypertext link to a file that does not exist.
    2. Create a hypertext link to a file that the server cannot read. You may create a new file in the docment root and change its permissions appropriately.
  10. Access your Apache server using the port that you requested:
    http://ocelot.aul.fiu.edu:99999/

Configure the Tomcat server

  1. Create and validate your webapps folder on ocelot and request your student host.
  2. Create a file named cgs4825.jsp in the document root of your Tomcat server. Add all the codes for a basic web page, including the DOCTYPE and meta tags.
  3. Validate the cgs4825.jsp page.
  4. When a directory is requested from the web server, the server will look for a default page to display from the directory. Typically, this page is named index.html. Configure your Tomcat server so that the default page is named cgs4825.jsp.
  5. Create a subdirectory named errors in the document root of the Tomcat server.
  6. When a restricted page or a page that does not exist is requested from the Tomcat server, a reponse code of 404 is returned to the browser along with a default page that describes the error. Configure the Tomcat server so that your own custom error page is returned for a 404 error. Place your custom page in the errors directory.
  7. Test that your error page works by creating two hypertext links in the cgs4825.jsp page
    1. Create a hypertext link to a file that does not exist.
    2. Create a hypertext link to a file that the server cannot read. You may create a new file in the docment root and change its permissions appropriately.
  8. Access the Tomcat server by using the student host that I send you:
    http://student99.cgs4825.cs.fiu.edu:8080/

Add links to each page to the other server.

  1. Add a hypertext link from cgs4825.html to the Tomcat server root directory.
  2. Add a hypertext link from cgs4825.jsp to the Apache server root directory.

Create a New Web Application

Your are to create a new web application on ocelot. The name of the web app should be your user name. Use the secure web.xml file for this application.

After creating the new web application, open the manager application for your host. In the Deploy section, enter the name of the web application in the WAR or Directory URL: text box and click the Deploy button. If all went well, then you will see that your new web appication is running. If it is not running, then check that you have no errors in your web.xml file.

Edit the file named .cshrc in your ~ directory. Add the following commands to the end of the file

#
#Define the location of Java
#
setenv JAVA_HOME /depot/J2SE-1.5
#
#Define the location of Tomcat
#
setenv TOM_HOME /home/ocelot/aul-user-web/jakarta-tomcat-5.0.19
#
#Add directories and jars to the CLASSPATH
#
setenv CLASSPATH {$HOME}/cgs4825/webapps/ROOT/WEB-INF/classes
setenv CLASSPATH {$CLASSPATH}:{$TOM_HOME}/common/lib/servlet-api.jar
setenv CLASSPATH {$CLASSPATH}:{$HOME}/cgs4825/webapps/your-user-name/WEB-INF/classes
umask 072

Replace your-user-name with your user name. These commands will allow you to compile java servlets on ocelot.

Configure the Tomcat Server

username Application