Apache Tomcat Install
Prerequisites
Ensure Java is installed. Tomcat 8.5 needs Java 7 or later. Tomcat 9 needs Java 8 or later
Assumes /tomcat exists (recommended as a distinct mount point/partition). Alternatively you may choose to use /opt/tomcat (default location for package manager controlled installs).
It is not recommended to access the default Apache Tomcat management screens via Internet Explorer. You will see several formatting issues including missing graphics etc.
Download Tomcat
Download latest appropriate version and copy it to /tomcat on your target server.
The Core tar.gz file is recommendedCreate Tomcat User
Linux Users & Groups
As 'root'...
useradd --system --create-home --user-group --home-dir /opt/tomcat --shell /bin/false --comment "Apache Tomcat" tomcat
cat /etc/passwd | grep tomcat
cat /etc/group | grep tomcat
Install Tomcat
As 'root'...
tar xvf apache-tomcat-9*.tar.gz -C /tomcat
ln -s /tomcat/apache-tomcat-9.0.54 /tomcat/latest
rm /tomcat/apache-tomcat-9.0.54.tar.gz
Set Permissions
chown -R tomcat:tomcat apache-tomcat-9.0.54
chown -R tomcat:tomcat latest
chmod o+x /tomcat/latest/bin/
Set Environment
export JAVA_HOME=/bin
export CATALINA_HOME=/tomcat/latest
export CATALINA_BASE=$CATALINA_HOME
Add these variables to the end of /tomcat/.bash_profilechown -R tomcat:tomcat /tomcat/.bash_profile
Configure systemd
This is optional, but recommendedAs 'root'...
vi /etc/systemd/system/tomcat.service
systemctl daemon-reload
Enable Tomcat after Boot
systemctl enable tomcat
Start Tomcat
systemctl start tomcat
Check Status
systemctl status tomcat
When Tomcat is running, the following URL should be available...
http://localhost:8080/