Archive

Archive for January, 2013

Eclipse Jetty 9.0 installation on Centos 6.3

January 21, 2013 Leave a comment

Jetty is a light weight and flexible Java server alternative to apache tomcat.

Now lets jump to installation on centos 6.3 :

Jetty 9.0 requires java 1.7

[root@javaserver opt]#yum install java-1.7.0-openjdk

I’ll be installing jetty in /opt folder

[root@javaserver opt]#cd /opt

Download jetty 9.0

[root@javaserver opt]# wget http://download.eclipse.org/jetty/stable-9/dist/jetty-distribution-9.0.0.M4.tar.gz

Link: http://download.eclipse.org/jetty/stable-9/dist/jetty-distribution-9.0.0.M4.tar.gz

Extract the tarball

[root@javaserver opt]#tar xzvf jetty-distribution-9.0.0.M4.tar.gz

rename the folder

[root@javaserver opt]# mv jetty-distribution-9.0.0.M4 jetty

add jetty user and copy the startup script

[root@javaserver opt]# useradd jetty
[root@javaserver opt]# chown -R jetty:jetty /opt/jetty
[root@javaserver opt]# cp jetty/bin/jetty.sh /etc/init.d/jetty

add to chkconfig so it can start at system boot

[root@javaserver opt]#chkconfig --add jetty
[root@javaserver opt]#chkconfig jetty on

Edit jetty startup script and add following lines at the beginning after comments:

[root@javaserver opt]# vim /etc/init.d/jetty

JETTY_HOME=/opt/jetty
JETTY_USER=jetty
JETTY_PORT=7070 
JETTY_LOGS=/opt/jetty/logs/

And we are done with the configuration so start the jetty and test it:

[root@javaserver opt]#service jetty start
[root@javaserver opt]#links http://localhost:7070

for additional start up options check /opt/jetty/start.ini

Advertisements