Red Hat Training

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

Installation Guide

Red Hat JBoss Web Server 2.1

Install and Configure Red Hat JBoss Web Server 2.1.0

Misha Husnain Ali

Red Hat Engineering Content Services

Mandar Joshi

Red Hat Engineering Content Services

Gemma Sheldon

Red Hat Engineering Content Services

Abstract

This book contains information related to installation and basic configuration of Red Hat JBoss Web Server components.

Chapter 1. Introduction

1.1. Introduction

JBoss Enterprise Web Server is a fully integrated and certified set of components for hosting of Java web applications. It is comprised of the web server (Apache HTTP Server), the Apache Tomcat Servlet container, load balancers (mod_jk and mod_cluster), and the Tomcat Native library.
This Installation Guide documents relevant information regarding the installation, minor upgrade, and basic configuration of JBoss Enterprise Web Server on the supported operating systems.

1.2. Components

JBoss Enterprise Web Server consists of the following components:
  • Apache Tomcat is a servlet container in accordance with Java Servlet Specification. JBoss Enterprise Web Server contains Apache Tomcat 6 and Apache Tomcat 7.
  • Apache Native is a Tomcat library, which improves Tomcat scalability, performance, and integration with native server technologies. It also contains an implementation of APR (Apache Portable Runtime). APR is a binary protocol for communication of Apache HTTP Server and Apache Tomcat.
  • Apache Tomcat Connectors (mod_jk, mod_cluster) are connectors between Apache HTTP Server and Apache Tomcat. Note that mod_cluster is a JBoss native load balancer and is more efficient, reliable, and scalable than mod_jk.
  • Apache HTTP Server is an open-source web server developed by the Apache Software Foundation. The implementation follows the current HTTP standards.

    Note

    The delivered Apache HTTP Server by default provides the support for the Secure Socket Layer (SSL) protocol. To remove it, see the section on removing SSL for your installation.
  • Hibernate is an object-relational mapping framework. The delivered Hibernate contains Hibernate Core, Hibernate Annotations, Hibernate EntityManager with JPA 1.0 APIs.

1.3. Supported Operating Systems and Configurations

For comprehensive information about supported operating systems and configurations for JBoss Enterprise Web Server, see JBoss Enterprise Web Server Supported Configurations page.

1.4. Installation and Upgrade

For instructions on how to install JBoss Enterprise Web Server, see Part 1 Installation. Upgrading JBoss Enterprise Web Server is not supported. To upgrade to 2.1 from an older version, a fresh installation is recommended..

Warning

If the RPM method was used to install JBoss Enterprise Web Server 1.x, it is not possible to remove JBoss Enterprise Web Server 1.x and install JBoss Enterprise Web Server 2.1 on the same machine. On a machine where JBoss Enterprise Web Server 1.x was installed using the ZIP method, it is possible to remove version 1.x and install version 2.1 on the same machine.

1.5. Product Documentation Locations

JBoss Enterprise Web Server includes multiple types of documentation, as follows:
  • The JBoss Enterprise Web Server Product Documentation. This documentation is available at the Red Hat Customer Support Portal's JBoss Enterprise Web Server page.
  • The jboss-ews-docs-2.1.0.zip file contains documentation about the following:
    • httpd
    • mod_auth_kerb
    • mod_cluster
    • mod_jk
    • openssl
    • tomcat6
    • tomcat7
    • tomcat-native
    • mod_ssl documentation is also available at the location doc/httpd/mod/mod_ssl.html.

Part I. Installation

Chapter 2. Installing Enterprise Web Server on Red Hat Enterprise Linux

On Red Hat Enterprise Linux, you can install JBoss Enterprise Web Server in two ways:
  • ZIP files.
  • RPM files.

2.1. ZIP Installation Files

From ZIP files available on the Red Hat Customer Portal (see Section 2.4, “Installing Enterprise Web Server from a ZIP File”). With a ZIP installation, JBoss Enterprise Web Server can be extracted and installed in any location. The ZIP installation files are available for Red Hat Enterprise Linux 5, Red Hat Enterprise Linux 6, and Red Hat Enterprise Linux 7 as well as for Solaris and Windows.
JBoss Enterprise Web Server 2 is packaged so that there are two ZIP files for each platform. The following ZIP files are available for each supported platform:
  • jboss-ews-application-servers-2.1.0-<platform>-<architecture>.zip which contains:
    • Tomcat 6
    • Tomcat 7
    • Platform specific utilities
  • jboss-ews-httpd-2.1.0-<platform>-<architecture>.zip, which contains:
    • Apache http server.
    • All http modules.

2.2. RPM Installation Files

RPM installation packages for JBoss Enterprise Web Server 2 are available from Red Hat Network for Red Hat Enterprise Linux 5 and 6. For Red Hat Enterprise Linux 7, RPM installation packages for JBoss Enterprise Web Server 2 are available from Red Hat Subscription Management (see Section 2.5, “Installing Enterprise Web Server from RPM Packages”). Installation from RPM packages integrates the web server with the service command and installs its resources into absolute paths. The RPM installation option is only available for Red Hat Enterprise Linux 5, Red Hat Enterprise Linux 6, and Red Hat Enterprise Linux 7.

Warning

RPM installation shares Java library files. Library version conflicts occur when Enterprise Web Server coexists with the Enterprise Application Platform and both were installed from RPM packages. To workaround the issue, install one software with RPM, and the other from a ZIP file.

2.3. Prerequisites

The following is a list of general prerequisites:
  • Sufficient disk space for your JBoss Enterprise Web Server installation.
  • Sufficient disk space for your applications.
Additional prerequisites exist depending on whether the ZIP or RPM installation method is used.

2.3.1. RPM Installation Prerequisites

Before installing JBoss Enterprise Web Server on Red Hat Enterprise Linux using the RPM installation method, ensure the following:

2.3.2. ZIP Installation Prerequisites

Before installing JBoss Enterprise Web Server on Red Hat Enterprise Linux using the ZIP installation files, ensure the following:
  • A supported version of Java is installed (see Section 2.3.3, “Installation Procedures”).
  • The following required packages are installed:
    • krb5-workstation
    • mod_auth_kerb
    • elinks (required for the apachectl functionality)
    • mailcap. The mailcap package contains /etc/mime.types, which is used by httpd for MIME type mapping extensions. This package is not included in Red Hat Enterprise Linux and must be included.
  • The following required packages are installed for Red Hat Enterprise Linux 7:
    • The following required packages are installed for Red Hat Enterprise Linux 7:
      • apr-util-ldap (required only if you want to use LDAP authentication)
      • httpd22 (available in the jb-ews-2-for-rhel-7-server-rpms repository)
      • httpd22-devel (available in the jb-ews-2-for-rhel-7-server-rpms repository)
      • mod_auth_kerb-eap6 (available in the jb-ews-2-for-rhel-7-server-rpms repository)
  • One of the following packages must be installed as a prerequisite: apr-devel or apr-util-devel.

Note

If you are installing JBoss Enterprise Web Server on Red Hat Enterprise Linux 6 and 7, you must remove the tomcatjss package before installing the tomcat-native package. The tomcatjss package uses an underlying NSS security model rather than the OpenSSL security model.

Procedure 2.1. Removing tomcatjss Package

Follow this procedure to remove the tomcatjss package:
  1. At the shell prompt, become the root user.
  2. Run the following uninstall command:
    # yum remove tomcatjss

Procedure 2.2. Installing Required Packages

If you are using a system registered with Red Hat Network or Red Hat Subscription Management and subscribed to the appropriate channel or repositories, you may either mount a repository with the packages or install them from the online repository. Follow this procedure to install the packages from the online repository.
Follow this procedure to install the required packages from the online repository:
  1. Depending on your operating system version, run the respective installation command as the root user:
    • On Red Hat Enterprise Linux 6 and 5:
      # yum install krb5-workstation mod_auth_kerb elinks
    • On Red Hat Enterprise Linux 7:
      # yum install httpd22 httpd22-devel mod_auth_kerb-eap6 apr-util-ldap krb5-workstation elinks
  2. When prompted, press y to proceed.
  3. When the installation is complete, run the following command to check that the packages are installed:
    • On Red Hat Enterprise Linux 6 and 5:
      # rpm -q krb5-workstation mod_auth_kerb elinks
    • On Red Hat Enterprise Linux 7:
      # rpm -q httpd22 httpd22-devel mod_auth_kerb-eap6 apr-util-ldap krb5-workstation elinks
    If the packages are installed, the command output shows the package names with their version numbers.

2.3.3. Installation Procedures

Procedure 2.3. Installing Java

