JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Cluster Data Service for Apache Tomcat Guide     Oracle Solaris Cluster
search filter icon
search icon

Document Information

Preface

1.  Installing and Configuring Oracle Solaris Cluster HA for Apache Tomcat

Installing and Configuring Oracle Solaris Cluster HA for Apache Tomcat

Oracle Solaris Cluster HA for Apache Tomcat

Planning the Oracle Solaris Cluster HA for Apache Tomcat Installation and Configuration

Apache Tomcat and Solaris Containers

About Horizontal Scalability

Oracle Solaris Cluster HA for Apache Tomcat as a scalable configuration

Oracle Solaris Cluster HA for Apache Tomcat as a multiple master configuration

Configuration Restrictions

Restriction to deploy Oracle Solaris Cluster HA for Apache Tomcat in a scalable configuration

Restriction for the Load_balancing_policy

Restriction for Scalable Services and Solaris Containers

Restriction for the Apache Tomcat smf Service Name in a Failover Zone

Restriction for Apache Tomcat 5.5.28, 6.0.29, and 7.06

Configuration Requirements

Location of the Tomcat Home Directory for Scalable or Multiple Masters Configurations

Load Balancing for Multiple Master Configurations

Location of the Tomcat Home Directory for Failover Configurations

Location of the wget Command for Apache Tomcat 5.5.28, 6.0.29, and 7.06

Apache Tomcat Component Dependencies

Apache Tomcat Configuration and Registration Files

Installing and Configuring Apache Tomcat

How to Enable Apache Tomcat to run in a Global Zone Configuration

How to Install and Configure Apache Tomcat in the Global Zone

How to Enable Apache Tomcat to run in a Zone Configuration

How to Install and Configure Apache Tomcat in a Zone

How to Enable Apache Tomcat to run in Failover Zone Configuration

How to Install and Configure Apache Tomcat in a Failover Zone

Verifying the Installation and Configuration of Apache Tomcat

How to Verify the Installation and Configuration of Apache Tomcat

How to Deploy the Apache Tomcat Application

Installing the HA for Apache Tomcat Packages

How to Install the HA for Apache Tomcat Packages

Registering and Configuring Oracle Solaris Cluster HA for Apache Tomcat

How to Register and Configure Oracle Solaris Cluster HA for Apache Tomcat as a Failover Data Service

How to Register and Configure Oracle Solaris Cluster HA for Apache Tomcat as a Multiple Masters Data Service

How to Register and Configure Oracle Solaris Cluster HA for Apache Tomcat as a Scalable Data Service

Configuring Oracle Solaris Cluster HA for Apache Tomcat in Zones

Configuring Oracle Solaris Cluster HA for Apache Tomcat in a Failover Zone

How to Register Oracle Solaris Cluster HA for Apache Tomcat in a Failover Zone

How to Modify Parameters in the Oracle Solaris Cluster HA for Apache Tomcat Manifest

How to Remove a Oracle Solaris Cluster HA for Apache Tomcat Resource From a Failover Zone

Configuring Oracle Solaris Cluster HA for Apache Tomcat in a Zone

How to Register Oracle Solaris Cluster HA for Apache Tomcat in a Zone

Verifying the Oracle Solaris Cluster HA for Apache Tomcat Installation and Configuration

How to Verify the Oracle Solaris Cluster HA for Apache Tomcat Installation and Configuration

Understanding the Oracle Solaris Cluster Apache Tomcat HA Parameter File

Structure of the Apache Tomcat HA parameter file

Strategy to Choose the TestCmd and the ReturnString Variable

Understanding Oracle Solaris Cluster HA for Apache Tomcat Fault Monitor

Resource Properties

Probing Algorithm and Functionality

Debugging HA for Apache Tomcat

How to Activate Debugging for HA for Apache Tomcat

A.  Deployment Example: Installing Apache Tomcat in the Global Zone

B.  Deployment Example: Installing Apache Tomcat in a Failover Zone

C.  Deployment Example: Installing Apache Tomcat in a Non-Global Zone

Index

Installing and Configuring Apache Tomcat

This section contains the procedures you need to install and configure Apache Tomcat.


Note - For more information about Apache Tomcat, refer to the http://jakarta.apache.org web page.


