Installing Tomcat 9 behind Apache on CentOS 7

There are a number of posts on how to do this. I have created this post mostly for my own records so I know I will continue to have a record of what I have done.


Ensure you have at least JDK 8, I have the RPM “java-1.8.0-openjdk.x86_64” installed by this point.

Create a system user account to run tomcat:

useradd -r tomcat –shell /bin/false

Download the Tomcat 9 zip file, in my case this was “” which I downloaded to “/var/tmp” and then extract it and set permissions:

cd /var/tmp
unzip -d /opt
mv /opt/apache-tomcat-9.0.22 /opt/tomcat9
chown -R tomcat.tomcat /opt/tomcat9

Now create a service file:


For me this looked like:

Now set the correct permissions for the Tomcat startup script, enable the service and finally start the service:

cd /opt/tomcat9/bin
chmod 774 *.sh
systemctl enable tomcat.service
systemctl start tomcat.service

At this point Tomcat is running and you should be able to access it on port 8080 so:



Rose Hosting: Install Tomcat 9 on CentOS 7

Red Hat: Creating and Modifying systemd Unit Files