Running your own Java servlets
You can run WWW services implemented as Java servlets on db.cs.helsinki.fi, the interactive Linux server dedicated to running database and WWW server software.
The servlet software implementation is currently based on the Tomcat JSP engine.
Setting up the servlet environment
You can setup and use the servlet environment with the following commands on db.cs.helsinki.fi:
- wanna-tomcat
The command installs a new tomcat environment into your local home directory on db.cs.helsinki.fi, ~/tomcat. - start-tomcat
The command starts up the servlet engine process in the background. - stop-tomcat
The command terminates the backgrounded servlet engine process. - setup tomcat
The command sets up your environment variables required for the compilation of servlets (CLASSPATH).
As usual, you should not leave your servlet environment process running when you do not need it. By default, the servlet environment is automatically terminated 10 hours after it was started. Please check out the CS Department' s policy about users' own servers (in Finnish).
The Tomcat file hierarchy
- ~/tomcat/README.txt
Useful information concerning your specific Tomcat setup. - ~/tomcat/conf/
Configuration files directory - ~/tomcat/logs/
Your servlet log files are in this directory. This is useful for debugging. - ~/tomcat/webapps/
Put your servlets here, see examples - ~/tomcat/conf/server.xml
Edit the last few lines of this file, if you wish to access your servlets from outside the CS Department's network (via URLs like http://db.cs.helsinki.fi/tomcat/flastnam/application instead of http://db.cs.helsinki.fi:98765/application).
Compiling servlet software
When compiling Java servlets, be sure to first
issue the command "setup tomcat
". This adds the necessary Java classes to your CLASSPATH
environment variable.
Also run "setup oracle
" or "setup postgres
"
(always before start-tomcat
!), if your servlets need
client drivers for either database.
Back to the instructions page
itsupport@cs.helsinki.fi