RimuHosting: Mighty Linux Servers.  Support Worth Raving About
Plans & Pricing
Server Recommendation Tool
Server Types
  VPS
  Semi-dedicated Server
  Dedicated Server
Server Locations
  Dallas
  London
  Australia
VPS Technology
Hardware
Data Centers
Linux Distributions
Applications
Maintenance Notices
Support Ticket
Control Panel
HOWTO Articles
Forums
VPS control panel
Billing details
Receipts
Contact details
DNS
Reverse DNS
Console-over-SSH
FTP backup space
Backup mail server
About
Staff
News
Customer Testimonials
Sales Inquiry
Link To Us
Terms and Conditions
Site Map

Order VPS Hosting
Order a VPS, Semi- dedicated or Dedicated server in Dallas, London or Australia.

Get Assistance
Ask our support team about your hosting requirements.


Host where the staff takes pride in making customers happy

I tried you guys out before when I worked on a project for a friend ([edited].com). The setup was great - just root access on a linux box - yay! Worked really well so I've decided to put my own stuff with you guys.

- Hamish (be warned: once you've worked on a RimuHosting server and with our RimuHosting staff you will not want to host anything anywhere else) (#74/269)
Home > Support > HOWTO List > JSP Hosting: Jetty

Jetty Servlet Engine

Jetty is very reliable, fast and uses minimal memory and CPU.  Jetty supports the (most recent) 2.3 Servlet specification and 1.2 JSP specification.  Plans are under way for it to support the JSP 2.0 specification when it arrives.  Jetty supports 'WAR' files, and speedily serves up JSP and static content.

In addition to the server software, we have pre-installed a number of common Java libraries.  They include Ant, Crimson, Xalan, Xerces, BCEL, and Jasper.

Jetty Installation

RimuHosting pre-installs the Jetty Servlet engine on its RedHat VPS plans.  For those that want to do it themselves, here is a rough guide...

The Jetty install, from the sourceforge.net files is via a tar.gz file.  The following steps will put the Jetty files in the 'appropriate' directories.  For example, put the logs in /var/log/jetty, and the config files in /etc/jetty.

cd /opt
# Select the file you want to use from here: 
# http://sourceforge.net/project/showfiles.php?group_id=7322
# VERSION will be used as a variable in the next few commands
VERSION=Jetty-4.2.10pre0
# wget "http://heanet.dl.sourceforge.net/sourceforge/jetty/$VERSION.tar.gz"
# extract the tar file
tar xzvf $VERSION.tar.gz
# create some links
ln -sf /opt/$VERSION /opt/jetty
# pop a link to the 'init' script in the standard RedHat location
ln -sf /opt/jetty/bin/jetty.sysvinit /etc/init.d/jetty
# make it so that /usr/local/jdk points to your current Java setup
ln -sf /usr/java/j2sdk1.4.1_02 /usr/local/jdk
cd /opt/jetty
# create a jetty user
adduser jetty
# edit bin/jetty.sysvinit to use a --user=jetty on the daemon calls
# (no point jetty running as root, eh?)
chown -R jetty.jetty *
#Add "export JAVA_HOME=/usr/local/jdk" to bin/jetty.sh
chmod +x bin/*.sh
chmod +x /etc/init.d/jetty
mkdir -p /var/log/jetty
# make it so that logs end up in /var/log/jetty
rm -rf logs
ln -s /var/log/jetty logs
# make it so the conf files are in /etc/jetty
mv etc /etc/jetty
ln -s /etc/jetty etc

Jetty Installation Part II

The following steps are not yet part of the standard install.  If you are going to run Jetty on your RimuHosting VPS, please follow them.

Create a logrotate file for Jetty so that you logs don't keep getting larger and larger:

echo "/var/log/jetty/*.log {
copytruncate
weekly
rotate 52
compress
missingok
}" > /etc/logrotate.d/jetty

Running Jetty on Startup

By default RimuHosting does not enable Jetty on server startup.  However, it is easy enough to do.

Turn on the service for bootup: chkconfig --add jetty && chkconfig --level 35 jetty on

And start the service: /etc/init.d/jetty start

You will probably want to disable Apache: chkconfig --del httpd

Check jetty is running:  http://yourserverip:8080

The logs are in /var/log/jetty.  The config files are in /etc/jetty.

To deploy a WAR file, pop it in /opt/jetty/webapp.

Jetty runs under the 'jetty' user. So if you edit any of the files in there, do so as jetty. Also, if you upload war files, make sure they are readable by the jetty user.

The technique for running Tomcat on port 80, works just as well for Jetty.