Red Hat Training

A Red Hat training course is available for Red Hat JBoss Web Server

5.5. Running Enterprise Web Server

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

5.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 5.5.1.2, “Running Tomcat as a Service”). Note that this is the only supported running method.

5.5.1.1. Running Tomcat as a Program

If you want to run Tomcat as a program, use either the tomcat[5,6] 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 (5 or 6):
    /opt/redhat/ews/sbin/tomcat<VERSION> start
    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 (5 or 6) :
    /opt/redhat/ews/share/tomcat<VERSION>/bin/catalina.sh
    
    The catalina.sh script detects the running JVM version and adds the /opt/redhat/ews/lib/ path (/opt/redhat/ews/lib64 for 64 bit JVM) to the library path.

5.5.1.2. Running Tomcat as a Service

To run Tomcat as a service you can use either the Tomcat script located in the init.d or you can create and use your own system daemon script with jsvc or tanukiwrapper.
To run Tomcat as a service, create symbolic links to the provided Tomcat scripts using the following command:
ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rc3.d/S70tomcat<VERSION>
ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rcS.d/K20tomcat<VERSION>
Define the init level numbers (for information on how define init level numbers consult your Solaris documentation). The preferred method of service management is through the Solaris Service Management Facility. In order to read more about this facility, consult the smf(5) manual.