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.
-
Please use the following command to compress your cgs4825 folder.
Change to your root directory on ocelot and issue the command
zip -r username cgs4825 -x \*.jar \*.zip \*.war
Replacing username with your user name.
-
If you have any other archived files in your directory, like .rar, or .ZIP,
or .WAR, please remove them before zipping.
-
Check the size of the ZIP file, it should be less than 1 MB. If it is not,
then you probably have another ZIP file stored in the ZIP archive. Delete
it and re-zip.
-
Use my uploading program from ocelot to upload the file.
~downeyt/cs/public/webftp/webftp.pl
-
Upload the file as binary.
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.
-
Request the port number for your Apache server.
-
Set up your Apache server on ocelot.
-
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.
-
Validate the
cgs4825.html
page.
-
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
.
-
Create a directory named
errors
in your docRoot
directory.
-
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.
-
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.
-
Test that your error pages work by creating two hypertext links in the
cgs4825.html
page
-
Create a hypertext link to a file that does not exist.
-
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.
-
Access your Apache server using the port that you requested:
http://ocelot.aul.fiu.edu:99999/
Configure the Tomcat server
-
Create and validate your webapps folder on ocelot and request your student
host.
-
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.
-
Validate the
cgs4825.jsp
page.
-
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
.
-
Create a subdirectory named
errors
in the document root of the
Tomcat server.
-
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.
-
Test that your error page works by creating two hypertext links in the
cgs4825.jsp
page
-
Create a hypertext link to a file that does not exist.
-
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.
-
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.
-
Add a hypertext link from
cgs4825.html
to the Tomcat server
root directory.
-
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
-
Create a cgs4825.jsp file in the root of the username web
application.
username Application
-
In the cgs4825.jsp file in the document root of your host, create
a hypertext link to the root of this web application.
-
In the new web application, create a subdirectory named hw1.
-
In the cgs4825.jsp file in the root of this web application, create
a hypertext link to the hw1 directory.
-
Create a subdirectory of hw1 named simple.
-
Simple Application.
-
There will be four JSPs in the simple directory.
-
Three of them behave like the Edit, Confirm and Process pages that were covered
in class.
-
The Edit page should have three text boxes and a submit button. Initialize
the text boxes with the corresponding values from the query string.
-
The Confirm page should display the data from the Edit page as plain text.
It can also send the data to the Edit page, Process page, or Save page.
-
The Process page should display the data from the Confirm page as plain text.
-
Choose a common theme for these text boxes. Do not use name, address, city,
state, zip. One of the fields should be a field that can be used for
identification.
-
The fourth page is named Save, and can also be called from the Confirm page.
This means that the Confirm page will have three buttons: Edit, Save, and
Process.
-
The Save page will display the data from the Confirm page as plain text.
-
The save page can send the data back to the Edit page, or on to the Process
page.
-
Do not use a controller in the simple application. Each page must know the
location of the pages where it will send its data.
-
In the cgs4825.jsp file in the root of the username web
application, add the following links.
-
A hypertext link to the Edit page in the simple directory.