Follow this procedure to install and set up a supported Java version:
  1. Subscribe your system to the appropriate channel:
    • Red Hat Enterprise Linux Server Supplementary for Red Hat Enterprise Linux 7
    • Red Hat Enterprise Linux Server Supplementary for Red Hat Enterprise Linux 6
    • Red Hat Enterprise Linux Supplementary for Red Hat Enterprise Linux 5
  2. On the command line, as the root user run the command to install Java 1.6 or 1.7:
    • On Red Hat Enterprise Linux 5, Red Hat Enterprise Linux 6, and Red Hat Enterprise Linux 7, execute the yum install command to install Java 1.6:
      # yum install java-1.6.0-<VENDOR>-devel
      Substitute <VENDOR> with sun, ibm, or openjdk.
      Execute the following variation of the listed command to install Java 1.7:
      # yum install java-1.7.0-<VENDOR>-devel
      Substitute <VENDOR> with oracle, ibm, or openjdk.
  3. Run the following commands as the root user (if switching from another user, make sure to run the command su -) to make sure the correct JDK is in use:
    # alternatives --config java
    # alternatives --config javac
    These commands return lists of available JDK versions with the version in use marked with a plus (+) sign. If the set JDK is not the desired option, switch to the right JDK as instructed on the command line.

    Important

    Any software that makes use of the java and javac commands is using the JDK set by alternatives. Switching java alternatives may negatively influence running of such software.
  4. Install the required packages (see Section 2.3.2, “ZIP Installation Prerequisites”)

2.4. Installing Enterprise Web Server from a ZIP File

Make sure that you have installed all the required packages before you install JBoss Enterprise Web Server from a ZIP file (see Section 2.3.2, “ZIP Installation Prerequisites”).

2.4.1. Downloading and Extracting the ZIP File

To install JBoss Enterprise Web Server, download and extract the installation ZIP file. The ZIP file is available on the Red Hat Customer Portal.

Procedure 2.4. Downloading the Enterprise Web Server ZIP File

Download the JBoss Enterprise Web Server ZIP files (jboss-ews-application-servers-2.1.0-<platform>-<architecture>.zip and jboss-ews-httpd-2.1.0-<platform>-<architecture>.zip) from the Red Hat Customer Portal site:
  1. Open http://access.redhat.com in your web browser.
  2. In the upper right corner, click the Log in button.
  3. Enter your login information and click Log in.
  4. Hover over the Downloads option in the menu bar at the top of the page and under JBoss Enterprise Middleware in the displayed menu, click Downloads.
  5. In the Product drop-down box column, click Web Server.
  6. On the Software Downloads page, select the product version in the Version drop-down box and in the Releases tab below, click the JBoss EWS link with the correct version.
  7. On the Software Details page, click the Download button next to the File drop-down box for the jboss-ews-application-servers-2.1.0-<platform>-<architecture>.zip and jboss-ews-httpd-2.1.0-<platform>-<architecture>.zip files.

    Note

    Download the appropriate versions for the target platform and architecture.
  8. Confirm the file downloads have successfully completed.
  9. Follow Procedure 2.5, “Extracting the ZIP File” to extract the JBoss Enterprise Web Server ZIP files.

Procedure 2.5. Extracting the ZIP File

Unzip the downloaded ZIP files:
  1. On the command line, change to the directory with the ZIP files.
  2. Run the following unzip command, once for each ZIP file:
    unzip <FILE_NAME> -d <TARGET_DIRECTORY> 
    Substitute FILE_NAME with the name of each downloaded file and TARGET_DIRECTORY with the path to the target directory. After the ZIP files are extracted, configure the environment before running JBoss Enterprise Web Server (see Section 2.4.2, “Configuring the Environment”).

2.4.2. Configuring the Environment

Before running JBoss Enterprise Web Server, the JAVA_HOME variable must be set (see Procedure 2.6, “Setting JAVA_HOME”).
Optionally, you can also:
Run the post-installation script once you have set up the environment (see Procedure 2.13, “Running the Post-Installation Script”).
Configure the server to allow the JBoss ON discovery and give JBoss ON the needed access to allow JBoss Operations Network to monitor JBoss Enterprise Web Server (see Chapter 6, Monitoring Enterprise Web Server with JBoss Operations Network).

Procedure 2.6. Setting JAVA_HOME

  1. In the bin directory of your Tomcat (either $EWS_HOME/tomcat6/bin or $EWS_HOME/tomcat7/bin), create the setenv.sh file.
    For example, run the command vim tomcat<VERSION>/bin/setenv.sh
  2. Add the JAVA_HOME path definition into the file.
    For example export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64

Procedure 2.7. Creating tomcat User

Follow this procedure to create the tomcat user and its parent group:
  1. At the shell prompt, become the root user.
  2. Run the following command to create the tomcat user group:
    # groupadd -g 91 -r tomcat
  3. Go to /opt/jboss-ews-2.1.
  4. From /opt/jboss-ews-2.1, run the following command to create the tomcat user in the tomcat user group:
    # useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r tomcat
  5. From /opt/jboss-ews-2.1, run the following command to assign the ownership of the tomcat directories to the tomcat user and allow the user to run the tomcat service:
    # chown -R tomcat:tomcat tomcat<VERSION> 
    Substitute <VERSION> with the respective tomcat version number (6 or 7).
  6. From /opt/jboss-ews-2.1, issue the command ls -l and check if the tomcat user is the owner of the Tomcat directory.
  7. Make sure that the tomcat user has the execution permission to all parent directories.

Procedure 2.8. Setting the apache User

Follow this procedure to set up the apache user:
  1. Run the following commands as the root user to create the apache user group:
    # groupadd -g 48 -r apache
  2. Run the following command to create the apache user in the apache user group:
    # useradd -c "Apache" -u 48 -g apache -s /bin/sh -r apache
  3. Change to /opt/jboss-ews-2.1 and run the following command to assign the ownership of the apache directories to the apache user and allow the user to run httpd:
    # chown -R apache:apache httpd
  4. From /opt/jboss-ews-2.1, issue the command ls -l and check that the apache user has execution permission to the respective Apache install path. Output is similar to the following:
    drwxrwxr-- 11 apache apache 4096 Feb 14 06:52 httpd

Procedure 2.9. Removing SSL

JBoss Enterprise Web Server supports SSL by default, but it can be removed.
Follow this procedure to remove or re-add SSL:
  1. Go to the /opt/jboss-ews-2.1/httpd/conf.d/ directory.
  2. Rename the SSL configuration file:
    • To remove SSL, rename ssl.conf to ssl.conf.disabled.
    • To re-add SSL, rename ssl.conf.disabled to ssl.conf.

Procedure 2.10. Configuring log4j

Follow this procedure to add log4j logging to Tomcat:
  1. Go to the /opt/jboss-ews-2.1/extras/ directory.
  2. Copy the log4j-eap6.jar, log4j.properties, and tomcat-juli-adapters.jar files to the lib directory of the Tomcat directory.
    For example:
    # cp log4j.properties ../tomcat<VERSION>/lib/
    # cp log4j-eap6.jar ../tomcat<VERSION>/lib/
    # cp tomcat-juli-adapters.jar ../tomcat<VERSION>/lib/
    Replace <VERSION> with the respective Tomcat version number (6 or 7).
  3. Replace tomcat-juli.jar file in your Tomcat bin directory with the tomcat-juli.jar file from /opt/jboss-ews-2.1/extras/:
    # cp tomcat-juli.jar ../tomcat<VERSION>/bin/

Procedure 2.11. Configuring mod_jk

To configure the HTTP Server to use mod_jk, define the following:
  • available workers (JBoss instances) in the workers.properties file
  • the mod_jk configuration file
Follow this procedure to configure the HTTP Server to use mod_jk as its load balancer:
  1. In the /opt/jboss-ews-2.1/httpd/conf/ directory, create workers.properties.
  2. In the /opt/jboss-ews-2.1/httpd/conf.d/ directory, create mod_jk.conf.

    Note

    You can also use the template files from the jboss-ews-docs-2.1.0.zip file (the file is available at the Red Hat Customer Portal ): after you have downloaded and unzipped the file, copy the sample files mod_jk.conf.sample and workers.properties.sample from the /opt/jboss-ews-2.1/doc/mod_jk/ to the locations defined in Step 1 and Step 2. Rename them (drop the sample extension) and modify their content as needed (see Section 2.4.7, “Additional Resources”).

Procedure 2.12. Configuring mod_cluster

  • The mod_cluster configuration can be customized in /opt/jboss-ews-2.1/httpd/conf.d/mod_cluster.conf.
    For more information about customizing mod_cluster, see the JBoss HTTP Connector section of the HTTP Connectors and Load Balancing Guide.

Procedure 2.13. Running the Post-Installation Script

Follow this procedure to run the post-installation script:
  1. At the shell prompt, become the root user.
  2. Change to the /opt/jboss-ews-2.1/httpd directory.
  3. Run the following command:
    # ./.postinstall

2.4.3. 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
  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
  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
      • Use the following command for Tomcat 7:
        chown -R tomcat:tomcat tomcat7
  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
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

2.4.4. Running the HTTP Server

After you have extracted the Enterprise Web Server ZIP file, change into the httpd directory and run the post install script by executing the following:
./.postinstall
Check to see if a user called apache exists on the system by running the following command:
id apache
If the user does not exist then it will need to be added, along with the appropriate usergroup. In order to achieve this, execute the following:
/usr/sbin/groupadd -g 91 -r apache
/usr/sbin/useradd -c "Apache" -u 48 -s /bin/sh -r  apache
Once this is completed, if the apache user will be running the httpd service, then the ownership of the HTTP directories will need to be changed to reflect this:
chown -R apache:apache httpd
To test that the above commands have been successful, check that the apache user has execution permission to the HTTP server install path.
Start the HTTP server by changing to the httpd directory and executing:
su -m -c "./sbin/apachectl start"
Stop the HTTP server by executing:
su -m -c "./sbin/apachectl stop"

