Install and Configure Apache Tomcat on Ubuntu 18.04 LTS
In this Tutorial, we will show you how to install and configure the Apache Tomcat 9.0.8 on Ubuntu 18.04 LTS (Bionic Beaver). We will also learn how to install Java on Ubuntu 18.04 LTS, configure a user for apache tomcat, and run the apache tomcat as a systemd service.
Service Scrpt:
[Unit]
Description=Apache Tomcat 9 Servlet Container
After=syslog.target network.target
[Service]
User=tomcat
Group=tomcat
Type=forking
Environment=CATALINA_PID=/opt/tomcat/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target