Determine how Apache Tomcat will be deployed in Oracle Solaris Cluster:

To install and configure Apache Tomcat in a global zone configuration, complete the following tasks:

To install and configure Apache Tomcat in a zone configuration, complete the following tasks:

To install and configure Apache Tomcat in a failover zone configuration, complete the following tasks:

You will find installation examples for each zone type in:

How to Enable Apache Tomcat to run in a Global Zone Configuration

  1. Become superuser or assume a role that provides solaris.cluster.admin RBAC authorization on one of the nodes in the cluster that will host Apache Tomcat.
  2. Register the SUNW.gds and SUNW.HAStoragePlus resource type.
    # clresourcetype register  SUNW.gds SUNW.HAStoragePlus
  3. Create a failover resource group.

    Note - Perform this step only if you create a failover data service.


    # clresourcegroup create Apache Tomcat-failover-resource-group
  4. (Optional) Create a resource for the Apache Tomcat Disk Storage.

    Note - Perform this step only if you create a failover data service.


    # clresource create   \
    > -g Apache-Tomcat-failover-resource-group  \
    > -t SUNW.HAStoragePlus  \
    > -p FilesystemMountPoints=Apache Tomcat- instance-mount-points Apache-Tomcat-has-resource
  5. (Optional) Create a resource for the Apache Tomcat Logical Hostname.

    Note - Perform this step for a failover data service.


    # clreslogicalhostname   \
    > -g Apache Tomcat-failover-resource-group  \
    > -h Apache Tomcat-logical-hostname \
    > Apache Tomcat-lh-resource
  6. Enable the failover resource group that now includes the Apache Tomcat Disk Storage and Logical Hostname resources.

    Note - Perform this step for a failover data service.


    # clresourcegroup online -M -n current-node Apache Tomcat-failover-resource-group
  7. (Optional) Create the resource group for the multiple masters data service.

    Note - Perform this step only if you create a multiple masters data service.


    # clresourcegroup create  \
    > -p Maximum_primaries=2 \
    > -p Desired_primaries=2 \
    > Apache-Tomcat-Scalable-resource-group

    If you need more nodes, adjust Maximum_primaries and Desired_primaries to the appropriate value.

  8. (Optional) Create a resource for the Apache Tomcat Disk Storage if it is not in the root file system.

    Note - Perform this step only if you create a multiple masters data service.


    # clresource create   \
    > -g Apache-Tomcat-failover-resource-group  \
    > -t SUNW.HAStoragePlus  \
    > -p FilesystemMountPoints=Apache Tomcat- instance-mount-points Apache-Tomcat-has-resource
  9. Enable the failover resource group that now includes the Apache Tomcat Disk Storage and Logical Hostname resources.

    Note - Perform this step only if you create a multiple masters data service.


    # clresourcegroup online -M  Apache Tomcat-failover-resource-group
  10. Create a failover resource group for the SharedAddress resource.

    Note - Perform this step only if you create a scalable data service.


    # clresourcegroup create Apache-Tomcat-SharedAddress-resource-group
  11. Create the SharedAddress resource.

    Note - Perform this step only if you create a scalable data service.


    # clressharedaddress create   \
    > -g Apache-Tomcat-SharedAddress-resource-group\
    > -h Apache-Tomcat-SharedAddress-hostname \
    > Apache-Tomcat-SharedAddress-resource
  12. Online the SharedAddress resource group.

    Note - Perform this step only if you create a scalable data service.


    # clresourcegroup online -M  Apache-Tomcat-SharedAddress-resource-group
  13. Create the resource group for the scalable service.

    Note - Perform this step only if you create a scalable data service.


    # clresourcegroup create \
    > -p Maximum_primaries=2 \
    > -p Desired_primaries=2 \
    > -p RG_dependencies=Apache-Tomcat-SharedAddress-resource-group \
    > Apache-Tomcat-Scalable-resource-group

    If you need more nodes, adjust Maximum_primaries and Desired_primaries to the appropriate value.

  14. Create a resource for the Apache Tomcat Disk Storage if it is not in the root file system.

    Note - Perform this step only if you create a scalable data service.


    # clresource create Apache-Tomcat-has-resource  \
    > -g Apache-Tomcat-scalable-group   \
    > -t SUNW.HAStoragePlus  \
    > -p FilesystemMountPoints=Apache Tomcat- instance-mount-points
  15. Enable the failover resource group that now includes the Apache Tomcat Disk Storage and Logical Hostname resources.

    Note - Perform this step only if you create a scalable data service.


    # clresourcegroup online -M  Apache Tomcat-resource-group

