The installation environment of this tutorial is
1、 Ubuntu18.04 Server system
2、 JDK1.8
It is mentioned here that in Ubuntu, it can be installed with sudo apt-get install jetty9. This installation package is linked to openjdk10. If there is no specific requirement, you can install and use it quickly.
The following are the installation steps:
1、 Create an installation directory
sudo mkdir /usr/jetty
sudo chown ceshi:ceshi /usr/jetty/
2、 Download jetty compressed package
wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.11.v20180605/jetty-distribution-9.4.11.v20180605.tar.gz
3、 Change directory name
mv jetty-distribution-9.4.11.v20180605 jetty-9.4.11
4、 Create service startup items
cp jetty-9.4.11/bin/jetty.sh /etc/init.d/jetty
5、 Configure basic jetty parameters
JAVA_HOME=/usr/java/jdk1.8.0_161
JETTY_HOME=/usr/jetty/jetty9
NO_START=0
JETTY_ARGS=jetty.port=8080
JETTY_HOST=0.0.0.0
6、 Start the test
sudo service jetty start
Start without exception, it means the configuration is successful, if there is a problem, execute sudo service jetty status
Another way to start is: java -jar ./start.jar
Recommended Posts