All Linux HowTo's

Install and Test Tomcat7 on CentOS7 and RHEL7

Share This:

This is a quick HowTo for Tomcat7 on Redhat Enterprise Linux and CentOS 7. The shortest answer to how to install Tomcat7 is to download it, extract it and start it. It runs natively on port 8080 so adjust your firewall accordingly or change the port that Tomcat wants to use.

Download Tomcat7 from:

wget -O /tmp/tomcat7.tar.gz

The above location can change. In that case navigate to “” and then find the version you want.

Extract it:

tar -xzf /tmp/tomcat7.tar.gz -C /usr/local/
mv /usr/local/apache-tomcat-7.0.67 /usr/local/tomcat7

Set the password and permissions in the “/usr/local/tomcat7/conf/tomcat-users.xml” file. You can remove the contents of this file and replace is with the following. Change the password to something secret:

<role rolename="manager-gui" />
<user username="manager" password="MySecretPassword" roles="manager-gui" />
<role rolename="admin-gui" />
<user username="admin" password="MySecretPassword" roles="manager-gui,admin-gui" />

Now you can start it by running:


And stop it with:


Finally you can test it by browsing to “” and you will see the Tomcat7 welcome page. Use the menu buttons to access status and management functions. You’ll need the password to access these special locations.

Consider putting the start script in the “/etc/rc.local” file above any “exit” command to have Tomcat7 start on boot.

Leave a Reply

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