Chapter 4. Installing JBoss Web Server on Solaris


4.1. Installing a Java Development Kit (JDK)

Before installing JBoss Web Server on Solaris, you must first install a supported Java Development Kit (JDK).

For a list of supported configurations, see the Red Hat Customer Portal article: JBoss Web Server 5 Supported Configurations.

Installing a Java Development Kit (JDK)

Install the Oracle JDK on a command line as the root user:

# pkg install jdk-<version>

Where <version> is the version of the JDK to install, such as jdk-8

Alternative: Download and Install a Java Development Kit on Solaris

  1. Download the Oracle JDK for your operating system and architecture. You can download the JDK installation file from the Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html.
  2. Run the JDK installation file.
  3. Open /usr at a shell prompt, and run the following command to display the current Java symbolic link:

    ls -lad java
  4. Remove the link:

    rm java
  5. Create a new Java symbolic link to the newly installed JDK:

    ln -sf /usr/jdk/<JDK>

4.2. Downloading and Extracting JBoss Web Server

To install JBoss Web Server, download and extract the installation ZIP files.

  1. Open a browser and log in to the Red Hat Customer Portal.
  2. Click Downloads.
  3. Click Red Hat JBoss Web Server in the Product Downloads list.
  4. Select the correct JBoss Web Server version from the Version drop-down menu.
  5. Click Download for each of the following files, ensuring that you select the correct platform and architecture for your system:

    • The Red Hat JBoss Web Server 5.0 Application Server (jws-application-servers-5.0.0.zip).
    • The Red Hat JBoss Web Server 5.0 Native Components for Solaris (jws-application-servers-5.0.0-<platform>-<architecture>.zip).
  6. Unzip the downloaded ZIP files to your installation directory.

    For example:

    # unzip jws-application-server-5.0.0.zip -d /opt/
    # unzip -o jws-application-server-5.0.0-<platform>-<architecture>.zip -d /opt/

The directory created by extracting the ZIP archives is the top-level directory for JBoss Web Server. This is referred to as JWS_HOME.

4.3. Configuring the JBoss Web Server Installation

Some configuration is required before running JBoss Web Server. This section includes the following configuration procedures:

Running the Post-Installation Scripts

  1. Open a shell prompt, and change directory to JWS_HOME/tomcat/.
  2. As the root user, run the post-installation scripts:

    # sh .postinstall.tomcat

    The post-installation script:

    • Sets the JAVA_HOME environment variable.
    • Creates the tomcat user.
    • Creates the tomcat user group.

4.4. Managing JBoss Web Server on Solaris using a system daemon

Managing a JBoss Web Server with a system daemon allows the web server to restart automatically after a reboot or power outage without user intervention. The system daemon also ensures that the JBoss Web Server is running as the tomcat user and provides some basic logging.

SysV and the Service Management Facility (SMF) are the two system daemons found on Solaris.

For SysV users:

For SMF users:

4.4.1. Enabling JBoss Web Server 5.0 management using SysV on Solaris

Using the JBoss Web Server with SysV provides start, stop and status check functions for the tomcat service. This procedure shows how to add JBoss Web Server 5.0 to SysV.

Prerequisites
  • Root user access.
  • The Red Hat JBoss Web Server 5.0 installed on Oracle Solaris.
  • SysV is the default system daemon.
  • The postinstall script (.postinstall.tomcat) has been executed as the root user.
Procedure
  1. On a command line, change to the JWS_HOME/tomcat/ directory.
  2. Copy the control script from the JWS_HOME/tomcat/services directory to /etc/init.d/:

    # cp services/jws5-tomcat.init /etc/init.d/jws5-tomcat
  3. Issue the following command to set the control script as executable:

    # chmod +x /etc/init.d/jws5-tomcat
Results

The JBoss Web Server 5.0 instance of tomcat should now be present in SysV. For example:

$ service jws5-tomcat status

jws5-tomcat is stopped
Next Steps

