此内容没有您所选择的语言版本。
Installation Guide
Install and Configure Red Hat JBoss Web Server 5.2
Abstract
Chapter 1. Introduction 复制链接链接已复制到粘贴板!
1.1. About Red Hat JBoss Web Server 复制链接链接已复制到粘贴板!
The JBoss Web Server is a fully integrated and certified set of components for hosting Java web applications. It consists of:
- Apache Tomcat: a servlet container in accordance with the Java Servlet Specification. JBoss Web Server contains Apache Tomcat 9.
- The Apache Tomcat Native Library: a Tomcat library, which improves Tomcat scalability, performance, and integration with native server technologies.
- The tomcat-vault: an extension for the JBoss Web Server used for securely storing passwords and other sensitive information used by a JBoss Web Server.
- The mod_cluster library: a library that allows communication between Apache Tomcat and the Apache HTTP Server’s mod_proxy_cluster module. This allows the Apache HTTP Server to be used as a load balancer for JBoss Web Server. For information on the configuration of mod_cluster, or for information on the installation and configuration of the alternative load balancers mod_jk and mod_proxy, see the HTTP Connectors and Load Balancing Guide.
- If you need clustering or session replication support for Java applications, Red Hat recommends that you use Red Hat JBoss Enterprise Application Platform (JBoss EAP).
| Component | Version |
|---|---|
| Apache CXF | 3.2.7 |
| Apache Tomcat 9 | 9.0.21 |
| ECJ | 4.12.0 |
| Hibernate | 5.3.10 |
| JBoss logging | 3.3.2 |
| libapr | 1.6.3 |
| mod_cluster | 1.4.1.Final |
| OpenSSL | 1.1.1 |
| Tomcat-Native | 1.2.21 |
| Tomcat-Vault | 1.1.8.Final |
This Installation Guide includes procedures for the installation, minor upgrade, and basic configuration of the Tomcat servers from JBoss Web Server on supported operating systems. Installation and configuration instructions for the Apache HTTP Server are covered in the JBoss Core Services Documentation.
1.2. Supported Operating Systems and Configurations 复制链接链接已复制到粘贴板!
| Operating System | Chipset Architecture | Java Virtual Machine |
|---|---|---|
| Red Hat Enterprise Linux 8 | x86_64 | Red Hat OpenJDK 1.8.x, Red Hat OpenJDK 11, OracleJDK 11 |
| Red Hat Enterprise Linux 7 | x86_64 | Red Hat OpenJDK 1.8.x, Red Hat OpenJDK 11, Oracle JDK 1.8.x, Oracle JDK 11, IBM JDK 1.8.x |
| Red Hat Enterpries Linux 6 | x86_64, x86 | Red Hat OpenJDK 1.8.x, Oracle JDK 1.8.x, Oracle JDK 11(x86_64 Only), IBM JDK 1.8.x |
| Microsoft Windows 2016 Server | x86_64 | Red Hat OpenJDK 1.8.x, Red Hat OpenJDK 11, Oracle JDK 1.8.x, Oracle JDK 11 |
| Microsoft Windows 2012 Server R2 | x86_64 | Red Hat OpenJDK 1.8.x, Red Hat OpenJDK 11, Oracle JDK 1.8.x, Oracle JDK 11 |
1.3. Installation Methods 复制链接链接已复制到粘贴板!
JBoss Web Server can be installed on supported Red Hat Enterprise Linux, and Microsoft Windows systems using ZIP installation files available for each platform. JBoss Web Server can also be installed on supported Red Hat Enterprise Linux systems using RPM packages.
For ZIP installations, below is a summary of the components that are included in the ZIP files which form the core part of a JBoss Web Server installation.
jws-5.2.0-application-server.zip- Tomcat 9
- mod_cluster
- tomcat-vault
jws-5.2.0-application-server-<platform>-<architecture>.zip- Platform-specific utilities
1.4. Component Documentation Bundle 复制链接链接已复制到粘贴板!
JBoss Web Server includes an additional documentation bundle that includes the original vendor documentation for each component. This documentation bundle, jws-docs-5.2.0.zip, is available at the Red Hat Customer Portal, and contains additional documentation for the following:
- tomcat
- tomcat-native
- tomcat-vault
You can install JBoss Web Server on Red Hat Enterprise Linux using one of two methods:
Regardless of which method you choose, you must first install a supported Java Development Kit (JDK).
2.1. Prerequisites 复制链接链接已复制到粘贴板!
2.1.1. Installing a Java Development Kit (JDK) 复制链接链接已复制到粘贴板!
Before installing JBoss Web Server, you must first install a supported Java Development Kit (JDK).
A full list of supported JDKs is given in section 1.2 of this document.
Installing a JDK using the YUM package manager
Subscribe your Red Hat Enterprise Linux system to the appropriate channel:
OpenJDK:
- rhel-6-server-rpms
- rhel-7-server-rpms
- rhel-8-server-rpms
IBM:
- rhel-6-server-supplementary-rpms
- rhel-7-server-supplementary-rpms
- rhel-8-server-supplementary-rpms
As the root user, execute the command to install a 1.8 JDK:
yum install java-1.8.0-<VENDOR>-devel
# yum install java-1.8.0-<VENDOR>-develCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<VENDOR>withibmoropenjdkRun the following commands as the root user to ensure the correct JDK is in use:
alternatives --config java
# alternatives --config javaCopy to Clipboard Copied! Toggle word wrap Toggle overflow alternatives --config javac
# alternatives --config javacCopy to Clipboard Copied! Toggle word wrap Toggle overflow These commands return lists of available JDK versions with the selected version marked with a plus (
+) sign. If the selected JDK is not the desired one, change to the desired JDK as instructed in the shell prompt.ImportantAll software that use the
javaandjavaccommands uses the JDK set byalternatives. Changing Java alternatives may impact on the running of other software.
Installing a JDK from a compressed archive (such as .zip or .tar)
If the JDK was downloaded from the vendor’s website (Oracle or OpenJDK), use the installation instructions provided by the vendor and set the JAVA_HOME environment variable.
If the JDK has was installed from a compressed archive, set the JAVA_HOME environment variable for Tomcat before running JBoss Web Server.
In the bin directory of Tomcat (JWS_HOME/tomcat/bin), create a file named setenv.sh, and insert the JAVA_HOME path definition.
For example:
cat JWS_HOME/tomcat/bin/setenv.sh export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64
$ cat JWS_HOME/tomcat/bin/setenv.sh
export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64
2.1.2. Red Hat Enterprise Linux Package Prerequisites 复制链接链接已复制到粘贴板!
Before installing JBoss Web Server on Red Hat Enterprise Linux, ensure the following prerequisites are met.
- A supported JDK is installed.
- Additionally, RHEL-8 users needing to run JSSE+OpenSSL or APR, you will need to use Tomcat-Native for it to work properly. The file for Tomcat-Native can be found in the native zip directory. To install OpenSSL and APR, run the following commands:
yum install openssl
# yum install openssl
yum install apr
# yum install apr
-
You must remove the
tomcatjsspackage before installing thetomcat-nativepackage. Thetomcatjsspackage uses an underlying NSS security model rather than the OpenSSL security model.
Removing the tomcatjss Package
As the root user, run the following command to remove
tomcatjss:yum remove tomcatjss
# yum remove tomcatjssCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2. ZIP Installation 复制链接链接已复制到粘贴板!
Ensure that all of the prerequisites are met before installing JBoss Web Server.
2.2.1. 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.2 Application Server (
jws-5.2.0-application-server.zip). -
The Red Hat JBoss Web Server 5.2 Native Components for RHEL (
jws-5.2.0-application-server-<platform>-<architecture>.zip).
-
The Red Hat JBoss Web Server 5.2 Application Server (
Unzip the downloaded ZIP files to your installation directory.
For example:
unzip jws-5.2.0-application-server.zip -d /opt/ unzip -o jws-5.2.0-application-server-<platform>-<architecture>.zip -d /opt/
# unzip jws-5.2.0-application-server.zip -d /opt/ # unzip -o jws-5.2.0-application-server-<platform>-<architecture>.zip -d /opt/Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The directory created by extracting the ZIP archives is the top-level directory for JBoss Web Server. This is referred to as JWS_HOME.
There are two supported methods for running and managing Red Hat JBoss Web Server on Red Hat Enterprise Linux:
The recommended method for managing the JBoss Web Server is using a system daemon.
Using the JBoss Web Server with a system daemon provides a method of starting the JBoss Web Server services at system boot. The system daemon also provides start, stop and status check functions.
The default system daemon for Red Hat Enterprise Linux 8 and Red Hat Enterprise Linux 7 is systemd and for Red Hat Enterprise Linux 6 the default is SysV.
To determine which system daemon is running, issue ps -p 1 -o comm=.
For systemd:
ps -p 1 -o comm=
$ ps -p 1 -o comm= systemdCopy to Clipboard Copied! Toggle word wrap Toggle overflow For SysV:
ps -p 1 -o comm=
$ ps -p 1 -o comm= initCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Prerequisites
-
The
redhat-lsb-corepackage. To install, run:yum install redhat-lsb-core
Setting up the JBoss Web Server for SysV
As the root user, execute the .postinstall.sysv script:
cd JWS_HOME/tomcat sh .postinstall.sysv
# cd JWS_HOME/tomcat
# sh .postinstall.sysv
Controlling the JBoss Web Server with 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
# chkconfig jws5-tomcat onCopy to Clipboard Copied! Toggle word wrap Toggle overflow To start the JBoss Web Server using SysV:
service jws5-tomcat start
# service jws5-tomcat startCopy to Clipboard Copied! Toggle word wrap Toggle overflow To stop the JBoss Web Server using SysV:
service jws5-tomcat stop
# service jws5-tomcat stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify the status of the JBoss Web Server using SysV (the
statusoperation can be executed by any user):service jws5-tomcat status
$ service jws5-tomcat statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information on using SysV, see: Red Hat Enterprise Linux 6 Deployment Guide: Running Services
Setting up the JBoss Web Server for systemd
As the root user, execute the .postinstall.systemd script:
cd JWS_HOME/tomcat sh .postinstall.systemd
# cd JWS_HOME/tomcat
# sh .postinstall.systemd
Controlling the JBoss Web Server with systemd
Systemd commands can only be issued by the root user.
To enable the JBoss Web Server services to start at boot using systemd:
systemctl enable jws5-tomcat.service
# systemctl enable jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To start the JBoss Web Server using systemd:
systemctl start jws5-tomcat.service
# systemctl start jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To stop the JBoss Web Server using systemd:
systemctl stop jws5-tomcat.service
# systemctl stop jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify the status of the JBoss Web Server using systemd (the
statusoperation can be executed by any user):systemctl status jws5-tomcat.service
# systemctl status jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information on using systemd on RHEL 7, see: RHEL 7 System Administrator’s Guide: Managing System Services
For more information on using systemd on RHEL 8, see: RHEL 8 System Administrator’s Guide: Managing System Services
2.2.2.2. Managing JBoss Web Server on a command line 复制链接链接已复制到粘贴板!
2.2.2.2.1. Configuring the JBoss Web Server Installation 复制链接链接已复制到粘贴板!
The following configuration steps are performed by the .postinstall.sysv script and the .postinstall.systemd script described in Managing JBoss Web Server using a system daemon for .zip installations on Red Hat Enterprise Linux
Some configuration is required before running JBoss Web Server. This section includes the following configuration procedures:
- Setting the JAVA_HOME Environment Variable.
- Creating the tomcat user for simple and secure user management: Creating a Tomcat User.
- Grant the tomcat user access to the JBoss Web Server by moving the ownership of tomcat directory to the tomcat user.
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 (JWS_HOME/tomcat/bin), create a file named setenv.sh, and insert the JAVA_HOME path definition.
For example: export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64
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
tomcatuser group:groupadd -g 53 -r tomcat
# groupadd -g 53 -r tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to create the
tomcatuser in thetomcatuser group:useradd -c "tomcat" -u 53 -g tomcat -s /bin/sh -r tomcat
# useradd -c "tomcat" -u 53 -g tomcat -s /bin/sh -r tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Move the ownership of tomcat directory to the tomcat user
From
JWS_HOME, run the following command to assign the ownership of the Tomcat directories to thetomcatuser to allow the user to run the Tomcat service:chown -R tomcat:tomcat tomcat/
# chown -R tomcat:tomcat tomcat/Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can use
ls -lto verify that thetomcatuser is the owner of the directory.Ensure that the
tomcatuser has execute permissions to all parent directories. For example:chmod -R u+X tomcat/
# chmod -R u+X tomcat/Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.2.2.2. Starting JBoss Web Server 复制链接链接已复制到粘贴板!
Run the following command as the tomcat user:
sh JWS_HOME/tomcat/bin/startup.sh
$ sh JWS_HOME/tomcat/bin/startup.sh
2.2.2.2.3. Stopping JBoss Web Server 复制链接链接已复制到粘贴板!
To stop Tomcat, run the following command as the tomcat user:
sh JWS_HOME/tomcat/bin/shutdown.sh
$ sh JWS_HOME/tomcat/bin/shutdown.sh
2.3. RPM Installation 复制链接链接已复制到粘贴板!
Installing JBoss Web Server from RPM packages installs Tomcat as service, and installs its resources into absolute paths. The RPM installation option is available for Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7, and Red Hat Enterprise Linux 8.
RPM installation packages for JBoss Web Server are available from Red Hat Subscription Management.
2.3.1. Installing JBoss Web Server from RPM packages 复制链接链接已复制到粘贴板!
Before downloading and installing the RPM packages, you must register your system with Red Hat Subscription Management and subscribe to the respective Content Delivery Network (CDN) repositories.
For information on registering Red Hat Enterprise Linux, see:
Configuring the Subscription Service for Red Hat Enterprise Linux 6
OR
The Subscription Manager for Red Hat Enterprise Linux 7
OR
The Subscription Manager for Red Hat Enterprise Linux 8
Attaching subscriptions to Red Hat Enterprise Linux (if required)
If the system does not have a subscription attached that provides JBoss Web Server:
- Log in to the Red Hat Subscription Manager.
- Click on the Systems tab.
-
Click on the
Nameof the system to add the subscription to. -
Change from the Details tab to the Subscriptions tab, then click
Attach Subscriptions. -
Select the check box beside the subscription to attach, then click
Attach Subscriptions.
To verify that a subscription provides the required CDN repositories:
- Log in to: https://access.redhat.com/management/subscriptions.
-
Click the
Subscription Name. Under Products Provided, you require:
- JBoss Enterprise Web Server.
- Red Hat JBoss Core Services.
Installing JBoss Web Server from RPM packages using YUM
On a command line, subscribe to the JBoss Web Server CDN repositories for your operating system version using
subscription-manager:subscription-manager repos --enable <repository>
# subscription-manager repos --enable <repository>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Enterprise Linux 6:
- jws-5-for-rhel-6-server-rpms
- jb-coreservices-1-for-rhel-6-server-rpms
For Red Hat Enterprise Linux 7:
- jws-5-for-rhel-7-server-rpms
- jb-coreservices-1-for-rhel-7-server-rpms
For Red Hat Enterprise Linux 8:
- jws-5-for-rhel-8-server-rpms
- jb-coreservices-1-for-rhel-8-server-rpms
Issue the following command as the root user to install JBoss Web Server:
yum groupinstall jws5
# yum groupinstall jws5Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note- Although not recommended, instead of using the group install, you can install each of the packages and their dependencies individually.
- The Red Hat JBoss Core Services repositories above are required for the installation of JBoss Web Server.
2.3.2. Starting JBoss Web Server 复制链接链接已复制到粘贴板!
In a shell prompt as the root user, start the Tomcat service.
For Red Hat Enterprise Linux 6:
service jws5-tomcat start
# service jws5-tomcat startCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Enterprise Linux 7 or 8:
systemctl start jws5-tomcat.service
# systemctl start jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
This is the only supported method of starting JBoss Web Server for an RPM installation.
To verify that Tomcat is running, the output of the service
statuscommand should be reviewed. This can be executed as any user.For Red Hat Enterprise Linux 6:
service jws5-tomcat status
# service jws5-tomcat statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Enterprise Linux 7 or 8:
systemctl status jws5-tomcat.service
# systemctl status jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For complete instructions on installing and configuring HTTPD on RHEL 8, please see this link
2.3.3. Stopping JBoss Web Server 复制链接链接已复制到粘贴板!
In a shell prompt as the root user, stop the Tomcat service.
For Red Hat Enterprise Linux 6:
service jws5-tomcat stop
# service jws5-tomcat stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Enterprise Linux 7 or 8:
systemctl stop jws5-tomcat.service
# systemctl stop jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To verify that Tomcat is no longer running, the output of the service
statuscommand should be reviewed. This can be executed as any user.For Red Hat Enterprise Linux 6:
service jws5-tomcat status
# service jws5-tomcat statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Enterprise Linux 7 or 8:
systemctl status jws5-tomcat.service
# systemctl status jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For complete instructions on installing and configuring HTTPD on RHEL 8, please see this link
Use the following commands to enable the JBoss Web Server services to start at boot.
For Red Hat Enterprise Linux 6:
chkconfig jws5-tomcat on
# chkconfig jws5-tomcat onCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Enterprise Linux 7 or 8:
systemctl enable jws5-tomcat.service
# systemctl enable jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. SELinux Policies 复制链接链接已复制到粘贴板!
2.4.1. SELinux Policy Information 复制链接链接已复制到粘贴板!
The following table contains information about the SELinux policies provided in the jws5-tomcat-selinux packages.
| Name | Port Information | Policy Information |
|---|---|---|
| jws5_tomcat |
Four ports in |
The jws5_tomcat policy is installed, which sets the appropriate SELinux domain for the process when Tomcat executes. It also sets the appropriate contexts to allow tomcat to write to |
For more information about using SELinux and other Red Hat Enterprise Linux security information, see the Red Hat Enterprise Linux Security Guide.
2.4.2. SELinux Policies for an RPM Installation 复制链接链接已复制到粘贴板!
SELinux policies for JBoss Web Server are provided by the jws5-tomcat-selinux package. These packages are available in the JWS channel.
To enable SELinux policies for JBoss Web Server 5.2, install the jws5-tomcat-selinux package.
2.4.3. SELinux Policies for a ZIP Installation 复制链接链接已复制到粘贴板!
In this release, SELinux policies are provided in the ZIP packages. The SELinux security model is enforced by the kernel and ensures applications have limited access to resources such as file system locations and ports. This helps ensure that the errant processes (either compromised or poorly configured) are restricted and in some cases prevented from running.
The .postinstall.selinux file is included in the tomcat folder of jws-5.2.0-application-server-<platform>-<architecture>.zip. If required, you can run the .postinstall.selinux script.
To install the SELinux policies using ZIP:
Install the
selinux-policy-develpackage:yum install -y selinux-policy-devel
yum install -y selinux-policy-develCopy to Clipboard Copied! Toggle word wrap Toggle overflow Execute the
.postinstall.selinuxscript:cd <JWS_home>/tomcat/ sh .postinstall.selinux
cd <JWS_home>/tomcat/ sh .postinstall.selinuxCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add access permissions to the required ports for JBoss Web Server. The JBoss Web Server has access to ports
8080,8009,8443and8005on Red Hat Enterprise Linux systems.When additional ports are required for JBoss Web Server, use the
semanagecommand to provide the necessary permissions, replacing the port number with the port required:semanage port -a -t http_port_t -p tcp <port>
semanage port -a -t http_port_t -p tcp <port>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start Tomcat:
<JWS_home>/tomcat/bin/startup.sh
<JWS_home>/tomcat/bin/startup.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check the context of the running process expecting
jws5_tomcat:ps -eo pid,user,label,args | grep jws5_tomcat | head -n1
ps -eo pid,user,label,args | grep jws5_tomcat | head -n1Copy to Clipboard Copied! Toggle word wrap Toggle overflow To verify the contexts of the Tomcat directories, for example:
ls -lZ <JWS_home>/tomcat/logs/
ls -lZ <JWS_home>/tomcat/logs/Copy to Clipboard Copied! Toggle word wrap Toggle overflow
By default, the SElinux policy provided is not active and the Tomcat processes run in the unconfined_java_t domain. This domain does not confine the processes, and it is recommended that you undertake the following security precautions if you chose not to enable the SElinux policy provided:
-
Restrict file access for the
tomcatuser to only the files and directories that are necessary to the JBoss Web Server runtime. -
Do not run Tomcat as the
rootuser.
3.1. Installing a Java Development Kit (JDK) 复制链接链接已复制到粘贴板!
Before installing JBoss Web Server on Microsoft Windows, you must first install a supported Java Development Kit (JDK).
For a list of supported configurations, see the Supporting Operating Systems and Configurations.
For instructions on installing the IBM JDK, visit: https://www.ibm.com/developerworks/java/jdk/
To install the Oracle Java Development Kit:
- 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.
- Double-click the downloaded file to start the installation.
- Proceed as instructed in the installation window.
3.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.2 Application Server (
jws-5.2.0-application-server.zip). -
The Red Hat JBoss Web Server 5.2 Native Components for Windows Server (
jws-5.2.0-application-server-<platform>-<architecture>.zip).
-
The Red Hat JBoss Web Server 5.2 Application Server (
- Unzip the downloaded ZIP files to your installation 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.
3.3. Configuring the JBoss Web Server Installation 复制链接链接已复制到粘贴板!
Some configuration is required before running JBoss Web Server. This section includes the following configuration procedures:
Setting Environment Variables
- Log in to an account with local administrator permissions.
- Go to Control Panel → System.
- Click on the Advanced tab.
- Click the Environment Variables button.
- Click the New button for System Variables.
-
For
JAVA_HOME,TMP, andTEMP, enter the appropriate name-value pairs for your system. -
For the SSL Connector to work, you will also need to add
JWS_HOME\binto thePATHenvironment variable of the user that the services will run under. This user isSYSTEMby default.
Installing the Tomcat Service
Open a command prompt with administrator privileges and change to the
binfolder for your Tomcat version:cd /D "JWS_HOME\tomcat\bin"
cd /D "JWS_HOME\tomcat\bin"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the Tomcat service with the following command:
call service.bat install
call service.bat installCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Configuring Folder Permissions for the JBoss Web Server Services
Follow this procedure to ensure that the account used to run the services has full control over the JWS_HOME folder and all of its subfolders:
-
Right-click the
JWS_HOMEfolder and click Properties. - Select the Security tab.
- Click the Edit button.
- Click the Add button.
-
In the text box, enter
LOCAL SERVICE. -
Select the Full Control check box for the
LOCAL SERVICEaccount. - Click OK.
- Click the Advanced button.
-
Inside the Advanced Security Settings dialog, select
LOCAL SERVICEand click Edit. - Select the check box next to the Replace all existing inheritable permissions on all descendants with inheritable permissions from this object option.
- Click OK through all the open folder property windows to apply the settings.
3.4. Starting JBoss Web Server 复制链接链接已复制到粘贴板!
You can start the JBoss Web Server from a command prompt, or with the Computer Management tool.
Starting JBoss Web Server from a Command Prompt
- Open a command prompt with administrator privileges.
Start the Tomcat service:
net start tomcat9
net start tomcat9Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Starting JBoss Web Server from the Computer Management Tool
- Go to Start → Administrative Tools → Services.
-
In the Services list, right-click the name of the service (
Tomcat9) and click Start.
Some third-party applications add libraries to the system directory in Windows. These take precedence over Tomcat libraries when looked-up. This means that if those third-party libraries have the same name as the those used by Tomcat native libraries, they are loaded instead of the libraries distributed with JBoss Web Server.
In this situation, Tomcat may not start, and does not log any error messages in the Windows Event Log, or Tomcat log files. Errors can only be seen by using catalina.bat run.
If this behavior occurs, inspect the contents of the C:\windows\System32\ directory and other PATH directories, and ensure that there are no DLLs conflicting with those delivered with JBoss Web Server. In particular, look for libeay32.dll, ssleay32.dll, and libssl32.dll.
3.5. Stopping JBoss Web Server 复制链接链接已复制到粘贴板!
You can stop the JBoss Web Server from a command prompt, or with the Computer Management tool.
Stopping JBoss Web Server from a Command Prompt
- Open a command prompt with administrator privileges.
Stop the Tomcat service:
net stop tomcat9
net stop tomcat9Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Stopping JBoss Web Server from the Computer Management Tool
- Go to Start → Administrative Tools → Services.
-
In the Services list, right-click the name of the service (
Tomcat9) and click Stop.
Chapter 4. Using Jsvc to Start Tomcat 复制链接链接已复制到粘贴板!
As JSVC is no longer supported from Tomcat on RHEL, this section no longer exists. It will be removed entirely in the next Service Pack.
Instead, please see using a system daemon and follow the instructions there.
Chapter 5. Hibernate on JBoss Web Server 复制链接链接已复制到粘贴板!
Hibernate is an object-relational mapping framework. It is provided by the JBoss Web Server Maven Repository (jboss-web-server-5.2.0-maven-repository.zip). This packaged version is used on all supported platforms.
Hibernate is used in the same way it is used for a regular Tomcat installation: the Hibernate JAR files are added into a deployment WAR file. Tomcat provides a default connection pooling mechanism, which is defined in context.xml. However, persistence.xml and web.xml are also required. The example below shows a configuration with the Tomcat connection pooling mechanism.
/META-INF/context.xmldefines the connection pools Tomcat should create.context.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow /WEB-INF/classes/META-INF/persistence.xmlis a JPA configuration file. It defines how the application configures Hibernate to consume connections from the Tomcat pool. If you are using the Hibernate API directly, use a similar configuration to that shown inhibernate.cfg.xml.persistence.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow /WEB-INF/web.xmlis a regular web application deployment file, which instructs Tomcat which datasource to consume. In the example below, the datasource isjdbc/DsWebAppDB.web.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For details, see the Hibernate documentation for JBoss Web Server.
The Hypertext Transfer Protocols are standard methods of transmitting data between applications (such as servers and browsers) over the internet. HTTP/2 improves on HTTP/1.1 by providing enhancements such as:
- header compression - reducing the size of the header transmitted by omitting implied information, and
- multiple requests and responses over a single connection - using binary framing to break down response messages, as opposed to textual framing.
Using HTTP/2 with the Red Hat JBoss Web Server:
-
is supported for encrypted connections over TLS (
h2). -
is not supported for unencrypted connections over TCP (
h2c).
Prerequisites
- Root user access (Red Hat Enterprise Linux systems), or
- Red Hat JBoss Web Server 5.0 or higher
-
The following operating system native libraries (provided by
jws-5.2.0-application-server-<platform>-<architecture>.zipwhere available).
RHEL-8 users needing to run JSSE+OpenSSL or APR, you will need to use Tomcat-Native for it to work properly. The file for Tomcat-Native can be found in the native zip directory. To install OpenSSL and APR, run the following commands:
yum install openssl
# yum install openssl
yum install apr
# yum install apr
A connector that supports the HTTP/2 protocol with SSL enabled. For JBoss Web Server 5.2, the connectors with HTTP/2 protocol support are:
- The APR Native connector (APR)
- The NIO connector with JSSE + OpenSSL (JSSE)
- The NIO2 connector with JSSE + OpenSSL (JSSE)
Procedure
Enable HTTP/2 for a connector:
Add the HTTP/2 upgrade protocol (
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />) to the connector in the server configurationJWS_HOME/tomcat/conf/server.xml.For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow server.xmlcontains an example connector definition for the APR protocol with the upgrade protocol to HTTP/2:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the Red Hat JBoss Web Server as the root user, to apply the changed configuration.
For SysV (Red Hat Enterprise Linux 6) users:
service jws5-tomcat restart
# service jws5-tomcat restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow For systemd (Red Hat Enterprise Linux 7) users:
systemctl restart jws5-tomcat.service
# systemctl restart jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Enterprise Linux users running Red Hat JBoss Web Server using
startup.sh:JWS_HOME/sbin/shudown.sh JWS_HOME/sbin/startup.sh
# JWS_HOME/sbin/shudown.sh # JWS_HOME/sbin/startup.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Windows Server users:
net restart tomcat9
# net restart tomcat9Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Next Steps
Verify that HTTP/2 is enabled by reviewing the Red Hat JBoss Web Server logs or by using the curl command:
Check the console output log (
JWS_HOME/tomcat/logs/catalina.out) to verify that the "connector has been configured to support negotiation to [h2]":cat JWS_HOME/tomcat/logs/catalina.out | grep 'h2' 06-Apr-2018 04:49:26.201 INFO [main] org.apache.coyote.http11.AbstractHttp11Protocol.configureUpgradeProtocol The ["https-openssl-apr-8443"] connector has been configured to support negotiation to [h2] via ALPN
$ cat JWS_HOME/tomcat/logs/catalina.out | grep 'h2' 06-Apr-2018 04:49:26.201 INFO [main] org.apache.coyote.http11.AbstractHttp11Protocol.configureUpgradeProtocol The ["https-openssl-apr-8443"] connector has been configured to support negotiation to [h2] via ALPNCopy to Clipboard Copied! Toggle word wrap Toggle overflow Or verify using
curl(for versions ofcurlthat supportHTTP2):NoteTo check
curlfor HTTP/2 support:Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, when the HTTP/2 protocol is inactive:
curl -I http://<JBoss_Web_Server>:8080/
$ curl -I http://<JBoss_Web_Server>:8080/ HTTP/1.1 200 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow But if the HTTP/2 protocol is active,
curlreturns:curl -I https://<JBoss_Web_Server>:8443/
$ curl -I https://<JBoss_Web_Server>:8443/ HTTP/2 200 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where <JBoss_Web_Server> is the URI of the modified connector (such as
example.com), and the port number is dependent on your configuration.
Additional Resources
- For additional information on using HTTP/2, see: Apache Tomcat 9 Configuration Reference: The HTTP Connector - HTTP/2 Support.
- For information on the HTTP/2 Upgrade Protocol and the supported attributes, see: Apache Tomcat 9 Configuration Reference: The HTTP2 Upgrade Protocol.
- The proposed internet standard for HTTP/2: IETF: RFC 7540 - Hypertext Transfer Protocol Version 2 (HTTP/2)
A password vault is used to mask passwords and other sensitive strings, and store them in an encrypted Java keystore. This allows you to eliminate storing clear-text passwords in your Tomcat configuration files, as Tomcat can lookup passwords and other sensitive strings from a keystore using the vault.
Installing the JBoss Web Server password vault from .zip archive
The tomcat password vault is pre-installed by the jws-5.2.0-application-server.zip file. The password vault can be used once configured and is located at: JWS_HOME/tomcat/lib/tomcat-vault.jar.
Installing the JBoss Web Server password vault on Red Hat Enterprise Linux using the YUM package manager
Where the JBoss Web Server has been installed from RPMs on Red Hat Enterprise Linux, install the password vault as the root user by executing:
yum install jws5-tomcat-vault
yum install jws5-tomcat-vault
The examples and commands below use JWS_HOME as the JBoss Web Server installation directory. Replace JWS_HOME with the path to your JBoss Web Server installation. Also, the paths below use / for directory separators.
7.1.1. Enabling the Password Vault 复制链接链接已复制到粘贴板!
- Stop Tomcat if it is running.
-
Edit
JWS_HOME/tomcat/conf/catalina.properties, and add the following line:
org.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.vault.util.PropertySourceVault
org.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.vault.util.PropertySourceVault
7.1.2. Creating a Java Keystore 复制链接链接已复制到粘贴板!
To use a password vault, you must first create a Java keystore. You can do this using the keytool -genseckey command. For example:
keytool -genseckey -keystore JWS_HOME/tomcat/vault.keystore -alias my_vault -storetype jceks -keyalg AES -keysize 128 -storepass <vault_password> -keypass <vault_password> -validity 730
$ keytool -genseckey -keystore JWS_HOME/tomcat/vault.keystore -alias my_vault -storetype jceks -keyalg AES -keysize 128 -storepass <vault_password> -keypass <vault_password> -validity 730
The values above are examples only. Replace them with values specific to your environment.
For an explanation of the parameters, use the keytool -genseckey -help command.
The vault.properties file for the tomcat-vault can be stored outside of JWS_HOME/tomcat/conf/ in a CATALINA_BASE/conf/ directory (if set).
To set the CATALINA_BASE directory, follow the instructions in the section 'Advanced Configuration - Multiple Tomcat Instances' in the Running The Apache Tomcat 9.0 Servlet/JSP Container document found on the Apache Tomcat Website.
The default location for CATALINA_BASE is JWS_HOME/tomcat/ also known as CATALINA_HOME.
For more information on setting CATALINA_BASE, see:
7.1.4. Initializing the Password Vault 复制链接链接已复制到粘贴板!
The vault must be initialized before it can be used to store sensitive strings. This is done using the JWS_HOME/tomcat/bin/tomcat-vault.sh vault script. For Microsoft Windows, the script is tomcat-vault.bat.
The script can be run interactively or non-interactively. Below is an example of an interactive execution of the script to initialize a password vault, with the values shown below using the example keystore from the previous step.
The values below are examples only. Replace them with values appropriate for your environment.
Note the output for the Tomcat properties file, as you will need this to configure Tomcat to use the vault.
Configuring Tomcat to Use the Password Vault
In JWS_HOME/tomcat/conf/, create a file named vault.properties containing the vault configuration produced when initializing the vault. The values provided below use the example vault initialized in the previous steps.
For KEYSTORE_PASSWORD, you must use the masked value that was generated when initializing the vault.
The Vault for Apache Tomcat can be created non-interactively by providing the required input as arguments to the tomcat-vault.sh script. The vault.properties file is also created as output of the tomcat-vault.sh script when the -g, --generate-config option is used.
The values below are examples only. Replace them with values appropriate for your environment.
7.1.5. Storing a Sensitive String in the Password Vault 复制链接链接已复制到粘贴板!
The vault script used in the previous steps is also used to store sensitive strings in the password vault. The script can be run interactively or non-interactively.
When adding a string to a password vault, the sensitive string needs a name that it will be referred by. For a password vault, this name is called an attribute name, and the password itself is called a secured attribute.
The example below demonstrates using the vault script non-interactively to store a password. It uses the vault that was initialized in the previous steps, and stores the sensitive string P@SSW0#D with the attribute name manager_password.
JWS_HOME/tomcat/bin/tomcat-vault.sh --keystore JWS_HOME/tomcat/vault.keystore --keystore-password <vault_password> --alias my_vault --enc-dir JWS_HOME/tomcat/ --iteration 120 --salt 1234abcd --vault-block my_block --attribute manager_password --sec-attr P@SSW0#D
$ JWS_HOME/tomcat/bin/tomcat-vault.sh --keystore JWS_HOME/tomcat/vault.keystore --keystore-password <vault_password> --alias my_vault --enc-dir JWS_HOME/tomcat/ --iteration 120 --salt 1234abcd --vault-block my_block --attribute manager_password --sec-attr P@SSW0#D
You can optionally specify a vault block to store the password in. If you don’t specify a block, one will be automatically created for you. In the above example, my_block is used.
After storing a sensitive string in the password vault, you can refer to it in your configuration files by entering the stored string’s attribute as ${VAULT::block_name::attribute_name::}.
For example, to use the password stored in the previous steps, replace:
<user username="manager" password="P@SSW0#D" roles="manager-gui"/>
<user username="manager" password="P@SSW0#D" roles="manager-gui"/>
with:
<user username="manager" password="${VAULT::my_block::manager_password::}" roles="manager-gui"/>
<user username="manager" password="${VAULT::my_block::manager_password::}" roles="manager-gui"/>
As a result, only a reference to the password is visible in the Tomcat configuration file, and the actual password is only stored in the password vault.
Appendix A. Java IPv4/IPv6 Properties 复制链接链接已复制到粘贴板!
Configuring Java Properties
In Java there are 2 properties that are used to configure IPv4 and IPv6. These are java.net.preferIPv4Stack and java.net.preferIPv6Addresses.
java.net.preferIPv4Stack (default: false)
If IPv6 is available then the underlying native socket, by default, is an IPv6 socket. This socket lets applications connect and accept connections from IPv4 and IPv6 hosts. If application use only IPv4 sockets, then set this property to true. However, it will not be possible for the application to communicate with IPv6 only hosts.
java.net.preferIPv6Addresses (default: false)
If a host has both IPv4 and IPv6 addresses, and IPv6 is available, then the default behavior is to use IPv4 addresses over IPv6. This allows backward compatibility. If applications that depend on an IPv4 address representation, for example: 192.168.1.1. Then, set this property to true to change the preference and use IPv6 addresses over IPv4 where possible.
To pass these properties to Tomcat, set CATALINA_OPTS in the JWS_HOME/tomcat/bin/setenv.* file.
If the JWS_HOME/tomcat/bin/setenv.sh or JWS_HOME/tomcat/bin/setenv.bat file does not exist, then you need to create one.
On Linux:
export "CATALINA_OPTS=-Djava.net.preferIPv4Stack=YOUR_VALUE -Djava.net.preferIPv6Addresses=YOUR_VALUE"
On Windows:
set "CATALINA_OPTS=-Djava.net.preferIPv4Stack=YOUR_VALUE -Djava.net.preferIPv6Addresses=YOUR_VALUE"
Configuring Tomcat Bindings
The Tomcat bindings can be set in JWS_HOME/tomcat/conf/server.xml with the IPv6 address:
Specify the Tomcat binding address:
<Server … address="TOMCAT_BINDING_ADDRESS">Specify the HTTP connector address:
<Connector protocol="HTTP/1.1" … address="HTTP_CONNECTOR_ADDRESS">Specify the AJP connector address:
<Connector protocol="AJP/1.3" … address="AJP_CONNECTOR_ADDRESS">