-
Language:
English
-
Language:
English
Red Hat Training
A Red Hat training course is available for Red Hat JBoss Web Server
2.2. ZIP Installation
Ensure that all the required prerequisite packages are installed before installing Red Hat JBoss Web Server. See Section 2.1.2, “Red Hat Enterprise Linux Package Prerequisites”.
2.2.1. Download and Extract JBoss Web Server
To install Red Hat JBoss Web Server, download and extract the installation ZIP files.
Procedure 2.4. Downloading JBoss Web Server
- Open a browser and log in to the Customer Portal at http://access.redhat.com.
- 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:
- Red Hat JBoss Web Server 3.0 Application Server (
jws-application-servers-3.0.0-<platform>-<architecture>.zip
) - Red Hat JBoss Web Server 3.0 Apache HTTP Server (
jws-httpd-3.0.0-<platform>-<architecture>.zip
)
Procedure 2.5. Extract JBoss Web Server
- Unzip the downloaded ZIP files to your installation directory.
Note
We recommend that you install JBoss Web Server in the/opt/
directory.
The directory created by extracting the ZIP archives is the top-level directory for JBoss Web Server. This is referred to as JWS_HOME.
2.2.2. Configuring the JBoss Web Server Installation
Some configuration is required before running Red Hat JBoss Web Server. This section includes the following configuration procedures:
- Creating Tomcat and Apache users for simple and secure user management: Procedure 2.7, “Creating a Tomcat User” and Procedure 2.8, “Creating an Apache User”.
Procedure 2.6. Setting the JAVA_HOME
Environment Variable
You must set the
JAVA_HOME
environment variable for Tomcat before running JBoss Web Server.
- In the
bin
directory of Tomcat (eitherJWS_HOME/tomcat7/bin
orJWS_HOME/tomcat8/bin
), create a file namedsetenv.sh
, and insert theJAVA_HOME
path definition.For example:export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
Procedure 2.7. Creating a Tomcat User
Follow this procedure to create the
tomcat
user and its parent group:
- In a shell prompt as the root user, change directory to
JWS_HOME
. - Run the following command to create the
tomcat
user group:# groupadd -g 91 -r tomcat
- Run the following command to create the
tomcat
user in thetomcat
user group:# useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r tomcat
- From
JWS_HOME
, run the following command to assign the ownership of the Tomcat directories to thetomcat
user to allow the user to run the Tomcat service:# chown -R tomcat:tomcat tomcat<VERSION>
Replace <VERSION> with the respective Tomcat version number (7
or8
).You can usels -l
to verify that thetomcat
user is the owner of the directory. - Ensure that the
tomcat
user has execute permissions to all parent directories. For example:# chmod -R u+X tomcat<VERSION>
Procedure 2.8. Creating an Apache User
Follow this procedure to create the
apache
user and its parent group:
- In a shell prompt as the root user, change directory to
JWS_HOME
. - Run the following command to create the
apache
user group:# groupadd -g 48 -r apache
- Run the following command to create the
apache
user in theapache
user group:# useradd -c "Apache" -u 48 -g apache -s /bin/sh -r apache
- From
JWS_HOME
, run the following command to assign the ownership of the Apache directories to theapache
user to allow the user to runhttpd
:# chown -R apache:apache httpd
You can usels -l
to verify that theapache
user is the owner of the directory.
Procedure 2.9. Removing/Re-Adding SSL Support
JBoss Web Server supports SSL by default, but it can be removed. Follow this procedure to remove or re-add SSL support.
- Go to the
JWS_HOME/httpd/conf.d/
directory and rename the SSL configuration file:- To remove SSL, rename
ssl.conf
tossl.conf.disabled
. - To re-add SSL, rename
ssl.conf.disabled
tossl.conf
.
Procedure 2.10. Enabling log4j Logging for Tomcat
If required, follow this procedure to add log4j logging to Tomcat.
- Open a shell prompt and change directory to
JWS_HOME/extras/
. - Copy the
log4j-eap6.jar
,log4j.properties
, andtomcat-juli-adapters.jar
files to thelib
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 (7
or8
). - Replace
tomcat-juli.jar
file in your Tomcatbin
directory with thetomcat-juli.jar
file fromJWS_HOME/extras/
:# cp tomcat-juli.jar ../tomcat<VERSION>/bin/
Procedure 2.11. Configuring mod_jk
If required, you can configure Apache HTTP Server to use mod_jk as its load balancer.
The steps below list the locations of the mod_jk configuration files. For detailed mod_jk configuration instructions, see the Configure Load Balancing Using Apache HTTP Server and mod_jk section of the HTTP Connectors and Load Balancing Guide.
Note
Sample configuration files are provided for mod_jk, and are located in
JWS_HOME/httpd/conf.d/
. The sample configuration files are: mod_jk.conf.sample
, workers.properties.sample
, and uriworkermap.properties.sample
. To use these samples instead of creating your own configuration files, remove the .sample
extension, and modify their content as needed.
- In
JWS_HOME/httpd/conf.d/
, create a file namedworkers.properties
.This file should contain the available workers (JBoss instances). - In
JWS_HOME/httpd/conf.d/
, create a file namedmod_jk.conf
.This file contains general mod_jk configuration. - In
JWS_HOME/httpd/conf.d/
, create a file nameduriworkermap.properties
.This file contains request mapping rules that map requests to workers.
Procedure 2.12. Configuring mod_cluster
- mod_cluster can be configured in
JWS_HOME/httpd/conf.d/mod_cluster.conf
.For more information about customizing mod_cluster, see the mod_cluster Connector section of the HTTP Connectors and Load Balancing Guide.
Procedure 2.13. Running the Apache HTTP Server Post-Installation Script
- In a shell prompt as the root user, change directory to
JWS_HOME/httpd
. - Run the following command:
# ./.postinstall
2.2.3. Starting JBoss Web Server
To start Red Hat JBoss Web Server, you must start the following:
- Tomcat (7 or 8).
- Apache HTTP Server.
Before starting Tomcat, ensure that the following prerequisites are met:
- The Tomcat user is created. See Procedure 2.7, “Creating a Tomcat User”.
- JAVA_HOME is set correctly. See Procedure 2.6, “Setting the
JAVA_HOME
Environment Variable”.
Procedure 2.14. Starting Tomcat
- Run the following command as the
tomcat
user with your respective Tomcat version (7
or8
):$ sh JWS_HOME/tomcat<VERSION>/bin/startup.sh
Important
Although there are multiple methods of starting Tomcat, it is recommended that you use thestartup.sh
script. To start Tomcat as a service using Jsvc, see Chapter 5, Using Jsvc to Start Tomcat.
Procedure 2.15. Starting Apache HTTP Server
- To start Apache HTTP Server (httpd), in a terminal as the root, change to
JWS_HOME/httpd/sbin/
and run the following command:# ./apachectl start
2.2.4. Stopping JBoss Web Server
To stop Red Hat JBoss Web Server, you must stop the following:
- Tomcat (7 or 8).
- Apache HTTP Server.
Procedure 2.16. Stopping Tomcat
- To stop Tomcat, run the following command as the root user with your respective Tomcat version (
7
or8
):# sh JWS_HOME/tomcat<VERSION>/bin/shutdown.sh
Procedure 2.17. Stopping Apache HTTP Server
- To stop Apache HTTP Server (httpd), in a shell prompt as the root user change to
JWS_HOME/httpd/sbin/
, and run the following command:# ./apachectl stop