How to Install and Configure Apache Tomcat in the Global Zone

  1. Determine how Apache Tomcat will be deployed in Oracle Solaris Cluster
    • Determine whether you will use Apache Tomcat as a failover a multiple master, or a scalable data service.

      For conceptual information on scalable and failover data services, see Oracle Solaris Cluster Concepts Guide.

    • Determine which user name will run Apache Tomcat.

    • Determine how many Apache Tomcat versions and instances will be deployed.

    • If more than one instance of a version will be deployed, determine whether they share the binaries.

    • Determine which Cluster File System will be used by each Apache Tomcat instance.

  2. Become superuser or assume a role that provides solaris.cluster.modify and solaris.cluster.admin RBAC authorizations.
  3. Create user and group if required.

    Caution

    Caution - In this scenario, the deployment of Tomcat group and user needs to occur on every node where Apache Tomcat is hosted.


    If Apache Tomcat is to run under a non root user, you have to create the appropriate user, and the appropriate group. For these tasks use the following commands.

    1. Create the group by running the following command:
      # groupadd —g 1000 tomcat
    2. Create the user by running the following command:
      # useradd —u 1000 —g 1000 —d /global/tomcat —s /bin/ksh tomcat
  4. If you are not logged in as root, switch to the appropriate user name.
    # su — user-name
  5. Install Apache Tomcat.

    If you deploy Apache Tomcat as a failover data service, install Apache Tomcat onto a shared file system within Oracle Solaris Cluster.

    It is recommended that you install Apache Tomcat onto shared disks. For a discussion of the advantages and disadvantages of installing the software on a local versus a cluster file system, see Determining the Location of the Application Binaries in Oracle Solaris Cluster Data Services Planning and Administration Guide.

    If you will deploy Apache Tomcat as a failover data service install the Apache Tomcat binaries on the shared storage on one node. If Apache Tomcat will be deployed as a scalable or a multiple master data service, install the Apache Tomcat binaries on the local storage on every node, that will host the Apache Tomcat data service.


    Note - Refer to http://tomcat.apache.org/index.html for instructions about installing Apache Tomcat.


    If you deploy Apache Tomcat as a scalable data service for a scalable or a multiple masters configuration, repeat the following step at every node that will host Apache Tomcat.

  6. Create the environment script.

    Create an Korn shell or a C shell script (dependent on the login-shell of your Apache Tomcat user name) to set the environment variables for Apache Tomcat. You must set the environment variables in a shell script and not in the users profile.

    With this mechanism you can install and run multiple Apache Tomcat versions and instances under one user name.


    Caution

    Caution - These shell scripts must be available on every node that can host the Apache Tomcat data service. For a failover configuration, store them on the shared storage of the node or in the target zone. For a scalable or a multiple masters configuration, store them on the local file system of every node or on the shared storage. These scripts must not be different on the various nodes.


Example 1-1 Korn shell script to set the environment variables for Apache Tomcat 3.x/3.3

# more env.ksh
#!/usr/bin/ksh
#
# Environment for Tomcat
#
JAVA_HOME=/usr/j2se
export JAVA_HOME
JAKARTA_HOME=/global/mnt1/jakarta-3.3
export JAKARTA_HOME
TOMCAT_HOME=$JAKARTA_HOME
export TOMCAT_HOME

Example 1-2 C shell script to set the environment variables for Apache Tomcat 3.3/3.3

# more env.csh
#!/usr/bin/csh
#
# Environment for Tomcat
#

setenv JAVA_HOME /usr/j2se
setenv JAKARTA_HOME /global/mnt1/jakarta-3.3
setenv TOMCAT_HOME $JAKARTA_HOME

Example 1-3 Korn shell script to set the environment variables for Apache Tomcat 4.1.x

