2.4.3. Running Tomcat
Procedure 2.14. Running Tomcat on Red Hat Enterprise Linux
- After extracting the zip file, check to see if a user called
tomcatexists on the system by running the following command:id tomcat
- If the user does not exist, use the following command to add it:
groupadd -g 91 -r tomcat useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r tomcat
- If the
tomcatuser will be running Tomcat, change the ownership of the tomcat directories.- Use the following command for Tomcat 6:
chown -R tomcat:tomcat tomcat6
- Use the following command for Tomcat 7:
chown -R tomcat:tomcat tomcat7
- Test that the
tomcatuser has execution permission to the tomcat install path. - Set the
JAVA_HOMEvariable. Use one of the following approaches to set this variable.- Provide the value for
JAVA_HOMEexternally by setting the value prior to starting Tomcat.- Set the value for
JAVA_HOMEin thesetenv.shfile. In Tomcat 6, this file is available attomcat6/bin/and in Tomcat 7, this file is available attomcat7/bin/. This value is loaded fromcatalina.shand overrides all other set values forJAVA_HOME.
To start Tomcat, execute the following script as the user tomcat:
sh startup.sh
To stop Tomcat, execute the following script as the user tomcat:
sh shutdown.sh

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.