Gentoo Linux - Installing TomCat

Ask a question

The application server (Tomcat) is a component of the Jakarta project, which provides server solutions based on Java technologies, but keeping it as an Open Source application .


  • To install Tomcat on Gentoo use the command:
    • emerge tomcat 
  • Once the installation is finished starting, stopping and checking the status of the server will be via the commands:
    • # /etc/init.d/tomcat-6 start 
# /etc/init.d/tomcat-6 stop # /etc/init.d/tomcat-6 restart
  • To test the server, go to page http://ip_serveur:8080/
  • Note that Tomcat uses port 8080 by default and this, from version 6.
  • TomCat is installed by default at the following directories:
  • /usr/share/tomcat-6/
  • /var/lib/tomcat-6/

To add tomcat on boot, use the command:
# rc-update add tomcat-6 default

User Administration

To add or remove users, edit the file /etc/tomcat-6/tomcat-users.xml, below is an example:

<? xml version ='1 .0 'encoding =' utf-8 '?>
<?xml version='1.0' encoding='utf-8'?>
<role rolename="tomcat"/>
<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,manager"/>
<user username="admin" password="admin" roles="manager"/>

Server parameters

By editing the configuration file located under the directory /etc/conf.d/tomcat-6, it is possible to customize several options for implementing the server.

Gentoo Linux - Installing and configuring Java
Gentoo Linux - Installing Webmin