Tomcat web server configuration

When you install the Apache Tomcat web server there are some configuration settings you need to make to be able to administer and use it.

Administrator user accounts

When you install the Apache Tomcat web server there is no admin user account specified, so nobody can log into the admin web user interface. To add an admin user account

  1. Remote into the web server
  2. Open the Tomcat user configuration file at
    1. On Linux at $TOMCAT_HOME/conf/tomcat-users.xml
    2. On Windows at C:\Program Files\apache-tomcat-…\conf\tomcat-users.xml
  3. Add an admin user
    <tomcat-users>
    <!--
      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="both" password="tomcat" roles="tomcat,role1"/>
      <user username="role1" password="tomcat" roles="role1"/>
    -->
    
    	<role rolename="manager-gui"/>
    	<user username="admin" password="admin" roles="manager-gui"/>
    
    </tomcat-users>
  4. Restart the Tomcat service for the change to take effect.

Firewall

With the default settings, Tomcat is accessible on port 8080. To be able to use the web applications served by Tomcat, open port 8080 on the local firewall.

Leave a comment

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