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
- 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.
- Run the JDK installation file.
Open
/usr
at a shell prompt, and run the following command to display the current Java symbolic link:ls -lad java
Remove the link:
rm java
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.
- Open a browser and log in to the Red Hat Customer Portal.
- Click Downloads.
- Click Red Hat JBoss Web Server in the Product Downloads list.
- Select the correct JBoss Web Server version from the Version drop-down menu.
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
).
-
The Red Hat JBoss Web Server 5.0 Application Server (
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
-
Open a shell prompt, and change directory to
JWS_HOME/tomcat/
. 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.
-
Sets the
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:
- To add JBoss Web Server 5.0 to SysV, see: Enabling JBoss Web Server 5.0 management using SysV on Solaris
- To review basic management commands for JBoss Web Server on SysV, see: Managing the JBoss Web Server using SysV
For SMF users:
- To add JBoss Web Server 5.0 to the SMF, see: Enabling JBoss Web Server 5.0 management using the Solaris Service Management Facility (SMF)
- To review basic management commands for JBoss Web Server on SysV, see: Managing the JBoss Web Server using the Service Management Facility (SMF)
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
-
On a command line, change to the
JWS_HOME/tomcat/
directory. 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
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.
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
-
On a command line, change to the
JWS_HOME/tomcat/
directory. 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
- For information on the Oracle Solaris Service Management Facility (SMF), see: Oracle: Introducing the Basics of Service Management Facility (SMF) on Oracle Solaris 11.
- For information on the basic usage of the SMF, see: Oracle Solaris Administration: Common Tasks - Managing SMF Services.
-
For information on using the
svcbundle
command to migrate control scripts to the SMF, see: Oracle: Developing System Services in Oracle® Solaris 11.3 - Converting a Run Control Script to an SMF Service.
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
- For information on the Oracle Solaris Service Management Facility (SMF), see: Oracle: Introducing the Basics of Service Management Facility (SMF) on Oracle Solaris 11.
- For information on the basic usage of the SMF, see: Oracle Solaris Administration: Common Tasks - Managing SMF Services.
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
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