# more env.ksh
#!/usr/bin/ksh
#
# Environment for Tomcat
#
JAVA_HOME=/usr/j2se
export JAVA_HOME
CATALINA_HOME=/global/mnt1/jakarta-tomcat-4.1.18
export CATALINA_HOME

Example 1-4 C shell script to set the environment variables for Apache Tomcat 4.1.x

# more env.csh
#!/usr/bin/csh
#
# Environment for Tomcat
#
setenv JAVA_HOME /usr/j2se
setenv CATALINA_HOME /global/mnt1/jakarta-tomcat-4.1.18

The environment variables are version and configuration dependent.

How to Enable Apache Tomcat to run in a Zone Configuration

  1. Become superuser or assume a role that provides solaris.cluster.admin RBAC authorization on one of the nodes in the cluster that will host Apache Tomcat.
  2. Create and boot your zone Apache Tomcat-zone on all the nodes to host your Apache Tomcat data base.
  3. Register the SUNW.gds and SUNW.HAStoragePlus resource type.
    # clresourcetype register  SUNW.gds SUNW.HAStoragePlus
  4. Create a failover resource group.

    Note - Perform this step only if you create a failover data service.


    # clresourcegroup create -n node1:Apache Tomcat-zone,node2:Apache Tomcat-zone \
    Apache Tomcat-failover-resource-group
  5. (Optional) Create a resource for the Apache Tomcat Disk Storage.

    Note - Perform this step only if you create a failover data service.


    # clresource create   \
    > -g Apache-Tomcat-failover-resource-group  \
    > -t SUNW.HAStoragePlus  \
    > -p FilesystemMountPoints=Apache Tomcat- instance-mount-points Apache-Tomcat-has-resource
  6. (Optional) Create a resource for the Apache Tomcat Logical Hostname.

    Note - Perform this step for a failover data service.


    # clreslogicalhostname   \
    > -g Apache Tomcat-failover-resource-group  \
    > -h Apache Tomcat-logical-hostname \
    > Apache Tomcat-lh-resource
  7. Enable the failover resource group that now includes the Apache Tomcat Disk Storage and Logical Hostname resources.

    Note - Perform this step for a failover data service.


    # clresourcegroup online -M -n current-node Apache Tomcat-failover-resource-group
  8. (Optional) Create the resource group for the multiple masters data service.

    Note - Perform this step only if you create a multiple masters data service.


    # clresourcegroup create  \
    >  -p Maximum_primaries=2 \
    >  -p Desired_primaries=2 \
    >  -n node1:Apache Tomcat-zone,node2:Apache Tomcat-zone\
    > Apache-Tomcat-Scalable-resource-group

    If you need more nodes, adjust Maximum_primaries and Desired_primaries to the appropriate value.

  9. (Optional) Create a resource for the Apache Tomcat Disk Storage if it is not in the root file system.

    Note - Perform this step only if you create a multiple masters data service.


    # clresource create   \
    > -g Apache-Tomcat-failover-resource-group  \
    > -t SUNW.HAStoragePlus  \
    > -p FilesystemMountPoints=Apache Tomcat- instance-mount-points Apache-Tomcat-has-resource
  10. Enable the failover resource group that now includes the Apache Tomcat Disk Storage and Logical Hostname resources.

    Note - Perform this step only if you create a multiple masters data service.


    # clresourcegroup online -M  Apache Tomcat-failover-resource-group
  11. Create a failover resource group for the SharedAddress resource.

    Note - Perform this step only if you create a scalable data service.


    # clresourcegroup create -n node1:Apache Tomcat-zone,node2:Apache Tomcat-zone\
    > Apache-Tomcat-SharedAddress-resource-group
  12. Create the SharedAddress resource.

    Note - Perform this step only if you create a scalable data service.


    # clressharedaddress create   \
    > -g Apache-Tomcat-SharedAddress-resource-group\
    > -h Apache-Tomcat-SharedAddress-hostname \
    > Apache-Tomcat-SharedAddress-resource
  13. Online the SharedAddress resource group.

    Note - Perform this step only if you create a scalable data service.


    # clresourcegroup online -M  Apache-Tomcat-SharedAddress-resource-group
  14. Create the resource group for the scalable service.

    Note - Perform this step only if you create a scalable data service.


    # clresourcegroup create \
     > -p Maximum_primaries=2 \
     > -p Desired_primaries=2 \
     > -p RG_dependencies=Apache-Tomcat-SharedAddress-resource-group \
    -n node1:Apache Tomcat-zone,node2:Apache Tomcat-zone\
    Apache-Tomcat-Scalable-resource-group

    If you need more nodes, adjust Maximum_primaries and Desired_primaries to the appropriate value.

  15. Create a resource for the Apache Tomcat Disk Storage if it is not in the root file system.

    Note - Perform this step only if you create a scalable data service.


    # clresource create Apache-Tomcat-has-resource  \
    > -g Apache-Tomcat-scalable-group   \
    > -t SUNW.HAStoragePlus  \
    > -p FilesystemMountPoints=Apache Tomcat- instance-mount-points
  16. Enable the failover resource group that now includes the Apache Tomcat Disk Storage and Logical Hostname resources.

    Note - Perform this step only if you create a scalable data service.


    # clresourcegroup online -M  Apache Tomcatscalable-resource-group