For information on the basic commands for controlling JBoss Web Server 5.0 using SysV, see: Section 4.4.2, “Managing the JBoss Web Server using SysV”.

Additional Resources

For information on using SysV, see: Red Hat Enterprise Linux 6 Deployment Guide: Running Services

4.4.2. Managing the JBoss Web Server using SysV

SysV commands can only be issued by the root user.

  • To enable the JBoss Web Server services to start at boot using SysV:

    # chkconfig jws5-tomcat on
  • To start the JBoss Web Server using SysV:

    # service jws5-tomcat start
  • To stop the JBoss Web Server using SysV:

    # service jws5-tomcat stop
  • To verify the status of the JBoss Web Server using SysV (the status operation can be executed by any user):

    $ service jws5-tomcat status

For information on using SysV, see: Red Hat Enterprise Linux 6 Deployment Guide: Running Services

4.4.3. Enabling JBoss Web Server 5.0 management using the Solaris Service Management Facility (SMF)

Using the JBoss Web Server with Service Management Facility (SMF) provides start, stop and status check functions for the tomcat service. This procedure shows how to add JBoss Web Server 5.0 to the SMF.

Note

The service runlevel of 3 in the following procedure is a recommended value. For more information on Solaris runlevels, see: Oracle Solaris Administration: Common Tasks - Run Levels

Prerequisites
  • Root user access.
  • The Red Hat JBoss Web Server 5.0 installed on Oracle Solaris 10 or newer.
  • The Oracle Solaris Service Management Facility (SMF) is the default system daemon.
  • The postinstall script (.postinstall.tomcat) has been executed as the root user.
Procedure
  1. On a command line, change to the JWS_HOME/tomcat/ directory.
  2. As the root user, import the control script into the SMF using the svcbundle command:

    # svcbundle -i -s rc-script=JWS_HOME/tomcat/services/jws5-tomcat.init:3 -s service-name=jws5-tomcat
Results

The JBoss Web Server 5.0 instance of tomcat should now be present in the SMF. For example:

# svcs -l jws5-tomcat

fmri         svc:/jws5-tomcat:default
enabled      true
state        online
next_state   none
state_time   July 25, 2018 01:59:29 AM AEST
logfile      /var/svc/log/jws5-tomcat:default.log
restarter    svc:/system/svc/restarter:default
manifest     /lib/svc/manifest/site/jws5-tomcat.xml
dependency   require_all/none svc:/milestone/multi-user (online)
Next Steps

For information on the basic commands for controlling JBoss Web Server 5.0 using the SMF, see: Section 4.4.4, “Managing the JBoss Web Server using the Service Management Facility (SMF)”.

Additional Resources

4.4.4. Managing the JBoss Web Server using the Service Management Facility (SMF)

The Service Management Facility (SMF) is the default system daemon for Oracle Solaris 10 or higher.

SMF commands can only be issued by the root user.

  • To enable the JBoss Web Server services to start at boot using the SMF:

    # svcadm enable jws5-tomcat
  • To start the JBoss Web Server using the SMF:

    # svcadm enable -t jws5-tomcat
  • To stop the JBoss Web Server using the SMF:

    # svcadm disable -t jws5-tomcat
  • To verify the status of the JBoss Web Server using the SMF:

    $ svcs -l jws5-tomcat
Additional Resources

4.5. Manually managing JBoss Web Server on Solaris

To manually start or stop JBoss Web Server on Solaris using JSVC:

4.5.1. Starting JBoss Web Server

To start JBoss Web Server: as the root user, run the following command:

# sh JWS_HOME/tomcat/bin/daemon.sh start
Important

Although there are multiple methods of starting Tomcat, it is recommended that you use the daemon.sh script. To start Tomcat as a service using Jsvc, see the Jsvc chapter.

4.5.2. Stopping JBoss Web Server

To stop JBoss Web Server: as the root user, run the following command:

# sh JWS_HOME/tomcat/bin/daemon.sh stop
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.