First we will install the JDK with the following command:
Yum-y Install JAVA-1.7.0-OPENJDK wget (Installation of Oracle JDK)
After the JDK is installed, we can download the latest version of jetty:
wget http://download.eclipse.org/jetty/stable-9/dist/jetty-distribution-9.2.5.v20141112.tar.gz
Unzip and move the downloaded package to/OPT:
Tar zxvf jetty-distribution-9.2.5.v20141112.tar.gz-c/opt/
Rename the folder named Jetty:
mv/opt/jetty-distribution-9.2.5.v20141112//opt/jetty is where, if you want to create multiple jetty services, you must differentiate between different jetty service names, such as Jetty_pushmv/opt /jetty-distribution-9.2.5.v20141112/opt/jetty_push (provided that the above must also be decompressed once)
Create a jetty User:
Useradd-m jettyuseradd-m Jetty_push (username and service with the same name for easy administration)
To change the user who owns the jetty folder:
Chown-r Jetty:jetty/opt/jetty/chown-r Jetty_push:jetty_push/opt/jetty_push
Create a soft link to jetty.sh to/ETC/INIT.D directory to create a startup script file:
Ln-s/opt/jetty/bin/jetty.sh/etc/init.d/jettyln-s/opt/jetty_push/bin/jetty.sh/etc.init.d/jetty_push
To add a script:
Chkconfig--add Jetty Add Jetty_push at the same time
Jetty is started when the system starts:
Chkconfig--level 345 Jetty on
Use your favorite text editor to open the/opt/jetty/start.ini and modify the port and listening address:
The default is 8080 ports, you can give different services, modify the different ports
* We have completed the installation and can now start the jetty service *
Service Jetty Start
It's done!
Now you can http://< your IP address in the port: access the
That's it.
Note that the jetty service is the default system memory, that is, if you want to hot deployment (non-stop state), the system memory consumption will become more and more high, must stop the service, so that the memory will be freed, then replace the project, and then restart the service
Install multiple different jetty containers under the same server