[JAVA] Jetty v8 on CentOS7

Preface

A note on building Jetty on CentOS 7 without yum, which is famous for being lighter and faster than Tomcat I personally really like the restart of the service because it ends at an explosive speed. (Tomcat takes 5 minutes if you are not good at it)

Premise

Construction work

Preparation

Add jetty user (user name can be anything but easy to understand)

[root@localhost ]# useradd jetty
[root@localhost ]# passwd jetty

Java installation

Download the JDK rpm from the URL below http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Bring the dropped .rpm to the target server

[root@localhost ]# yum localinstall jdk-8u111-linux-x64.rpm
#root and jetty.bash_export to profile Java_HOME=/usr/Java/jdk1.8.0_111/jre/Added

Jetty installation

Dropped from jetty official and decompressed => Owner / Group change In the example below, it is placed in / opt, but you can use any path you like.

[root@localhost ]# wget http://central.maven.org/maven2/org/eclipse/jetty/jetty-distribution/8.1.21.v20160908/jetty-distribution-8.1.21.v20160908.tar.gz
[root@localhost ]# tar xzvf jetty-distribution-8.1.21.v20160908.tar.gz
[root@localhost ]# mv jetty-distribution-8.1.21.v20160908 /opt/jetty
[root@localhost ]# cd /opt
[root@localhost /opt]# chown -R jetty:jetty jetty

Service registration to systemd

You need to manually create / register this area, which yum will do automatically.

[root@localhost /opt]# vim /usr/lib/systemd/system/jetty.service
[Unit]
Description=Jetty Application Containar

[Service]
Type=simple
EnvironmentFile=-/opt/jetty/etc/jetty-env
PIDFile=/opt/jetty/jetty.pid
User=jetty
Group=jetty
ExecStart=/opt/jetty/bin/jetty.sh start
ExecReload=/opt/jetty/bin/jetty.sh restart
ExecStop=/optjetty/bin/jetty.sh stop

StandardOutput=null

[Install]
WantedBy=multi-user.target

[root@localhost /opt]# systemctl daemon-reload

Registering a new service for firewalld (optional)

If you do not use firewalld for verification purposes, skip it and OK

[root@localhost ]# vim /usr/lib/firewalld/services/jetty.xml

<service>
  <short>WWW (HTTP-jetty)</short>
  <description>HTTP is the protocol used to serve Web pages. If you plan to make your Web server publicly available, enable this option. This option is not required for viewing pages locally or developing Web pages.</description>
  <port protocol="tcp" port="8080"/>
</service>

[root@localhost ]# systemctl restart firewalld
[root@localhost ]# firewall-cmd --add-service=jetty --zone=public --permanent
success
[root@localhost ]# systemctl restart firewalld

Operation check

First, start Jetty. Also, make sure that the service starts automatically when the OS starts.

[root@localhost ]# systemctl enable jetty
[root@localhost ]# systemctl start jetty
[root@localhost ]# systemctl status jetty
[root@localhost ]# ss -nat | grep 8080
LISTEN     0      100                      :::8080                    :::*

Access http: // [ip_addr]: 8080 with a web browser, and when the top page of jetty is displayed, it's OK.

Recommended Posts

Jetty v8 on CentOS7
Tomcat v8 on CentOS7
Install OpenFOAM v2006 on CentOS
OpenVPN on CentOS 8
Maven on CentOS 7 tutorial
Docker installation on CentOS 6
Use perltidy on CentOS 8
Install Golang on CentOS 8
Try OpenLiteSpeed on CentOS8
Install Vertica 10.0 on CentOS 6.10
Zabbix 5 installation on CentOS 8
Use mod_auth_cas on CentOS 8
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install Python 3 on CentOS 7
Install kuromoji on CentOS7
Use bat on Centos.
OpenJDK installation on CentOS 7
Install Mattermost on CentOS 7
Install PostGIS 2.5.5 on CentOS7
Install jpndistrict on CentOS 7
Install CMS Made Simple v2.2.2 on LAMP on CentOS 7.3
Install Redmine 4.1.1 on CentOS 7
Smokeping Install on CentOS7
Install PostgreSQL 13 on CentOS 7.5
Try RabbitMQ + PHP on CentOS
Make exFat available on CentOS 7
Set up Gitolite on CentOS 7
Install Apache on CentOS on VirtualBox
Introducing Let's Encrypt on CentOS 7
Java version change on CentOS
Install Ruby 2.7 on CentOS 7 (SCL)
Perform log rotation on centos
How to deploy Laravel on CentOS 7
Enable Openjdk10 and maven on CentOS
Install Java Open JDK 8 on CentOS 7
Try putting CentOS 8 on Raspberry Pi 3
WordPress with Docker Compose on CentOS 8
Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7
How to install MariaDB 10.4 on CentOS 8
Install apache 2.4.46 from source on CentOS7
Steps to install MySQL 8 on CentOS 8
Use the iostat command on CentOS 8
I tried installing CentOS 8 on ESXi 6.7
Steps to install devtoolset-6 on CentOS 7
Use Docker CE (official) on CentOS 8
Install Java 9 on windows 10 and CentOS 7
I installed F-Revo CRM 7.3 on CentOS 7.7
Try DPDK20 SDK on CentOS7 (2) Control DPDK driver
Install samba4 from source code on CentOS8
Set up ImpressPages 5.0 with LAMP on CentOS 7.3
Countermeasures for FDclone build failure on CentOS 8
Customize OpenFOAM v8 Docker Image on Mac
Change JDK and Tomcat versions on CentOS
Install the webmail client Rainloop on CentOS 8
How to install beta php8.0 on CentOS8
Get Let's Encrypt Wildcard Certificate on CentOS6
Until you run CuPy (v11.1) on Ubuntu 20.04
Personal tips on working with CentOS servers
Set up Docker Registry locally on CentOS 7
Install CentOS 7 on Raspberry pi 4 Model B