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

4.5. Running Enterprise Web Server


After the installation is complete, you can run the required Enterprise Web Server components.

4.5.1. Running Tomcat

Tomcat can be run either in the foreground as a program or in the background as a service.

Important

We strongly recomend to run tomcat as a service (refer to Section 4.5.1.2, “Running Tomcat as a Service”). Note that this is the only supported running method.

4.5.1.1. Running Tomcat as a Program

If you want to run Tomcat as a program, use either the tomcat[6,7] script in the sbin directory or the catalina script in the lib directory:
  • To start Tomcat with the tomcat script, run the following command as the root user with the respective Tomcat version (6 or 7):
    /opt/jboss-ews-2.0/sbin/tomcat<VERSION> start
    Copy to Clipboard Toggle word wrap
    The system reads the configuration file and changes to the user and group of the tomcat user account (that is, Tomcat is always run under the tomcat user). By default, tomcat-native is automatically added to the LD_LIBRARY_PATH and -Djava.library.path during Tomcat startup.
  • To start Tomcat with the catalina.sh script, run the following command with the respective Tomcat version (6 or 7) :
    /opt/jboss-ews-2.0/share/tomcat<VERSION>/bin/catalina.sh
    
    Copy to Clipboard Toggle word wrap
    The catalina.sh script detects the running JVM version and adds the /opt/jboss-ews-2.0/lib/ path (/opt/jboss-ews-2.0/lib64 for 64 bit JVM) to the library path.

4.5.1.2. Running Tomcat as a Service

To run Tomcat as a service with jsvc:
  • In Tomcat 6, use the script located in the init.d file or create and use a customized system daemon script with jsvc.
  • In Tomcat 7, use the script daemon.sh located in /opt/jboss-ews-2.0/share/apache-tomcat-7.x/bin/.
To run Tomcat as a service, use scm as follows:

Procedure 4.9. Use SCM to Run Tomcat as a Service

  1. At the shell prompt, become the root user.
  2. Create a new file named tomcat.xml at the location /var/svc/manifest/application/web/.
  3. Copy and paste the following contents into the newly created tomcat.xml file.
    <?xml version='1.0'?>
    <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
    <!--  Service manifest for Apache Tomcat -->
    <service_bundle type='manifest' name='tomcat6:tomcat6'>
        <service name='network/tomcat6'
                 type='service'
                 version='1'>
             <create_default_instance enabled='false' />
             <single_instance />
             <dependency name='fs'
                         grouping='require_all'
                         restart_on='none'
                         type='service'>
                  <service_fmri value='svc:/system/filesystem/local' />
             </dependency>
             <dependency name='net'
                         grouping='require_all'
                         restart_on='none'
                         type='service'>
                  <service_fmri value='svc:/network/loopback' />
               </dependency>
               <exec_method type='method'
                            name='start'
                            exec='/opt/jboss-ews-2.0/sbin/tomcat6 start'
                            timeout_seconds='-1'>
               </exec_method>
               <exec_method type='method'
                            name='stop'
                            exec='/opt/jboss-ews-2.0/sbin/tomcat6 stop'
                            timeout_seconds='-1'>
               </exec_method>
               <exec_method type='method'
                            name='restart'
                            exec='/opt/jboss-ews-2.0/sbin/tomcat6 restart'
                            timeout_seconds='-1'>
               </exec_method>
        </service>
    </service_bundle>
    Copy to Clipboard Toggle word wrap
  4. Run the following command to import the new file:
    # /usr/sbin/svccfg import /var/svc/manifest/application/web/tomcat.xml
    Copy to Clipboard Toggle word wrap
  5. Use the following command to start tomcat:
    # /usr/sbin/svcadm enable tomcat6
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat