Install Tomcat 9 on CentOS 8

This post will cover installing Tomcat 9 on CentOS 8.

We’ll be using a bash script below, which is commented so you can see the steps.

We’ll install the latest stable release of Tomcat 9.x from Tomcat.org, as well as OpenJDK 8.

We’ll also update the tomcat-users.xml file to enable manager-gui and admin-gui roles and set their passwords to a random string.

Finally, we’ll create a service file and enable Tomcat to run as a systemd service.

 

As root, save the above script as tomcat9-centos8.sh and make it executable.

Run the script:

Upon completion, the GUI and Manager passwords will be displayed as below:

The random passwords will also be saved as auth.txt in the root directory.

You should now be able to access Tomcat at:

http://domain.com:8080 or http://IP:8080

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.