Friday, September 6, 2013

Jetty Web Server on CentOS 6



Download Jetty 7 from the website http://www.eclipse.org/jetty/. I have decided to install Jetty located at /srv rather than /opt but you can install it anywhere you like. I ran the following commands to help with the installation.

#cd /srv


wget http://download.eclipse.org/jetty/7.4.5.v20110725/dist/jetty-distribution-7.4.5.v20110725.tar.gz


#tar zxf jetty-distribution-7.4.5.v20110725.tar.gz


#ln -s jetty-distribution-7.4.5.v20110725 jetty


The last command just creates a link from the directory jetty to the directory created when you extracted the tar archive. Next I shall show you how to create a user to run Jetty with. You can also make it run on startup automatically so that when you reboot you do not need to start it.


#adduser -r -m jetty

#chown -R jetty:jetty /srv/jetty

#cd /etc/init.d

#ln -s /srv/jetty/bin/jetty.sh jetty

#chkconfig --add jetty

#chkconfig --level 345 jetty on


You will need to add some values so that Jetty can find your default java install and to set the port which you wish to add jetty to. You can add these values to either jetty.sh or /etc/default/jetty which is the preferred way of configuring applications on Linux.


You should now be able to start Jetty freely with the following command.


#service jetty start

No comments:

Post a Comment