2.4.5. Running Enterprise Web Server

To run JBoss Enterprise Web Server, run the following:

2.4.5.1. Running Tomcat

You can run Tomcat either in the background as a service (see Section 2.4.5.1.2, “Running Tomcat as a Service”) or in the foreground as a program (see Section 2.4.5.1.1, “Running Tomcat as a Program”).

Important

It is strongly recommended to run Tomcat with the startup.sh script (see the startup.sh entry in Section 2.4.5.1.1, “Running Tomcat as a Program”). Note that this is the only supported running method.
Before starting Tomcat, ensure that the following prerequisites are met:
2.4.5.1.1. Running Tomcat as a Program
To run Tomcat as a program, run one of the following scripts:
  • startup.sh script
    Run the following command as the root user with the respective Tomcat version (6 or 7):
    # sh /opt/jboss-ews-2.1/tomcat<VERSION>/bin/startup.sh
    The system reads the configuration file and changes to the user and group to 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.
  • catalina.sh script
    Run the following command with the respective Tomcat version (6 or 7) :
    # sh /opt/jboss-ews-2.1/tomcat<VERSION>/bin/catalina.sh
    
  • custom script, which calls catalina.sh
2.4.5.1.2. Running Tomcat as a Service
To run Tomcat as a service, you can use the daemon script with jsvc provided in Tomcat 6 and 7.
For more information about Jsvc, see About Jsvc chapter of the HTTP Connectors and Load Balancing Guide .

2.4.5.2. Running HTTP

To start httpd, change to /opt/jboss-ews-2.1/httpd/sbin/ and run the following command as the root user:
# ./apachectl start

2.4.6. Stopping Enterprise Web Server

Stop the tomcat and httpd service to stop JBoss Enterprise Web Server (see Section 2.4.6.1, “Stopping Tomcat” and Section 2.4.6.2, “Stopping HTTP”).

2.4.6.1. Stopping Tomcat

Run the following command as the root user to stop tomcat:
# sh /opt/jboss-ews-2.1/tomcat<VERSION>/bin/shutdown.sh

2.4.6.2. Stopping HTTP

To stop httpd, change to /opt/jboss-ews-2.1/httpd/sbin/ and run the following command as the root user:
# apachectl stop

2.4.7. Additional Resources

To acquire the product documentation and source packages, download the jboss-ews-docs-2.1.0.zip file for documentation, jboss-ews-2.1.0-<platform>.src.zip file for Windows and Solaris platform, and jboss-ews-src-2.1.0.zip file for Red Hat Enterprise Linux, available at the Red Hat Customer Portal. Extract the files to /opt/jboss-ews-2.1. On extraction, doc and src directories are created, which contain the documentation and examples, and source code.

2.5. Installing Enterprise Web Server from RPM Packages

RPM installation integrates the JBoss Enterprise Web Server with the system and Tomcat and HTTP Server are installed as system services (you can run them as services from the command line).
Before installing JBoss Enterprise Web Server from RPMs, ensure that the prerequisites listed in Section 2.5.1, “RPM Installation Methods”. Also ensure the system is registered with Red Hat Network for Red Hat Enterprise Linux 5 and 6 and subscribed to the appropriate JBoss Enterprise Web Server channels (see Procedure 2.16, “Subscribing to Red Hat Network Enterprise Channels”). For Red Hat Enterprise Linux 7, ensure the system is registered with Red Hat Subscription Management and subscribed to the appropriate JBoss Enterprise Web Server repositories (see Procedure 2.17, “Subscribing to Red Hat Subscription Management Repositories”).

2.5.1. RPM Installation Methods

JBoss Enterprise Web Server can be installed in one of two ways:
  • Using the groupinstall command. This option installs all the packages required by JBoss Enterprise Web Server or JBoss Enterprise Web Server Plus. This option is recommended for new users.
  • Installing packages individually using the yum command. This option allows the user to select which packages to install and allows the user to exclude packages that are not required for their specific installation. This option is not recommended for new users.

2.5.2. RPM Packages

JBoss Enterprise Web Server components are distributed in RPM packages for individual Red Hat Enterprise Linux versions.

RPM Packages for Red Hat Enterprise Linux 5, 6, and 7

Tomcat 7:
tomcat7
tomcat7-webapps
tomcat7-admin-webapps
Tomcat 6:
tomcat6
tomcat6-webapps
tomcat6-admin-webapps
Tomcat Native:
tomcat-native
HTTP Server:
httpd
mod_jk:
mod_jk
mod_cluster:
mod_cluster
mod_cluster-native
mod_cluster-tomcat6
mod_cluster-tomcat7
mod_rt:
mod_rt
mod_snmp:
mod_snmp
mod_auth_kerb:
mod_auth_kerb

2.5.3. RHN Channels for JBoss Enterprise Web Server Installation Packages

To be able to download and install JBoss Enterprise Web Server RPM packages, you need to subscribe to the channels with the resources intended for your operating system version and architecture (see Section 2.5.5, “Installing Enterprise Web Server from RPM Files”):
  • on Red Hat Enterprise Linux 6:
    • jb-ews-2-i386-server-6-rpm
    • jb-ews-2-x86_64-server-6-rpm
  • on Red Hat Enterprise Linux 5:
    • jb-ews-2-i386-server-5-rpm
    • jb-ews-2-x86_64-server-5-rpm

2.5.4. Red Hat Subscription Management Repositories for JBoss Enterprise Web Server Installation Packages

To be able to download and install JBoss Enterprise Web Server RPM packages on Red Hat Enterprise Linux 7, you need to subscribe to the repositories with the resources intended for your operating system version and architecture (see Section 2.5.5, “Installing Enterprise Web Server from RPM Files”):
  • on Red Hat Enterprise Linux 7:
    • jb-ews-2-for-rhel-7-server-rpms

Note

Ensure that Red Hat Subscription-Manager package is installed on your machine. For more information on Red Hat Subscription Management, see Red Hat Enterprise Linux 7 Getting Started Guide.

2.5.5. Installing Enterprise Web Server from RPM Files

Before downloading and installing the RPM packages, register your system with Red Hat Network for Red Hat Enterprise Linux 5 and 6 and Red Hat Subscription Management for Red Hat Enterprise Linux 7 and subscribe to the respective channels/repositories.

Note

If you are installing JBoss Enterprise Web Server on Red Hat Enterprise Linux 6 and 7, you must remove the tomcatjss package before installing the tomcat-native package. The tomcatjss package uses an underlying NSS security model rather than the OpenSSL security model.

Procedure 2.15. Removing tomcatjss Package

Follow this procedure to remove the tomcatjss package:
  1. At the shell prompt, become the root user.
  2. Run the following uninstall command:
    # yum remove tomcatjss

Procedure 2.16. Subscribing to Red Hat Network Enterprise Channels

  1. Unsubscribe your system from the Red Hat Application Stack channel.
  2. Subscribe to the JBoss Enterprise Web Server channels (see Section 2.5.3, “RHN Channels for JBoss Enterprise Web Server Installation Packages”).

Procedure 2.17. Subscribing to Red Hat Subscription Management Repositories

  1. Click on the appropriate Units or Subscription Management Applications.

Procedure 2.18. Installing Enterprise Web Server from RPM Packages

Install the respective packages (see Section 1.2, “Components” and Section 2.5.2, “RPM Packages” to identify the packages relevant for your installation):
  1. At the shell prompt, become the root user.
  2. To install JBoss Enterprise Web Server as a group of packages, run the installation command:
    # yum groupinstall jboss-ews2
    • To install all packages in the group individually, on Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 5:
      # yum install <LIST_OF_PACKAGES>
      Substitute the <LIST_OF_PACKAGES> with names of the packages separated with spaces.
      To install all JBoss Enterprise Web Server packages, run this command:
      # yum install httpd mod_auth_kerb mod_cluster mod_cluster-native mod_jk-ap22 mod_rt mod_snmp mod_cluster-tomcat6 mod_cluster-tomcat7 tomcat6 tomcat6-admin-webapps tomcat6-webapps tomcat7 tomcat7-admin-webapps tomcat7-webapps tomcat-native
  3. Verify the system is using the correct javac and java (for details see Procedure 2.3, “Installing Java”).
Install Optional Packages

Run the following command to install the listed optional packages with the JBoss Enterprise Web Server packages:

# yum install httpd-manual mod_jk-manual mod_ssl tomcat6-docs-webapp tomcat7-docs-webapp tomcat6-log4j tomcat7-log4j mod_jk-ap22 mod_cluster-demo hibernate3-commons-annotations-javadoc hibernate-jpa-2.0-api-javadoc tomcat6-javadoc tomcat7-javadoc apache-commons-daemon-jsvc-eap6

2.5.6. Install the JBoss Enterprise Web Server Plus Group

Procedure 2.19. Installing the JBoss Enterprise Web Server Plus Group of Packages

  1. At the shell prompt, become the root user.
  2. To install JBoss Enterprise Web Server Plus group of packages, run the installation command:
    # yum groupinstall jboss-ews2plus
    • To install all packages in the group individually, on Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 6, and Red Hat Enterprise Linux 5:
      # yum install <LIST_OF_PACKAGES>
      Substitute the <LIST_OF_PACKAGES> with names of the packages separated with spaces.
      To install all JBoss Enterprise Web Server Plus packages, run this command:
      # yum install hibernate-jpa-2.0-api hibernate3-commons-annotations hibernate4-eap6 hibernate4-core-eap6 hibernate4-envers-eap6 hibernate4-entitymanager-eap6 hibernate4-c3p0-eap6

