Install Tomcat on Fedora or CentOS

To install tomcat5 (or tomcat 6) on Fedora 14 or CentOS,

  1. Run yum install tomcat5 tomcat5-webapps tomcat5-admin-webapps (or to install tomcat6 run yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps )
  2. Your configuration files are in /etc/tomcat5. (or /etc/tomcat6)

  3. ed to edit server-minimal.xml to set the port that Tomcat listens on. You will need to edit the file tomcat-users.xml and add a user with the role 'manager' if you want to be able to use the Tomcat Manager application (see #6 below).
  4. You can start and stop Tomcat by running # /etc/init.d/tomcat5 start (or stop,restart, etc).
    • Note on Fedora 14 and later you should use the service command as in: # service tomcat6 restart
  5. Any Tomcat web application that you want to serve should be dropped into /var/lib/tomcat5/webapps/
    • Note that on Fedora 14 the directory is /usr/share/tomcat6/webapps/
  6. You can view your Tomcat website via http://localhost:8080/.
  7. In order to run the manager commands you need to: # vi /etc/tomcat5/tomcat-users.xml
  8. Add <role rolename="manager"/> as a new line and edit <user username="tomcat" password="tomcat" roles="tomcat,manager"/> to include manager.  Make sure these lines are not inside the comments <!--  ... -->
  9. Restart tomcat so changes take affect: # servcie tomcat6 restart
  10. Test a manager command: # http://localhost:8080/manager/list
  11. Try to reload the example appication: http://localhost:8080/manager/reload?path=/examples
  12. Show the server info: http://localhost:8080/manager/serverinfo
  13. Show the session info:http://localhost:8080/manager/sessions?path=/examples
  14. Start an application: http://localhost:8080/manager/start?path=/examples
  15. Stop an application: http://localhost:8080/manager/stop?path=/examples

See Also:

Howto: Install Apache Solr 1.4.1 on CentOS / Drupal 6


On this tutorial as well (Solr+1.4+on+Ubuntu+9.10+and+CentOS+5) it's telling me to install tomcat5 on CentOS. Why not 6?

In reply to by Anonymous (not verified)

I tried to mention that in the heading this should work with either version. You just need to replace the 5 with a 6 in the tomcat commands.