How to Install and Configure Apache Tomcat in a Zone

  1. Determine how Apache Tomcat will be deployed in Oracle Solaris Cluster
    • Determine whether you will use Apache Tomcat as a failover a multiple master, or a scalable data service.

      For conceptual information on scalable and failover data services, see Oracle Solaris Cluster Concepts Guide.

    • Determine which user name will run Apache Tomcat.

    • Determine how many Apache Tomcat versions and instances will be deployed.

    • If more than one instance of a version will be deployed, determine whether they share the binaries.

    • Determine which Cluster File System will be used by each Apache Tomcat instance.

  2. Become superuser or assume a role that provides solaris.cluster.modify and solaris.cluster.admin RBAC authorizations.
  3. Enter the target zone
    # zlogin tomcat-zone
  4. Create user and group if required.

    Caution

    Caution - In this scenario, the deployment of Tomcat applications needs to occur on every zone where Apache Tomcat is hosted.


    If Apache Tomcat is to run under a non root user, you have to create the appropriate user, and the appropriate group. For these tasks use the following commands.

    1. Create the group by running the following command:
      # groupadd —g 1000 tomcat
    2. Create the user by running the following command:
      # useradd —u 1000 —g 1000 —d /global/tomcat —s /bin/ksh tomcat
  5. If you are not logged in as root, switch to the appropriate user name.
    # su — user-name
  6. Install Apache Tomcat.

    If you deploy Apache Tomcat as a failover data service, install Apache Tomcat onto a shared file system within Oracle Solaris Cluster.

    It is recommended that you install Apache Tomcat onto shared disks. For a discussion of the advantages and disadvantages of installing the software on a local versus a cluster file system, see Determining the Location of the Application Binaries in Oracle Solaris Cluster Data Services Planning and Administration Guide.

    If you will deploy Apache Tomcat as a failover data service install the Apache Tomcat binaries on the shared storage on one zone. If Apache Tomcat will be deployed as a scalable or a multiple master data service, install the Apache Tomcat binaries on the local storage in every target zone, that will host the Apache Tomcat data service.


    Note - Refer to http://tomcat.apache.org/index.html for instructions about installing Apache Tomcat.


    If you deploy Apache Tomcat as a scalable data service for a scalable or a multiple masters configuration, repeat the following step at every target zone that will host Apache Tomcat.

  7. Create the environment script.

    Create an Korn shell or a C shell script (dependent on the login-shell of your Apache Tomcat user name) to set the environment variables for Apache Tomcat. You must set the environment variables in a shell script and not in the users profile.

    With this mechanism you can install and run multiple Apache Tomcat versions and instances under one user name.


    Caution

    Caution - These shell scripts must be available on every node that can host the Apache Tomcat data service. For a failover configuration, store them on the shared storage in the target zone. For a scalable or a multiple masters configuration, store them on the local file system or on the shared storage of every target zone. These scripts must not be different on the various zones.


Example 1-5 Korn shell script to set the environment variables for Apache Tomcat 3.x/3.3

