Creating Web Applications
All web applications have a similar structure.
-
The root directory of the web application.
-
A subdirectory named WEB-INF. It is important that this is upper case,
and that a hyphen is used, not an underscore.
-
A web.xml file in the WEB-INF directory. There are three possiblities
for the web.xml file
-
A simple web.xml. Use this
file if you are creating a web app on your local machine. Change
your-user-name to your ocelot user name.
-
A secure web.xml. Use this
file if you are creating a web app that is visible on the internet. Change
your-user-name to your ocelot user name.
-
A manager web.xml. Use this
file for the manager web application only. Change
your-user-name to your ocelot user name.
-
Two subdirectories of WEB-INF
-
classes - place all java class files and packages here.
-
lib - place java archives (jar) here. They will be available in the
web app without being expanded.
-
All files should have permissions of 604. All directories should have permissions
of 705.
Create a folder for all your web applications
-
On ocelot or weasel, change the permission of your ~ directory
to 701. This could also have a permission of 705, but 701 is a tiny bit more secure for your home directory.
-
Create a folder named cgs4854 and change its permission to 705
-
Create a subdirectory of cgs4854 and name it webapps. Change
its permissions to 705.
Create Two Web Apps
Create two web applications in the webapps folder. Create the complete folder and file structure that was described above.
-
ROOT - make sure this is upper case. Use the
secure web.xml file. Change
your-user-name to your ocelot user name. Follow the instructions in the
WinSCP Tutorial for creating the ROOT web app.
-
manager - use the manager
web.xml file. This web.xml file is only to be used for the manager
web application. Change your-user-name to your ocelot user name.
Test Your Webapp Folder
Test your webapp folder by running my script from
Test Webapps Folder
Notify Me
When this is compete, send me an e-mail message. I will set up your host
on Tomcat, and will let you know what your URL is to access your web application
folder. They will all be similar. For example, I have a web application folder
at student01.cgs4854.cs.fiu.edu on port 8008. You will be given a similar
URL. The only thing that will be different is the two-digit or three-digit student number
in the URL. You will use two URLs to access your folder:
-
http://studentXX.cgs4854.cs.fiu.edu:8008/
- this is the URL
for the ROOT web app.
-
http://studentXX.cgs4854.cs.fiu.edu:8008/manager/html
- this
is the URL to manage your web applications.
A few of you will have three-digit student numbers and will these URLs.
-
http://studentXXX.cgs4854.cs.fiu.edu:8008/
- this is the URL
for the ROOT web app.
-
http://studentXXX.cgs4854.cs.fiu.edu:8008/manager/html
- this
is the URL to manage your web applications.
After you notify me, I will tell you what your two-digit or three-digit student number is
for your URLs.