BCS Install Tomcat 9 Mint

The web application for Java and Grails is the Apache Tomcat Server 9.

Step 1. Verify Java


Step 2. Get the server.

cd /opt
sudo wget http://www.us.apache.org/dist/tomcat/tomcat-9/v9.0.0.M22/bin/apache-tomcat-9.0.0.M22.tar.gz

Below observe the result of the wget command.

Next we must unzip Tomcat 9 and move the extracted sub directory to its permanent location.

Issue the following commands to facilitate installation.

sudo tar xzf apache-tomcat-9.0.0.M22.tar.gz
sudo mv apache-tomcat-9.0.0.M22 tomcat9

Below you can observe each command execution followed by the dir command to reveal the contents of the directory.

At this point we are ready to start the server by issuing the following two commands.

cd /opt/tomcat9/bin

The screen below illustrates the tomcat startup script.

Now issue the following command at the browser http://localhost:8080 and the following screen will appear.

The next step provides credentials for Tomcat Managers.

<user username="tomcat" password="secretPassword" roles="admin-gui,manager-gui"/>

Make sure you have this entry in the tomcat-users.xml file.

By default if Tomcat (version 9) is loaded on a server you use a client to access the interface but additional configuration is required.

Two files must be modified to relax the default restriction.  Both files are named context.xml.

The first location is /opt/tomcat9/webapps/host-manager/META-INF.  The second location is /opt/tomcat9/webapps/manager/META-INF.

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1"/>

This value should be commented out as indicated below.

<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1"/> -->

You should be able to access all components of Tomcat (version 9) at this point without restrictions.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

Leave a Reply