Friday, February 11, 2022

How To Install Jetty Web Server On Rocky Linux 8.5

 in This Tutorial you will Learn " How To Install Jetty Web Server On Rocky Linux 8.5"

Jetty is a Java HTTP web server and Java servlet container. Homepage -https://www.eclipse.org/jetty/
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      | IP -192.168.1.60        |Hostname - server.yourdomain.com
_________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install java-11-openjdk-devel -y
wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.45.v20220203/jetty-distribution-9.4.45.v20220203.zip
unzip jetty-distribution-9.4.45.v20220203.zip
mv jetty-distribution-9.4.45.v20220203 /opt/jetty

useradd -m jetty ; chown -R jetty:jetty /opt/jetty/ ; mkdir /var/run/jetty ; chown -R jetty:jetty /var/run/jetty
ln -s /opt/jetty/bin/jetty.sh /etc/init.d/jetty ; chkconfig --add jetty
mkdir /opt/jetty/my_base/ ; cd /opt/jetty/my_base/ ; java -jar /opt/jetty/start.jar --add-to-start=http,deploy
chown -R jetty:jetty /opt/jetty/my_base/
nano /etc/default/jetty
JETTY_HOME=/opt/jetty
JETTY_BASE=/opt/jetty/my_base
JETTY_USER=jetty
JETTY_PORT=8080
JETTY_HOST=192.168.1.60
service jetty start
firewall-cmd --permanent --add-port=8080/tcp ; firewall-cmd --reload
http://127.0.0.1:8080

Deploy Web Application-
cp /opt/jetty/demo-base/webapps/async-rest.war /opt/jetty/my_base/webapps/
http://127.0.0.1:8080/async-rest/
_________________________________________________________________________________________


No comments:

Post a Comment