2.5.7. Configuring the Environment

Before running JBoss Enterprise Web Server, you can optionally configure environment:

Procedure 2.20. Removing SSL

The SSL support is optional. It is provided by the mod_ssl package and is enabled on package installation. To remove SSL, do the following:
  1. At the shell prompt, become the root user.
  2. Run the respective uninstall command:
    • on Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 6, and Red Hat Enterprise Linux 5:
      # yum remove mod_ssl
Configuring log4j

For tomcat6, the log4j support is provided by the tomcat6-log4j package and is enabled on package installation (see Procedure 2.18, “Installing Enterprise Web Server from RPM Packages”).

Procedure 2.21. Removing log4j From Tomcat 6

Follow this procedure to remove log4j from Tomcat 6:
  1. At the shell prompt, become the root user.
  2. Run the respective uninstall command:
    • on Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 6, and Red Hat Enterprise Linux 5:
      # yum remove tomcat6-log4j

Procedure 2.22. Configuring mod_jk

Follow this procedure to configure and enable mod_jk:
  1. Install the template mod_jk configuration file:
    # cp /usr/share/doc/mod_jk-ap22-*/mod_jk.conf.sample /etc/httpd/conf.d/mod_jk.conf
  2. Install the template workers.properties file:
    # cp /usr/share/doc/mod_jk-ap22-*/workers.properties.sample /etc/httpd/conf/workers.properties
  3. Add worker mappings to workers.properties. For example:
    # Mount the Servlet context to the ajp20 worker
    /jmx-console=loadbalancer
    /jmx-console/*=loadbalancer
    /web-console=loadbalancer
    /web-console/*=loadbalancer

    Note

    The default configuration is adequate for low-traffic web sites. For optimization information for moderate and high-load web sites, see http://kbase.redhat.com/faq/docs/DOC-15836.

Procedure 2.23. Configuring mod_cluster

The mod_cluster load balancer is optional. It is provided by the mod_cluster package and is enabled on package installation.
Follow this procedure to configure the HTTP Server to use mod_cluster as its load balancer:
  1. In the /etc/httpd/conf/httpd.conf file, add the hash (#) sign at the beginning of the following line to disable mod_proxy_balancer.so:
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    This module is incompatible with the JBoss HTTP Connector.
  2. Configure the server to load the JBoss HTTP Connector modules:
    1. Create the file /etc/httpd/conf.d/JBoss_HTTP.conf.
    2. Add the following lines to the JBoss_HTTP.conf file:
      LoadModule slotmem_module modules/httpd/modules/mod_slotmem.so
      LoadModule manager_module modules/mod_manager.so
      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
      LoadModule advertise_module modules/mod_advertise.so

2.5.8. Setting the Service Boot Behavior

You can define the service behavior (for the tomcat and httpd service) at boot from the command line or with the Service Configuration graphical tool:
  • From the command line, issue the following command with the <SERVICE_NAME> replaced with the respective service name (tomcat6 or tomcat7, and httpd or httpd22)
    chkconfig <SERVICE_NAME> on
    For details see the chkconfig man page.
  • To use the Service Configuration tool, issue the command system-config-services and change the service setting in the displayed window.

2.5.9. Running Enterprise Web Server

To run JBoss Enterprise Web Server, run the following:

Procedure 2.24. Running Tomcat

Important

Both Tomcat 6 and Tomcat 7 can be run in parallel on your system. However, to avoid conflicts each version should use its own port address.
Follow this procedure to start tomcat:
  1. At the shell prompt, become the root user.
  2. Run the following start command with the <VERSION> substituted with the correct Tomcat version (6 or 7):
    # service tomcat<VERSION> start
  3. Go to http://localhost:8080 in your web browser to verify that Tomcat is running. The Apache Software Foundation page appears.

    Note

    In JBoss Enterprise Web Server installations from the RPM packages, the only supported way of running Tomcat is the running described in this section.

Procedure 2.25. Running HTTP

Follow this procedure to start httpd:
  1. At the shell prompt, become the root user.
  2. Run the following start command:
    • On Red Hat Enterprise Linux 6 or Red Hat Enterprise Linux 5:
      # service httpd start

2.5.10. Stopping Enterprise Web Server

To stop JBoss Enterprise Web Server, stop the Apache HTTP Server and Tomcat (see Procedure 2.26, “Stopping Tomcat” and Procedure 2.27, “Stopping HTTP”).

Procedure 2.26. Stopping Tomcat

Follow this procedure to stop tomcat:
  1. At the shell prompt, become the root user.
  2. Run the following service command with the <VERSION> substituted with the correct Tomcat version (6 or 7):
    # service tomcat<VERSION> stop
  3. Go to http://localhost:8080 in your web browser to verify that Tomcat is no longer running.

Procedure 2.27. Stopping HTTP

Follow this procedure to stop httpd:
  1. At the shell prompt, become the root user.
  2. Run the following stop command:
    • On Red Hat Enterprise Linux 6 or Red Hat Enterprise Linux 5:
      # service httpd stop

2.5.11. Additional Documentation

To install additional documentation, issue the command yum install in Red Hat Enterprise Linux 5 and Red Hat Enterprise Linux 6 followed by the list of required documentation packages.
  • The following documentation packages are available for Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 5:
    • mod_jk-manual
    • httpd-manual
    • tomcat6-docs-webapp
    • tomcat7-docs-webapp

2.6. SELinux Policies

For each of the RPMs listed in the table, specific SELinux policies are installed and applied as a default.

Table 2.1. RPMs and Default SELinux Policies

Name Port Information Policy Information
mod_cluster Two ports (6666 for TCP and 23364 for UDP) are added for httpd_port_t to allow the httpd process to use them. A post installation script configures the context mapping for /var/cache/mod_cluster to enable the httpd process to write at this location.
mod_snmp The installed mod_snmp policy allows httpd processes to bind to snmp_port_t ports. This allows httpd to use port 161 and 162 (used with both UDP and TCP). A post installation script configures the context mapping for /var/cache/mod_snmp to enable the httpd process to write at this location.
tomcat Four ports are added to http_port_t (TCP ports 8080, 8005, 8009 and 8443) to allow the httpd process to use them. The Tomcat{version} policy is installed, which sets ths appropriate SELinux domain for the process when Tomcat executes. It also sets the appropriate contexts to allow tomcat to write to /var/lib/tomcat{version}, /var/log/tomcat{version}, /var/cache/tomcat{version} and /var/run/tomcat{version}.pid.
For more information about using SELinux and other Red Hat Enterprise Linux security information, see the Red Hat Enterprise Linux 6 Security Guide.

2.6.1. Default SELinux Policies for a ZIP Installation

No SELinux configuration is provided (or supported) as a default for the JBoss Enterprise Web Server ZIP files. For the ZIP files, httpd and Tomcat processes run in httpd_t or unconfined_java_t domains. These domains do not confine the processes, therefore the administrator must take the following security precautions:
  • Run httpd using the apachectl script. This ensures that the user apache owns the processed instead of the user root.
  • Confine file access for users tomcat and apache to files and directories that are not necessary to the JBoss Enterprise Web Server runtime.
  • Do not run Tomcat as the user root.
To avoid the listed security suggestions, it is recommended to use the RPM version of the JBoss Enterprise Web Server installation.

2.6.2. Compile SELinux policies

You can compile your own Tomcat 6/7 SELinux policies as a root user.
Prerequisites

Before compiling SELinux policies ensure the following prerequisites:

  • selinux-policy-devel package is installed.
  • Tomcat 6 or 7 is installed using RPM installation method.
Following is an example of a SELinux policy compilation from RPM distributed sources including the expected results.
Tomcat 7:

# cd /etc/tomcat7/selinux/packages/tomcat7
# make -f /usr/share/selinux/devel/Makefile
Compiling targeted tomcat7 module
/usr/bin/checkmodule:  loading policy configuration from tmp/tomcat7.tmp
/usr/bin/checkmodule:  policy configuration loaded
/usr/bin/checkmodule:  writing binary representation (version 10) to 

tmp/tomcat7.mod
Creating targeted tomcat7.pp policy package
rm tmp/tomcat7.mod tmp/tomcat7.mod.fc

# semodule -i tomcat7.pp
Tomcat 6:

# cd /etc/tomcat6/selinux/packages/tomcat6
# make -f /usr/share/selinux/devel/Makefile
Compiling targeted tomcat6 module
/usr/bin/checkmodule:  loading policy configuration from tmp/tomcat6.tmp
/usr/bin/checkmodule:  policy configuration loaded
/usr/bin/checkmodule:  writing binary representation (version 10) to 

tmp/tomcat6.mod
Creating targeted tomcat6.pp policy package
rm tmp/tomcat6.mod.fc tmp/tomcat6.mod

# semodule -i tomcat6.pp

Chapter 3. Installing Enterprise Web Server on Windows

Follow the procedures in this chapter to install, configure, and run JBoss Enterprise Web Server on Windows.

Important

JBoss Enterprise Web Server 2.1 support for Windows is limited to the Sun JDK (1.6 and 1.7) on Windows Server 2008 and Windows Server 2008R2.

3.1. Prerequisites

The following is a list of general prerequisites:
  • Sufficient disk space for your JBoss Enterprise Web Server installation.
  • Sufficent disk space for your applications.
Before installing JBoss Enterprise Web Server on Windows, confirm that Java SDK 1.6 is installed (see Procedure 3.1, “Installing Java” ).

Procedure 3.1. Installing Java

  1. Download JDK 1.6 or 1.7 for your operating system and architecture from the web site. (Download JDK)
  2. Double-click the downloaded file to start the Java installation.
  3. Proceed as instructed in the displayed installation window.

3.2. Downloading and Extracting Installation File

Download the JBoss Enterprise Web Server ZIP files from the Red Hat Customer Portal site that is correct for your architecture. The jboss-ews-application-servers-2.1.0-<platform>.<architecture>.zip file contains Tomcat 6 and 7, as well as other platform utilities. The jboss-ews-httpd-2.1.0-<platform>.<architecture>.zip file contains the Apache http server and other http modules.

Procedure 3.2. Downloading the Enterprise Web Service ZIP File

  1. Open http://access.redhat.com in your web browser.
  2. In the right upper corner, click the Log in button.
  3. Enter your login information and click Log in.
  4. Hover over the Downloads option in the menu bar at the top of the page and click Downloads under JBoss Enterprise Middleware in the displayed menu.
  5. In the Product drop-down menu, click Web Server.
  6. On the Releases tab, click the JBoss EWS link for Windows with the correct architecture and version.
  7. On the Software Details page, click the Download button next to the File drop-down box.

    Note

    Make sure the file is intended for your operating system and architecture.
  8. Confirm the file download.

Procedure 3.3. Extracting the ZIP File

  1. Right-click the file and select Extract All....
  2. Click Next.
  3. When prompted for the extract location, click Browse and navigate to C:\Program Files.
  4. Click Finish.

    Note

    Files are extracted in C:\Program Files\jboss-ews-2.1. If you wish to change the httpd configuration (for example, add mod_cluster), edit the httpd.conf file in the C:\Program Files\jboss-ews-2.1\etc\httpd\ folder.

    Note

    The mod_auth_kerb package is not supported on the Windows Operating System.

3.3. Configuring the Environment

Before running JBoss Enterprise Web Server, set the environment variables and run the post-installation scripts.

Procedure 3.4. Setting Environment Variables

  1. Log in to an account with local administrator permissions.
  2. Go to Control PanelSystem.
  3. Click on the Advanced tab.
  4. Click the Environment Variables button.
  5. Click the New for System Variables.
  6. Enter the required JAVA_HOME, TMP and TEMP name-value pairs.
  7. You will also need to add C:\Program Files\jboss-ews-2.1\bin to the PATH environment variable of the user the service runs under. This is SYSTEM by default. Without this, the SSL Connector will fail to work.

Procedure 3.5. Running the Post-Installation Script

  1. Run the Command Prompt as administrator even if you are logged in as the administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.
  2. In the Command Prompt, type the following to change to the etc folder of your Enterprise Web Server installation:
    C:\> cd /D "C:\Program Files\jboss-ews-2.1\etc"
  3. Issue the command call postinstall.httpd.bat and then the command call postinstall.tomcat.bat to run the post-installation script.
    The script creates the required symbolic links (Junction Points) for temporary logging and configuration directories.

Procedure 3.6. Installing Tomcat

Follow this procedure to install Tomcat as a service:
  • Run the Command Prompt as administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.

      Note

      On 64-bit Windows, you need to use the 64-bit version of the Command Prompt (cmd.exe). Running the cmd command from a 32-bit application launches a 32-bit Command Prompt instance. This causes the service setup script to fail with a File Not Found warning.
    4. Change to the bin folder in the JBoss Enterprise Web Server installation folder.
      1. For Tomcat 6

        For Tomcat 6, the command is:
         C:\> cd /D "C:\Program Files\jboss-ews-2.1\share\tomcat6\bin"
      2. For Tomcat 7

        For Tomcat 7, the command is:
        C:\> cd /D "C:\Program Files\jboss-ews-2.1\share\tomcat7\bin"
    5. In the Command Prompt, run the following command :
      call service.bat install

Procedure 3.7. Installing HTTP

Follow this procedure to install HTTPD as a service:
  1. Run the Command Prompt as administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.
  2. Change to the bin folder of your new installation:
    C:\> cd /D "C:\Program Files\jboss-ews-2.1\bin"
  3. In the Command Prompt, run the install command:
    httpd -k install
    A Firewall security dialog prompt demanding networking access for the Apache HTTP Server service appears. Click Allow if you wish to access this service from the network.

    Note

    By default, Apache HTTP Server is configured to listen on port 80. If you have Microsoft IIS installed, ensure the following:
    • World Wide Web... service is stopped and the Startup Type is set to Manual
    • World Wide Web... service is configured to listen on a different port
    Alternatively, you can edit the httpd.conf file before installing the service and change the Listen directive to a port that does not collide with the Internet Information Service listening ports.

Procedure 3.8. Configuring log4j

Follow this procedure to use log4j logging in Tomcat:
  1. Change to C:\Program Files\jboss-ews-2.1\share\extras\
  2. Copy the log4j files to the lib folder for your Tomcat version:
    copy log4j-eap6.jar log4j.properties tomcat-juli-adapters.jar ..\tomcat<VERSION>\lib
  3. Replace tomcat-juli.jar file in your Tomcat bin directory with the tomcat-juli.jar file from C:\Program Files\jboss-ews-2.1\share\extras\:
    copy tomcat-juli.jar ..\tomcat<VERSION>\bin

Procedure 3.9. Removing SSL

JBoss Enterprise Web Server supports SSL by default, but it may be removed.
Follow this procedure to remove or again add SSL:
  1. Go to C:\Program Files\jboss-ews-2.1\etc\httpd\conf.d
  2. Rename the SSL configuration file:
    • To remove SSL, rename ssl.conf to ssl.conf.disabled.
    • To re-add SSL rename ssl.conf.disabled to ssl.conf.

Procedure 3.10. Configuring mod_jk

To configure the HTTP Server to use mod_jk, the following needs to be defined:
  • available workers (JBoss instances) in the workers.properties file
  • the mod_jk configuration file mod_jk.conf
Follow this procedure to configure the HTTP Server to use mod_jk as its load balancer:
  1. In C:\Program Files\jboss-ews-2.1\etc\httpd\conf\ create workers.properties (see http://tomcat.apache.org/connectors-doc/reference/apache.html).
  2. In C:\Program Files\jboss-ews-2.1\etc\httpd\conf.d\ create mod_jk.conf (see http://tomcat.apache.org/connectors-doc/reference/apache.html)

    Note

    You can also use the sample files mod_jk.conf.sample and workers.properties.sample available in C:\Program Files\jboss-ews-2.1\etc\httpd\conf: modify their content as needed and rename them to mod_jk.conf and workers.properties.

Procedure 3.11. Configuring mod_cluster

Follow this procedure to configure the HTTP Server to use mod_cluster as its load balancer:
  1. In the C:\Program Files\jboss-ews-2.1\etc\httpd\conf\httpd.conf file, add the hash (#) sign at the beginning of the following line to disable mod_proxy_balancer.so:
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    This module is incompatible with the JBoss HTTP Connector.
  2. Configure the server to load the JBoss HTTP Connector modules:
    1. Create the file C:\Program Files\jboss-ews-2.1\etc\httpd\conf.d\mod_cluster.conf.
    2. Add the following lines to the mod_cluster.conf file:
      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
      LoadModule slotmem_module modules/mod_slotmem.so
      LoadModule manager_module modules/mod_manager.so
      LoadModule advertise_module modules/mod_advertise.so

Procedure 3.12. Setting Security

Follow this procedure to ensure that the account used to run the services has full control over the C:\Program Files\jboss-ews-2.1 folder and all of its subfolders:
  1. Right-click the C:\Program Files\jboss-ews-2.1 folder and click Properties.
  2. Select the Security tab.
  3. Click the Edit button.
  4. Click the Add button.
  5. In the text box, enter LOCAL SERVICE.
  6. Select the Full Control check box for the new LOCAL SERVICE account.
  7. Click OK.
  8. Click the Advanced button.
  9. Inside the Advanced Security Settings dialog, select LOCAL SERVICE and click Edit.
  10. Select the check box next to the Replace all existing inheritable permissions on all descendants with inheritable permissions from this object option.
  11. Click OK.
  12. Click OK again.
  13. Click OK a third time to apply the settings.
This procedure is intended for Windows 2008. The equivalent procedure in Windows Server 2008R2 can differ slightly.

3.4. Running Enterprise Web Server

You can run the httpd and tomcat services from the Command Prompt or with the Computer Management tool.

Procedure 3.13. Running Enterprise Web Server from the Command Prompt

Follow this procedure to run the httpd and tomcat services from the Command Prompt:
  1. Run the Command Prompt as administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.
  2. On the Command Prompt, issue the following command to run the tomcat service:
    net start tomcat<VERSION>
  3. On the Command Prompt, run the following command to run the httpd service:
    net start Apache2.2
    Right click to select the name of the desired service in the Services Menu. Options include Apache 2.2, Apache Tomcat 6 and Apache Tomcat 7.

Procedure 3.14. Running Enterprise Web Server from the Computer Management Tool

You can run the httpd and tomcat services from the Command Prompt or with the Computer Management tool.
  1. Run the Command Prompt as administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.
  2. Go to StartAdministrative ToolsServices
  3. In the Services dialog, right-click the name of the service (httpd or tomcat) and click Start or Stop.

Note

Some thirdparty applications add libraries to the system directory in Windows. These take precedence over Tomcat when DLL libraries are looked up. This means that if they have the same name as the those used by Tomcat native libraries, they are loaded instead of the libraries distributed with JBoss Enterprise Web Server. Tomcat therefore does not start, and does not log any error messages about it in Windows Event Log, or Tomcat log files. Errors can only be seen by using catalina.bat run.
If this behaviour occurs, check the content of the C:\windows\System32\ directory and PATH directories, and check for DLLs library conflicting with those shipped with Enterprise Web Server. In particular, look for libeay32.dil, ssleay32.dll, and libssl32.dll.

3.5. Stopping Enterprise Web Server

You can run the httpd and tomcat services from the Command Prompt or with the Computer Management tool.

Procedure 3.15. Stopping Enterprise Web Server from the Command Prompt

Follow this procedure to stop the httpd and tomcat services from the Command Prompt:
  1. Run the Command Prompt as administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.
  2. On the Command Prompt, issue the following command to run the tomcat service:
    net stop tomcat<VERSION>
  3. On the Command Prompt, run the following command to run the httpd service:
    net stop Apache2.2
    Right click to select the name of the desired service in the Services Menu. Options include Apache 2.2, Apache Tomcat 6 and Apache Tomcat 7.

Procedure 3.16. Stopping Enterprise Web Server from the Computer Management Tool

Follow this procedure to run the httpd and tomcat services with the Computer Management tool:
  1. Run the Command Prompt as administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.
  2. Go to StartAdministrative ToolsServices
  3. In the Services dialog, right-click the name of the service (httpd or tomcat) and click Stop.

3.6. Directory Structure

The following is the symbolic links created when the post installation scripts (postinstall.tomcat.bat postinstall.http.bat) run after a successful installation:
jboss-ews-2.1
    |
    |-- etc
         |-- httpd
               |-- logs
               |-- modules
               '-- run
    |-- share
         |-- tomcat6
         |-- tomcat7
         |-- apache-tomcat-6.0.41
                |-- logs
                |-- temp
                '-- work
         |-- apache-tomcat-7.0.54
                |-- logs
                |-- temp
                '-- work
         |-- doc
         |-- extras
         |-- java
    |-- var
    |-- JBossEULA
    |-- LICENSE.txt
The Windows folder structure follows Red Hat Enterprise Linux conventions:
  • The etc folder contains configuration files for Apache HTTP Server and the post-installation script.
  • The share folder contains Apache Tomcat 6 and 7 installations and shared Java JARs.

Chapter 4. Installing Enterprise Web Server on Solaris

On Solaris, JBoss Enterprise Web Server can be installed from a ZIP file.
Installation ZIP files are available at Red Hat Customer Portal.

4.1. Prerequisites

The following is a list of general prerequisites:
  • Sufficient disk space for your JBoss Enterprise Web Server installation.
  • Sufficent disk space for your applications.
Before installing JBoss Enterprise Web Server on Solaris, confirm that a supported Java version is installed (see Procedure 4.1, “Installing Java”).

Procedure 4.1. Installing Java

  1. Download JDK 1.6 or 1.7 and the corresponding architecture from the web site (Download JDK).
  2. Go to the download location.
  3. Run the Java installation file.
  4. Go to usr.
  5. Issue the following command to display the current Java symbolic link:
    ls -lad java
  6. Remove the link:
    rm java
  7. Create a java symbolic link to the JDK 1.6.0:
    ln -sf /usr/jdk/<JDK>

4.2. Downloading Installation Files

The installation ZIP files are available at the Red Hat Customer Portal. The jboss-ews-application-servers-2.1.0-<platform>.<architecture>.zip file contains Tomcat 6 and 7, as well as other platform utilities. The jboss-ews-httpd-2.1.0-<platform>.<architecture>.zip file contains the Apache http server and other http modules.

Procedure 4.2. Downloading ZIP Files for Solaris

Follow this procedure to download the ZIP files:
  1. Open https://access.redhat.com in your web browser.
  2. In the right upper corner, click the Log in button.
  3. Enter your login information and click Log in.
  4. Hover over the Downloads option in the menu bar at the top of the page and click Downloads under JBoss Enterprise Middleware in the displayed menu.
  5. In the Product drop-down box column of the displayed page, select Web Server wait for the page to refresh.
  6. On the Releases tab, click the JBoss EWS link for your operating system and architecture.
  7. On the Software Details page, click the Download button next to the File drop-down box.

    Note

    Make sure the file is intended for your operating system and architecture.
  8. Confirm the file download.

4.3. Extracting and Installing Enterprise Web Server

Extraction and installation of Enterprise Web Server for the downloaded ZIP files is as follows:

Procedure 4.3. Extracting and Installing EWS from a ZIP File

Follow this procedure to install JBoss Enterprise Web Server from a ZIP file:
  1. At the shell prompt, become the root user.
  2. Change to the directory with the ZIP file.
  3. Run the following command to extract the package to opt:
    # unzip <FILE_NAME> -d /opt
    Substitute the <FILE_NAME> with the name of the downloaded ZIP file.

    Note

    The system uses the opt directory as a default directory for installing JBoss Enterprise Web Server on Solaris. Make sure the opt directory is present during installation.
  4. Issue the following commands to run the post-installation scripts:
    cd /opt/jboss-ews-2.1/etc
    sh .postinstall.httpd
    sh .postinstall.tomcat
    
    The post-installation process creates the tomcat and apache users and groups, and directories:
    • The users and groups apache with an ID of 48 and tomcat with an ID of 91. The apache runs httpd, while the tomcat user runs tomcat.
    • Additional directories the tomcat group has write permissions to:
      • /var/logs/tomcat7
      • /var/logs/tomcat6

4.4. Configuring the Environment

After you have installed JBoss Enterprise Web Server, set the JAVA_HOME for your Tomcat (see Procedure 4.4, “Configuring Tomcat”).
Optionally, you can also:

Procedure 4.4. Configuring Tomcat

Before starting Tomcat, set its JAVA_HOME variable to point to a supported JDK (1.6.0):
  1. Locate the tomcat configuration file:
    • For Tomcat 7: /opt/jboss-ews-2.1/etc/sysconfig/tomcat7
    • For Tomcat 6: /opt/jboss-ews-2.1/etc/sysconfig/tomcat6
  2. Open the configuration file and delete the hash (#) sign at the beginning of the following line:
    # JAVA_HOME="/usr/java"

Procedure 4.5. Removing SSL

JBoss Enterprise Web Server by default supports SSL. However, you may remove the SSL support.
Follow this procedure to remove or add SSL:
  1. Go to /opt/jboss-ews-2.1/etc/httpd/conf.d
  2. Rename the SSL configuration file:
    • To remove SSL, rename ssl.conf to ssl.conf.disabled.
    • To re-enable the SSL, rename ssl.conf.disabled to ssl.conf.

Procedure 4.6. Configuring log4j

Follow this procedure to add log4j logging to Tomcat:
  1. Go to the /opt/jboss-ews-2.1/share/extras directory.
  2. Copy the log4j-eap6.jar, log4j.properties, and tomcat-juli-adapters.jar files to the lib directory of the Tomcat directory.
    For example:
    extras]# cp log4j.properties ../tomcat<VERSION>/lib/
    extras]# cp log4j-eap6.jar ../tomcat<VERSION>/lib/
    extras]# cp tomcat-juli-adapters.jar ../tomcat<VERSION>/lib/
    Replace <VERSION> with the respective Tomcat version number (6 or 7).
  3. Replace tomcat-juli.jar file in your Tomcat bin directory with the tomcat-juli.jar file from /opt/jboss-ews-2.1/share/extras:
    extras]# cp tomcat-juli.jar ../tomcat<VERSION>/bin/

Procedure 4.7. Configuring mod_jk

To configure the HTTP Server to use mod_jk, define the following:
  • available workers (JBoss instances) in the workers.properties file
  • the mod_jk configuration file mod_jk.conf
Follow this procedure to configure the HTTP Server to use mod_jk as its load balancer:
  1. Create a workers.properties file in /opt/jboss-ews-2.1/etc/httpd/conf (see http://tomcat.apache.org/connectors-doc/reference/workers.html).
  2. Create a mod_jk.conf in /opt/jboss-ews-2.1/etc/httpd/conf.d/, (see http://tomcat.apache.org/connectors-doc/reference/apache.html).

    Note

    You can also copy and modify the sample files mod_jk.conf.sample and workers.properties.sample available in /opt/jboss-ews-2.1/etc/httpd/conf/: modify their content as needed and rename them to mod_jk.conf and workers.properties.

Procedure 4.8. Configuring mod_cluster

  1. Mod_cluster is part of the JBoss Enterprise Web Server 2.1 installation.
  2. In /opt/jboss-ews-2.1/httpd/conf/httpd.conf add a hash (#) sign at the beginning of the following line to disable the mod_proxy_balancer module:
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    This module is incompatible with the JBoss HTTP Connector.
  3. Configure the server to load the JBoss HTTP Connector modules:
    1. Create the file /opt/jboss-ews-2.1/httpd/conf.d/mod_cluster.conf.
    2. Add the following lines to the file /opt/jboss-ews-2.1/httpd/conf.d/mod_cluster.conf:
      LoadModule slotmem_module modules/mod_slotmem.so
      LoadModule manager_module modules/mod_manager.so
      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
      LoadModule advertise_module modules/mod_advertise.so
      

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 (see 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.1/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 (6 or 7) :
    /opt/jboss-ews-2.1/share/tomcat<VERSION>/bin/catalina.sh
    
    The catalina.sh script detects the running JVM version and adds the /opt/jboss-ews-2.1/lib/ path (/opt/jboss-ews-2.1/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 daemon.sh located in /opt/jboss-ews-2.1/share/apache-tomcat-6.x/bin/.
  • In Tomcat 7, use the script daemon.sh located in /opt/jboss-ews-2.1/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>
  4. Run the following command to import the new file:
    # /usr/sbin/svccfg import /var/svc/manifest/application/web/tomcat.xml
  5. Use the following command to start tomcat:
    # /usr/sbin/svcadm enable tomcat6
For further information about Jsvc, see the About Jsvc chapter of the HTTP Connectors and Load Balancing Guide .

4.5.2. Running HTTP Server

The HTTP Server can be run with the provided apachectl script, which is located inside the /opt/jboss-ews-2.1/sbin directory. The apachectl script uses the configuration file /opt/jboss-ews-2.1/etc/sysconfig/httpd. In this file you can edit and select startup parameters, such as the running of mpm.
Apache httpd configuration files are located inside the /opt/jboss-ews-2.1/etc/httpd directory. By default all supported modules are loaded and enabled (see Appendix A, Supported HTTP Modules for a full list). To disable some of the modules, comment out the respective modules in the httpd.conf file (for module description see http://httpd.apache.org/docs/2.2/mod/).

Procedure 4.10. Running HTTP Server

Follow this procedure to start the HTTP Server:
  1. Run the command line as the root user.
  2. Run the following command to start the HTTP Server:
    sbin/apachectl start
    
    If you want your server to continue running automatically after a system reboot, add a call to the apachectl script to your system startup files.

    Note

    For complete documentation on how to start and stop the HTTP Server, see the files, http://localhost/manual/invoking.html and http://localhost/manual/stopping.html respectively.

4.6. Stopping Enterprise Web Server

Procedure 4.11. Stopping Tomcat Running a Service

Follow this procedure to stop tomcat, which is running as a service:
  1. At the shell prompt, become the root user.
  2. Execute the following command with the respective Tomcat version (6 or 7) to stop Tomcat started from with the Tomcat script in the bin directory:
    sbin/tomcat<VERSION> stop

Procedure 4.12. Stopping Tomcat Running a Program

Follow this procedure to stop tomcat, which is running as a program:
  1. At the shell prompt, change to /opt/jboss-ews-2.1/share/tomcat<VERSION>/bin.
  2. Execute the following command with the respective Tomcat version (6 or 7) to stop Tomcat started from with the Tomcat script in the bin directory:
    sh shutdown.sh

Procedure 4.13. Stopping HTTP Server

Follow this procedure to start the HTTP Server:
  1. Run the command line as the root user.
  2. Run the following command to stop the HTTP Server:
    sbin/apachectl stop

4.7. Solaris Directory Structure

The following is the default directory layout after a successful installation:
.
|- /opt/jboss-ews-2.1/
  |- bin
  |- etc
  |- lib
  |- lib64 (present only for x86_64 systems platforms)
  |- sbin
  |- share
    |- apache-tomcat-6.0.41
    |- apache-tomcat-7.0.54
    |- tomcat6
    |- tomcat7
    |- doc
    |- extras
    |- java
  |- var
  |- JBossEULA.txt
  |- LICENSE.txt

The Solaris directory structure is different to the Red Hat Enterprise Linux structure. This is because:
  • Native Solaris packages require the absolute location
  • Solaris (and other non-Red Hat Enterprise Linux platforms) must ship and build all the dependent components such as openldap, openssl, db4 and cyrus-sasl.

Chapter 5. Hibernate on Enterprise Web Server

Hibernate is an object-relational mapping framework. It is packaged independently from JBoss Enterprise Web Server. This packaged version is used on all supported platforms.
Hibernate is used in the same way it is used in a regular Tomcat installation: the Hibernate JAR files are added into a deployment WAR file. Tomcat provides a default connection pooling mechanism. The pooling mechnism is defined in the context.xml. However, persistence.xml and web.xml are required. The example below shows a setting with tomcat connection pooling mechanism.
  • /META-INF/context.xml defines the connection pools Tomcat should create.

    Example 5.1. context.xml

    <Context>
      <Resource
        name="jdbc/DsWebAppDB"
        auth="Container"
        type="javax.sql.DataSource"
        username="sa"
        password=""
        driverClassName="org.h2.Driver"
        url="jdbc:h2:mem:target/test/db/h2/hibernate 
        maxActive="8"
        maxIdle="4"/>
    </Context>
    
  • /WEB-INF/classes/META-INF/persistence.xml is a JPA configuration file. It defines how the application configures Hibernate to consume connections from the Tomcat pool. If you are using Hibernate API directly, use a similar configuration in hibernate.cfg.xml.

    Example 5.2. persistence.xml

    <persistence version="1.0"
      xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    
      <persistence-unit name="dswebapp">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <properties>
          <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
          <property name="hibernate.connection.datasource" value="java:comp/env/jdbc/DsWebAppDB"/>
        </properties>
      </persistence-unit>
    </persistence>
    
  • /WEB-INF/web.xml is a regular web application deployment file, which tells Tomcat which datasource it consumes. In Example 5.3, “web.xml” the datasource is jdbc/DsWebAppDB.

    Example 5.3. web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    
     <resource-env-ref>
      <resource-env-ref-name>jdbc/DsWebAppDB</resource-env-ref-name>
      <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
     </resource-env-ref>
    </web-app>
    
For details, refer to the Hibernate documentation for JBoss Enterprise Web Server.

Chapter 6. Monitoring Enterprise Web Server with JBoss Operations Network

Complete this task to download the JBoss Operations Network (JON) plugin for JBoss Enterprise Web Server from the Red Hat Customer Portal.

Procedure 6.1. Download Installation Files

  1. Open http://access.redhat.com in a web browser.
  2. Click Downloads in the menu across the top of the page.
  3. Click Downloads in the list under JBoss Enterprise Middleware.
  4. Enter your login information.
    You are taken to the Software Downloads page.
  5. Download the JBoss Operations Network Plugin

    If you intend to use the JBoss Operations Network plugin for JBoss Enterprise Web Server, select JBoss ON for EWS from either the Software Downloads drop-down box, or the menu on the left.
    1. Click the JBoss Operations Network VERSION Base Distribution download link.
    2. Click the Download link to start the Base Distribution download.
    3. Repeat the steps to download the EWS Plugin Pack for JBoss ON VERSION
To allow JBoss Operations Network to monitor JBoss Enterprise Web Server, you need to configure the server to allow the JBoss ON discovery and give JBoss ON the needed access.

Procedure 6.2. Configuring User Permissions on a Unix Operating System

Note

For Windows, skip these steps and proceed to Procedure 6.3, “Configuring Monitoring”.
RHQ/JON agent needs read and write permission to the httpd and Tomcat directories.
To assign the permissions:
  • As a user with root privileges, run the following command to add the user, under which JON Agent runs to the tomcat and apache user groups:
    # usermod -aG tomcat,apache <RHQ_AGENT_USER>

Procedure 6.3. Configuring Monitoring

JBoss Enterprise Web Servers are auto-discovered on Linux and Unix platforms. However, you need to configure the instance's JMX to allow proper handling of authentication and accurate Tomcat monitoring.
To set up JMX to handle authentication:
  1. Open the startup file of the respective JBoss Enterprise Web Server instance for editing:
    • on Red Hat Enterprise Linux installed from a ZIP file open /opt/jboss-ews-2.1/tomcat<VERSION>/bin/startup.sh
    • on Red Hat Enterprise Linux installed from a RPM files open /usr/sbin/tomcat<VERSION>
    • on Solaris open /opt/jboss-ews-2.1/tomcat<VERSION>/bin/startup.sh
    • on Windows open C:\Program Files\jboss-ews-2.1\share\tomcat<VERSION>\bin\startup.bat.
    • on Red Hat Enterprise Linux and on Solaris when running by daemon.sh open /opt/jboss-ews-2.1/tomcat<VERSION>/bin/setenv.sh
  2. Define an available port for JMX monitoring. Ensure the port is not blocked by any firewall. To ensure the port is not blocked, in the startup file, add the following line and substitute PORT_NUMBER with the number of the port dedicated to monitoring to the JAVA_OPTS variable:
    • on Red Hat Enterprise Linux and Solaris:
      JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=PORT_NUMBER -Djava.rmi.server.hostname=IP_ADDRESS"
      
    • on Windows:
      set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=PORT_NUMBER -Djava.rmi.server.hostname=IP_ADDRESS"
      
  3. If you want to disable authentication and SSL for development purposes, add the following lines to the JAVA_OPTS variable in the startup file:
    JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
    JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
    

    Important

    In production environments, add the following lines to the JAVA_OPTS variable in the startup file to secure JMX with SSL and restrict the access with a firewall:
    on Red Hat Enterprise Linux and Solaris
    JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.access.file=/opt/jboss-ews-2.1/jmxremote.access"
    JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file=/opt/jboss-ews-2.1/jmxremote.password"
    
    on Windows:
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.access.file=C:\Program Files\jboss-ews-2.1\jmxremote.access"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file=C:\Program Files\jboss-ews-2.1\jmxremote.password"
    
  4. Once the Tomcat server resource is discovered and imported into JBoss Operations Network inventory, it may be necessary to update the new resource's connection settings.
    1. Click Connection Settings in the JBoss Operations Network interface for the newly imported Tomcat Server resource.
    2. Verify the value of the Manager URL property to the RMI URL at which uses the correct JMX host name and port number as defined in the Tomcat server startup file. An example for this value is as follows:
      service:jmx:rmi:///jndi/rmi://$IP_ADDRESS:$PORT/jmxrmi

Procedure 6.4. To configure JON monitoring for managing JBoss Enterprise Web Server Tomcat installed from RPMs:

  1. On the shell prompt become the root user.
  2. Set up JMX JAVA_OPTS properties in the /usr/sbin/tomcat<VERSION> file in the start and start-security sections.
    if [ "$1" = "start" ]; then
    JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=8100 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxr
    emote.access.file="/etc/tomcat<VERSION>/jmxremote.access" -Dcom.sun.management.jmxremote.password.file="/etc/tomcat<VERSION>/jmxremote.password""
    
      ${JAVACMD} $JAVA_OPTS $LOGGING_CONFIG $CATALINA_OPTS \
        -classpath "$CLASSPATH" \
        -Dcatalina.base="$CATALINA_BASE" \
        -Dcatalina.home="$CATALINA_HOME" \
        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
        org.apache.catalina.startup.Bootstrap start \
         >> ${CATALINA_BASE}/logs/catalina.out 2>&1 & 
        if [ ! -z "$CATALINA_PID" ]; then
          echo $! > $CATALINA_PID
        fi
    elif [ "$1" = "start-security" ]; then
    JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=8100 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxr
    emote.access.file="/etc/tomcat<VERSION>/jmxremote.access" -Dcom.sun.management.jmxremote.password.file="/etc/tomcat<VERSION>/jmxremote.password""
    
      ${JAVACMD} $JAVA_OPTS $LOGGING_CONFIG $CATALINA_OPTS \
        -classpath "$CLASSPATH" \
        -Dcatalina.base="$CATALINA_BASE" \
    
  3. Set tomcat to run as root user in the /etc/tomcat<VERSION>/tomcat<VERSION>.conf file.
    TOMCAT_USER="root"
  4. On the shell prompt, run the following command to start tomcat.
    service tomcat<VERSION> start
  5. Start the JON agent.
  6. From the JBoss Operations Network Web UI, import JON agent and tomcat to JON.
  7. On the JBoss Operations Network Web UI, setup Tomcat connection configuration (principal and credentials).
  8. On the JBoss Operations Network Web UI, setup Tomcat Control method configuration to RPM System V init script.

    Note

    Start and Shutdown script may not be set because Tomcat plugin always runs service tomcat<VERSION> start/stop command for RPM System V init script configuration setting.

Procedure 6.5. JBoss Operations Network managing Tomcat installed as Windows service

  1. Install Tomcat as Windows service using the following command.
    jboss-ews-2.1\share\tomcat6\bin\service.bat install
  2. Create jmxremote.access file with controlRole readwrite in the C:\jmx directory.
  3. Create jmxremote.password file with controlRole pwd in the C:\jmx directory.

    Note

    Set owner of jmxremote.access and jmxremote.password to SYSTEM and restrict access of jmxremote.password file only to user SYSTEM. The user SYSTEM must have only read access.
  4. Enable JMX for Tomcat windows service.
    jboss-ews-2.1\sbin\tomcat6.exe //US//Tomcat6 ++JvmOptions="-Dcom.sun.management.jmxremote.port=8100;-Dcom.sun.management.jmxremote.access.file="C:\jmx\jmxremote.access";-Dcom.sun.management.jmxremote.password.file="C:\jmx\jmxremote.password";-Dcom.sun.management.jmxremote.ssl=false;-Dcom.sun.management.jmxremote.authenticate=true"
  5. Start Tomcat win service by Windows services application

    Note

    See the tomcat logs in logs directory to check if Tomcat win service has started.
  6. Install and configure JON agent. Type discovery in agent prompt to discover Tomcat windows service.
  7. On the JBoss Operations Network Web UI, click Inventory and then, click Discovery Queue to select import Tomcat and RHQ agent.
  8. On the JBoss Operations Network Web UI, go to platforms and search the agent name. Click on your agent.
  9. On the Agent page, Tomcat Servers are listed.
  10. Select your Tomcat server by clicking it.
  11. On the JBoss Operations Network Web UI, click on the Inventory tab and then configure the Tomcat Server in the Connection settings.
  12. Enter the Principal and Credentials information. use the controlRole and password set in jmxremote files.
  13. Set Control Method to RPM System V init script.

    Note

    You can not set Start and Shutdown Script fields.
  14. Click Save.
  15. Update the connection settings of Tomcat Server JVM and set Principal and Credentials.

Appendix A. Supported HTTP Modules

  • core_module (static)
  • mpm_prefork_module (static)
  • http_module (static)
  • so_module (static)
  • auth_basic_module (shared)
  • auth_digest_module (shared)
  • authn_file_module (shared)
  • authn_alias_module (shared)
  • authn_anon_module (shared)
  • authn_dbm_module (shared)
  • authn_default_module (shared)
  • authz_host_module (shared)
  • authz_user_module (shared)
  • authz_owner_module (shared)
  • authz_groupfile_module (shared)
  • authz_dbm_module (shared)
  • authz_default_module (shared)
  • ldap_module (shared)
  • authnz_ldap_module (shared)
  • include_module (shared)
  • log_config_module (shared)
  • logio_module (shared)
  • env_module (shared)
  • ext_filter_module (shared)
  • mime_magic_module (shared)
  • mime_magic_module (shared)
  • expires_module (shared)
  • deflate_module (shared)
  • headers_module (shared)
  • usertrack_module (shared)
  • setenvif_module (shared)
  • mime_module (shared)
  • dav_module (shared)
  • status_module (shared)
  • autoindex_module (shared)
  • info_module (shared)
  • dav_fs_module (shared)
  • negotiation_module (shared)
  • dir_module (shared)
  • actions_module (shared)
  • speling_module (shared)
  • userdir_module (shared)
  • alias_module (shared)
  • rewrite_module (shared)
  • proxy_module (shared)
  • proxy_ftp_module (shared)
  • proxy_http_module (shared)
  • proxy_connect_module (shared)
  • cache_module (shared)
  • suexec_module (shared)
  • disk_cache_module (shared)
  • cgi_module (shared)
  • auth_kerb_module (shared)
  • proxy_cluster_module (shared)
  • slotmem_module (shared)
  • manager_module (shared)
  • advertise_module (shared)
  • rt_module (shared)
  • snmpcommon_module (shared)
  • snmpagt_module (shared)
  • proxy_ajp_module (shared)
  • ssl_module (shared)

Appendix B. Revision History

Revision History
Revision 2.1.0-7Wed May 13 2015Lucas Costi
BZ-1220969 - Backported log4j instruction fix from JBoss Web Server 3 Installation Guide.
Revision 2.1.0-6.1Wed Feb 11 2015Lucas Costi
Updated the Product Name to reflect the new name grouping for the product. No update was made to details in the guide.
Revision 2.1.0-6Tue Oct 07 2014Misha Husnain Ali
BZ-1106921: Updated document abstract.
BZ-1113813: Added a package to requirements.
BZ-1140062: Removed section that is not relevant to ZIP installation.
Revision 2.1.0-5Tue Aug 19 2014Mandar Joshi
Updates for release.
Revision 2.1.0-3Tue Aug 05 2014Mandar Joshi
BZ-1126811: Updated hibernate4 package names.
BZ-1127803: Updated package name.
BZ-1127812: Removed an unnecessary topic.
BZ-1127798: Removed unnecessary admonition.
BZ-1127810: Replaced command.
BZ-1127819: Removed unnecessary information.
BZ-1127828: Updated code.
Revision 2.1.0-2Mon Jul 14 2014Mandar Joshi
BZ-1100782: Added apr-util-ldap is required only for LDAP authentication.
BZ-900824: Added a note for mod_auth_kerb package is not supported on the Windows.
BZ-1069899: Added topics under "Configuring for management and monitoring using the management plug-in for Red Hat JBoss Operation Network."
BZ-1056886: Updated the incorrect stem sentence for the procedure "Procedure 3.7. Installing HTTP".
BZ-1115956: Ensured that we have consistent style in the docs
Revision 2.1.0-1Fri Jul 11 2014Mandar Joshi
BZ-1115148: Implemented the feedback.

Legal Notice

Copyright © 2015 Red Hat, Inc.
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.