此内容没有您所选择的语言版本。

2.5.4. Running Tomcat


The following procedure outlines the steps to run Tomcat.

Procedure 2.14. Running Tomcat on Red Hat Enterprise Linux

  1. After extracting the zip file, check to see if a user called tomcat exists on the system by running the following command:
    id tomcat
    Copy to Clipboard Toggle word wrap
  2. 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
    Copy to Clipboard Toggle word wrap
  3. If the tomcat user will be running Tomcat, change the ownership of the tomcat directories.
    1. Use the following command for Tomcat 6:
      chown -R tomcat:tomcat tomcat6
      Copy to Clipboard Toggle word wrap
      • Use the following command for Tomcat 7:
        chown -R tomcat:tomcat tomcat7
        Copy to Clipboard Toggle word wrap
  4. Test that the tomcat user has execution permission to the tomcat install path.
  5. Set the JAVA_HOME variable. Use one of the following approaches to set this variable.
    1. Provide the value for JAVA_HOME externally by setting the value prior to starting Tomcat.
      • Set the value for JAVA_HOME in the setenv.sh file. In Tomcat 6, this file is available at tomcat6/bin/ and in Tomcat 7, this file is available at tomcat7/bin/. This value is loaded from catalina.sh and overrides all other set values for JAVA_HOME.
Start Tomcat

To start Tomcat, execute the following script as the user tomcat:

sh startup.sh
Copy to Clipboard Toggle word wrap
Once the Tomcat service has been started, you can verify that it is running by pointing your web browser to http://localhost:8080.
Stop Tomcat

To stop Tomcat, execute the following script as the user tomcat:

sh shutdown.sh
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat