Skip to main content Skip to complementary content

Download Tomcat and configure Tomcat-Maven integration

Procedure

  1. Download from http://tomcat.apache.org/download-70.cgi or http://tomcat.apache.org/download-60.cgi the latest release version of Tomcat and extract the zip or tar.gz file into a new directory.
  2. Add an environment variable $CATALINA_HOME that points to the expanded Tomcat application directory, e.g. for Linux (in your ~/.bashrc file): export CATALINA_HOME=/usr/myapps/tomcat-<version>
  3. In the CATALINA_HOME/conf/tomcat-users.xml file, create a user with appropriate manager permissions. Create a new user with the manager-script role, or give the default tomcat user the manager-script role.
    This role allows you to deploy web applications using scripting tools such as the Tomcat Maven plugin used in this tutorial. Although not necessary for Tomcat deployment, the manager-gui role gives the ability to access the browser-based Tomcat Manager HTML application, helpful for a quick authentication check. Depending on your security needs, you may or may not want to do this in production.

    Example

    <tomcat-users>
       ...other entries...
       <role rolename="manager-script"/>
       <role rolename="manager-gui"/>
       <user username="tomcat" password="????" 
          roles="tomcat,manager-script,manager-gui"/>
    </tomcat-users>
    

    Change the ???? in the user password value of the tomcat-users configuration to another appropriate password and save.

    Information noteWarning: For production, it is best practice to grant manager roles to another username besides the easy-to-guess default tomcat user.
  4. Start Tomcat from a console window: {prompt}% $CATALINA_HOME/bin/startup.sh
  5. If you granted the user the manager-gui role, confirm that you can log into the manager webapp at http://localhost:8080/manager/html using the username and password of the manager account.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!