First, please make sure you've already installed JDK on your Centos box. There are tons of tutorials on how to do that :).
Now we will download and install Jetty, at the time of this writing, the latest version of Jetty is 7.4.5.v20110725. Every command listing below must be run as user root.
:7070/
Hope this help!
cd /opt wget http://download.eclipse.org/jetty/stable-7/dist/jetty-distribution-7.4.5.v20110725.tar.gz tar xzvf jetty-distribution-7.4.5.v20110725.tar.gz ln -s jetty-distribution-7.4.5.v20110725 jettyOK, we've just installed Jetty to /opt/jetty. Now we will setup Jetty to run on startup
cd /etc/init.d ln -s /opt/jetty/bin/jetty.sh jetty chkconfig --add jetty chkconfig --level 345 jetty onIt's a good practice to run Jetty as a non-root user, let's create a normal user called jetty
useradd -m jetty chown -R jetty:jetty /opt/jettyNow edit the startup script of Jetty located at /opt/jetty/bin/jetty.sh to include the following lines at the beginning (right after a bulk of commented lines describing various variables for Jetty)
JAVA_HOME=/opt/java JAVA=$JAVA_HOME/bin/java JAVA_OPTIONS=" -server -Xms256m -Xmx1024m -XX:+DisableExplicitGC " JETTY_HOME=/opt/jetty JETTY_USER=jetty JETTY_PORT=7070 JETTY_HOST=0.0.0.0 # If you don't set this to 0.0.0.0, jetty only listen on localhost JETTY_LOGS=/opt/jetty/logs/Now start up it:
service jetty startOpen your browser and navigate to http://
1 comments:
After all these changes , jetty still starts on default port 8080! How to change port to 7070?
Post a Comment