Jetty requires Java (JDK). If you have not already, you can install it with the following command:
sudo apt-get install openjdk-7-jre
Check that it was installed correctly:
In this article, I will walk you through all the steps necessary to install and test Jetty Web Server.
First, you will need to download the latest version of Jetty:
cd /usr/local/src sudo wget http://mirrors.xmission.com/eclipse/jetty/stable-9/dist/jetty-distribution-9.0.0.RC1.tar.gz
If the link above gives you a 404, you'll need to swap it out with the most recent version from the Jetty distribution page on eclipse's website.
Unpack the tarball you just downloaded:
sudo tar xfz jetty-distribution-9.0.0.RC1.tar.gz
Move the directory you just created:
sudo mv jetty-distribution-9.0.0.RC1 /opt/jetty
Copy the Jetty shell script to your /etc/init.d directory:
sudo cp /opt/jetty/bin/jetty.sh /etc/init.d/jetty
Create Jetty User
You'll need a jetty user and user group. First check to see if there already is one:
Scroll through the list to see if there already is a jetty user.
If there isn't a jetty user yet, you'll have to create one:
sudo useradd jetty -M -U -s /bin/false
This will create the jetty user, group, and set its shell script as /bin/false to prevent anyone from logging in as the jetty user.
Make sure jetty is the owner of the /opt/jetty directory:
sudo chown -R jetty:jetty /opt/jetty
Create Jetty Configuration File
This will create an empty jetty configuration file:
sudo vim /etc/default/jetty
Add the following to this file:
At this stage, you can do a quick test to see if your Jetty install is complete or not. Run the following command to start your Jetty Web Server:
sudo /etc/init.d/jetty start
If all is well, you should see the standard Jetty splash page when you visit the following address in your browser:
If starting Jetty failed and/or you don't see the Jetty splash page, you will need to continue on with a few possible solutions.
Something besides Jetty could be listening to port 8080. Most likely it is another web server. To find out, use the following command to view what's going on with the computer's ports: