Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to install a Jetty server on a CentOS system

Shulou Source: shulou.com Published: 2022-06-01 08:08:39 09月29日 Update

This article mainly explains "how to install a Jetty server on a CentOS system". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to install a Jetty server on a CentOS system.

Jetty is a pure Java HTTP (Web) server and Java Servlet container. Usually in a larger network framework, Jetty is often used for communication between devices, while other Web servers usually pass files to "humans": D. Jetty is a free open source project of the Eclipse Foundation. This Web server is used in Streaming API and Zimbra such as Apache ActiveMQ, Alfresco, Apache Geronimo, Apache Maven, Apache Spark, Google App Engine, Eclipse, FUSE, and Twitter.

This article describes how to install a Jetty server in a CentOS server.

First, we will install JDK with the following command:

The code is as follows:

Yum-y install java-1.7.0-openjdk wget

After JDK is installed, we can download the latest version of Jetty:

The code is as follows:

Wget http://download.eclipse.org/jetty/stable-9/dist/jetty-distribution-9.2.5.v20141112.tar.gz

Extract and move the downloaded package to / opt:

The code is as follows:

Tar zxvf jetty-distribution-9.2.5.v20141112.tar.gz-C / opt/

Rename the folder to jetty:

The code is as follows:

Mv / opt/jetty-distribution-9.2.5.v20141112/ / opt/jetty

Create a jetty user:

The code is as follows:

Useradd-m jetty

Change the user of the jetty folder:

The code is as follows:

Chown-R jetty:jetty / opt/jetty/

Create a soft link to / etc/init.d directory for jetty.sh to create a startup script file:

The code is as follows:

Ln-s / opt/jetty/bin/jetty.sh / etc/init.d/jetty

Add a script:

The code is as follows:

Chkconfig-add jetty

It is jetty that starts when the system starts:

The code is as follows:

Chkconfig-level 345 jetty on

Use your favorite text editor to open / etc/default/jetty and modify the port and listening address:

The code is as follows:

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, and now we can start the jetty service *

The code is as follows:

Service jetty start

It's done!

Now you can visit it in http://:8080

Thank you for your reading, the above is the content of "how to install Jetty server on CentOS system". After the study of this article, I believe you have a deeper understanding of how to install Jetty server on CentOS system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Code services servers systems files learning content folders users articles scripts people commands addresses funds foundations containers that is ideas situations Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MySQL vpn Shulou Tech Info Huawei