Typically, in a larger network framework, jetty is often used for communication between devices, while other Web servers typically deliver file:D to "humans." Jetty is a free open source project for the Eclipse Foundation. This Web server is used for Apache ActiveMQ, Alfresco, Apache Geronimo, Apache Maven, Apache Spark, Google App Engine, Eclipse, FUSE, Twitte R's streaming API and Zimbra.
This article describes ' How to install a jetty server in a CentOS server '.
First we need to install the JDK with the following command:
The code is as follows |
Copy Code |
Yum-y Install JAVA-1.7.0-OPENJDK wget |
After the JDK is installed, we can download the latest version of jetty:
The code is as follows |
Copy Code |
wget http://download.eclipse.org/jetty/stable-9/dist/jetty-distribution-9.2.5.v20141112.tar.gz |
Extract and move downloaded packages to/OPT:
The code is as follows |
Copy Code |
Tar zxvf jetty-distribution-9.2.5.v20141112.tar.gz-c/opt/ |
Rename the folder named Jetty:
The code is as follows |
Copy Code |
mv/opt/jetty-distribution-9.2.5.v20141112//opt/jetty |
Create a jetty User:
The code is as follows |
Copy Code |
Useradd-m Jetty |
Change the owning user of the Jetty folder:
The code is as follows |
Copy Code |
Chown-r jetty:jetty/opt/jetty/ |
Create a soft link for jetty.sh to/ETC/INIT.D directory to create a startup script file:
The code is as follows |
Copy Code |
Ln-s/opt/jetty/bin/jetty.sh/etc/init.d/jetty |
To add a script:
The code is as follows |
Copy Code |
Chkconfig--add Jetty |
Jetty is started when the system starts:
The code is as follows |
Copy Code |
Chkconfig--level 345 Jetty on |
Use your favorite text editor to open the/etc/default/jetty and modify the port and listener address:
The code is as follows |
Copy Code |
Vi/etc/default/jetty
Jetty_home=/opt/jetty Jetty_user=jetty jetty_port=8080 jetty_host=50.116.24.78 jetty_logs=/opt/jetty/logs/ |
* We have completed the installation, now we can start the jetty service *
The code is as follows |
Copy Code |
Service Jetty Start |
It's done!
Now you can access the http://< your IP address >:8080