# more env.ksh
#!/usr/bin/ksh
#
# Environment for Tomcat
#
JAVA_HOME=/usr/j2se
export JAVA_HOME
JAKARTA_HOME=/global/mnt1/jakarta-3.3
export JAKARTA_HOME
TOMCAT_HOME=$JAKARTA_HOME
export TOMCAT_HOME

Example 1-6 C shell script to set the environment variables for Apache Tomcat 3.3/3.3

# more env.csh
#!/usr/bin/csh
#
# Environment for Tomcat
#

setenv JAVA_HOME /usr/j2se
setenv JAKARTA_HOME /global/mnt1/jakarta-3.3
setenv TOMCAT_HOME $JAKARTA_HOME

Example 1-7 Korn shell script to set the environment variables for Apache Tomcat 4.1.x

# more env.ksh
#!/usr/bin/ksh
#
# Environment for Tomcat
#
JAVA_HOME=/usr/j2se
export JAVA_HOME
CATALINA_HOME=/global/mnt1/jakarta-tomcat-4.1.18
export CATALINA_HOME

Example 1-8 C shell script to set the environment variables for Apache Tomcat 4.1.x

# more env.csh
#!/usr/bin/csh
#
# Environment for Tomcat
#
setenv JAVA_HOME /usr/j2se
setenv CATALINA_HOME /global/mnt1/jakarta-tomcat-4.1.18

The environment variables are version and configuration dependent.

How to Enable Apache Tomcat to run in Failover Zone Configuration

  1. Become superuser or assume a role that provides solaris.cluster.admin RBAC authorization on one of the nodes in the cluster that will host Apache Tomcat.
  2. As superuser register the SUNW.HAStoragePlus and the SUNW.gds resource types.
    # clresourcetype register SUNW.HAStoragePlus SUNW.gds
  3. Create a failover resource group.
    # clresourcegroup create Apache Tomcat-resource-group
  4. Create a resource for the Apache Tomcat zone`s disk storage.
    # clresource create -t SUNW.HAStoragePlus \
    -p FileSystemMountPoints=Apache Tomcat-instance-mount-points \
    Apache Tomcat-has-resource
  5. (Optional) If you want the protection against a total adapter failure for your public network, create a resource for the Apache Tomcat`s logical hostname.
    # clreslogicalhostname create -g Apache Tomcat-resource-group \
    -h logical-hostname \
    Apache Tomcat-logical-hostname-resource-name
  6. Place the resource group in the managed state.
    # clresourcegroup online -M  Apache Tomcat-resource-group
  7. Install the zone.

    Install the zone according to the Oracle Solaris Cluster HA for Solaris Containers agent documentation, assuming that the resource name is Apache Tomcat-zone-rs and that the zone name is Apache Tomcat-zone.

  8. Verify the zone's installation.
    # zoneadm -z Apache Tomcat-zone boot
    # zoneadm -z Apache Tomcat-zone halt
  9. Register the zone's boot component.
    1. Copy the container resource boot component configuration file.
      # cp /opt/SUNWsczone/sczbt/util/sczbt_config zones-target-configuration-file
    2. Use a plain text editor to set the following variables:
      RS=Apache Tomcat-zone-rs
      RG=Apache Tomcat-resource-group
      PARAMETERDIR=Apache Tomcat-zone-parameter-directory
      SC_NETWORK=true|false
      SC_LH=Apache Tomcat-logical-hostname-resource-name
      FAILOVER=true|false
      HAS_RS=Apache Tomcat-has-resource
      Zonename=Apache Tomcat-zone
      Zonebootopt=zone-boot-options
      Milestone=zone-boot-milestone
      Mounts=
    3. Create the parameter directory for your zone's resource.
      # mkdir Apache Tomcat-zone-parameter-directory
    4. Execute the Oracle Solaris Cluster HA for Solaris Container's registration script.
      # /opt/SUNWsczone/sczbt/util/sczbt_register -f zones-target-configuration-file
    5. Enable the Solaris Container resource
      # clresource enable Apache Tomcat-zone-rs
  10. Enable the resource group.
    # clresourcegroup online  Apache Tomcat-resource-group

How to Install and Configure Apache Tomcat in a Failover Zone

  1. Determine how Apache Tomcat will be deployed in Oracle Solaris Cluster
    • Determine whether you will use Apache Tomcat as a failover a multiple master, or a scalable data service.

      For conceptual information on scalable and failover data services, see Oracle Solaris Cluster Concepts Guide.

    • Determine which user name will run Apache Tomcat.

    • Determine how many Apache Tomcat versions and instances will be deployed.

    • If more than one instance of a version will be deployed, determine whether they share the binaries.

    • Determine which Cluster File System will be used by each Apache Tomcat instance.

  2. Become superuser or assume a role that provides solaris.cluster.modify and solaris.cluster.admin RBAC authorizations.
  3. (Optional) If you deploy Apache Tomcat in a non global zone, enter the target zone
    # zlogin tomcat-zone
  4. Create user and group if required.

    If Apache Tomcat is to run under a non root user, you have to create the appropriate user, and the appropriate group. For these tasks use the following commands.

    1. Create the group by running the following command:
      # groupadd —g 1000 tomcat
    2. Create the user by running the following command:
      # useradd —u 1000 —g 1000 —d /global/tomcat —s /bin/ksh tomcat
  5. If you are not logged in as root, switch to the appropriate user name.
    # su — user-name
  6. Install Apache Tomcat.

    If you deploy Apache Tomcat as a failover data service, install Apache Tomcat onto a shared file system or in a failover zone within Oracle Solaris Cluster.

    It is recommended that you install Apache Tomcat onto shared disks. For a discussion of the advantages and disadvantages of installing the software on a local versus a cluster file system, see Determining the Location of the Application Binaries in Oracle Solaris Cluster Data Services Planning and Administration Guide.

    If you will deploy Apache Tomcat as a failover data service install the Apache Tomcat binaries on the shared storage on one node or in the failover zone. If Apache Tomcat will be deployed as a multiple master data service, install the Apache Tomcat binaries on the local storage in every target zone, that will host the Apache Tomcat data service.


    Note - Refer to http://tomcat.apache.org/index.html for instructions about installing Apache Tomcat.


    If you deploy Apache Tomcat as a multiple masters data service, repeat the following step at every node or target zone that will host Apache Tomcat.

  7. Create the environment script.

    Create an Korn shell or a C shell script (dependent on the login-shell of your Apache Tomcat user name) to set the environment variables for Apache Tomcat. You must set the environment variables in a shell script and not in the users profile.

    With this mechanism you can install and run multiple Apache Tomcat versions and instances under one user name.


    Caution

    Caution - These shell scripts must be available on every zone that can host the Apache Tomcat data service. For a failover configuration, store them on the shared storage of the node or in the target zone. For a multiple masters configuration, store them on the local file system or on the shared storage of the target zone. These scripts must not be different on the various zones. For an installation in afailover zone any place where the tomcat user has access is appropriate.


Example 1-9 Korn shell script to set the environment variables for Apache Tomcat 3.x/3.3

# more env.ksh
#!/usr/bin/ksh
#
# Environment for Tomcat
#
JAVA_HOME=/usr/j2se
export JAVA_HOME
JAKARTA_HOME=/global/mnt1/jakarta-3.3
export JAKARTA_HOME
TOMCAT_HOME=$JAKARTA_HOME
export TOMCAT_HOME

Example 1-10 C shell script to set the environment variables for Apache Tomcat 3.3/3.3

# more env.csh
#!/usr/bin/csh
#
# Environment for Tomcat
#

setenv JAVA_HOME /usr/j2se
setenv JAKARTA_HOME /global/mnt1/jakarta-3.3
setenv TOMCAT_HOME $JAKARTA_HOME

Example 1-11 Korn shell script to set the environment variables for Apache Tomcat 4.1.x

# more env.ksh
#!/usr/bin/ksh
#
# Environment for Tomcat
#
JAVA_HOME=/usr/j2se
export JAVA_HOME
CATALINA_HOME=/global/mnt1/jakarta-tomcat-4.1.18
export CATALINA_HOME

Example 1-12 C shell script to set the environment variables for Apache Tomcat 4.1.x

# more env.csh
#!/usr/bin/csh
#
# Environment for Tomcat
#
setenv JAVA_HOME /usr/j2se
setenv CATALINA_HOME /global/mnt1/jakarta-tomcat-4.1.18

The environment variables are version and configuration dependent.