Este contenido no está disponible en el idioma seleccionado.
Chapter 3. Installing JBoss Web Server on Red Hat Enterprise Linux from RPM packages
You can install JBoss Web Server on Red Hat Enterprise Linux from archive files or RPM packages. If you want to install JBoss Web Server from RPM packages, the installation packages are available from Red Hat Subscription Management. The RPM installation option is available for Red Hat Enterprise Linux 7 and Red Hat Enterprise Linux 8.
Installing JBoss Web Server from RPM packages deploys Tomcat as a service and installs Tomcat resources into absolute paths.
3.1. Prerequisites Copiar enlaceEnlace copiado en el portapapeles!
- You have installed a supported Java Development Kit (JDK) by using the YUM package or from a compressed archive.
- Your system is compliant with Red Hat Enterprise Linux package requirements.
3.1.1. Installing a JDK by using the YUM package manager Copiar enlaceEnlace copiado en el portapapeles!
You can use the YUM package manager to install a Java Development Kit (JDK). For a full list of supported JDKs, see Supported operating systems and configurations.
Procedure
Subscribe your Red Hat Enterprise Linux system to the appropriate channel:
OpenJDK:
- rhel-7-server-rpms
- rhel-8-server-rpms
IBM:
- rhel-7-server-supplementary-rpms
- rhel-8-server-supplementary-rpms
ImportantRed Hat Enterprise Linux 6 is no longer supported and subsequently was removed from the documentation.
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.
3.1.2. Installing a JDK from a compressed archive Copiar enlaceEnlace copiado en el portapapeles!
You can install a Java Development Kit (JDK) from a compressed archive such as a .zip or .tar file. For a full list of supported JDKs, see Supported operating systems and configurations.
Procedure
-
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_HOMEenvironment variable. If the JDK was installed from a compressed, archive, set the
JAVA_HOMEenvironment variable for Tomcat:-
In the
bindirectory of Tomcat (JWS_HOME/tomcat/bin), create a file namedsetenv.sh. In the
setenv.shfile, enter theJAVA_HOMEpath 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_64Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
In the
3.1.3. Red Hat Enterprise Linux package requirements Copiar enlaceEnlace copiado en el portapapeles!
Before you install JBoss Web Server on Red Hat Enterprise Linux, you must ensure that your system is compliant with the following package requirements.
The package requirements for Red Hat Enterprise Linux 7 and Red Hat Enterprise Linux 8 are different.
If you want to use OpenSSL on Red Hat Enterprise Linux 8, you must install the
opensslpackage that is provided with the operating system.To install the
opensslpackage, enter the following command as the root user:yum install openssl
# yum install opensslCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you want to use Apache Portable Runtime (APR) on Red Hat Enterprise Linux 8, you must install the
aprpackage that is provided with the operating system.To install the
aprpackage, enter the following command as the root user:yum install apr
# yum install aprCopy to Clipboard Copied! Toggle word wrap Toggle overflow You must remove the
tomcatjsspackage before you install thetomcat-nativepackage. Thetomcatjsspackage uses an underlying Network Security Services (NSS) security model rather than the OpenSSL security model.To remove the
tomcatjsspackage, enter the following command as the root user:yum remove tomcatjss
# yum remove tomcatjssCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
On Red Hat Enterprise Linux 7, JBoss Web Server uses the
opensslandaprpackages that are provided with Red Hat JBoss Core Services. -
On Red Hat Enterprise Linux 8, JBoss Web Server uses the
opensslandaprpackages that are provided with the operating system. -
When you install JBoss Web Server from an archive file on Red Hat Enterprise Linux 8, you must install the
opensslandaprpackages that are provided with the operating system.
3.2. Attaching subscriptions to Red Hat Enterprise Linux Copiar enlaceEnlace copiado en el portapapeles!
Before you download and install the RPM packages for JBoss Web Server, you must register your system with Red Hat Subscription Management, and subscribe to the respective Content Delivery Network (CDN) repositories. You can subsequently perform some verification steps to ensure that a subscription provides the required CDN repositories.
Red Hat Enterprise Linux 6 is no longer supported and subsequently was removed from the documentation.
Procedure
- Log in to the Red Hat Subscription Management web page.
- Click the Systems tab.
-
Click the
Nameof the system that you want to add the subscription to. -
Change from the Details tab to the Subscriptions tab, then click
Attach Subscriptions. -
Select the check box next to the subscription you want to attach, and then click
Attach Subscriptions.
Verification
- Log in to the Red Hat Subscriptions web page.
-
In the
Subscription Namecolumn, click the subscription that you want to select. Under Products Provided, you require both of the following:
-
JBoss Enterprise Web Server -
Red Hat JBoss Core Services
-
3.3. Installing JBoss Web Server from RPM packages by using YUM Copiar enlaceEnlace copiado en el portapapeles!
You can use the YUM package manager to install JBoss Web Server from RPM packages on Red Hat Enterprise Linux.
Prerequisites
- You have installed a supported Java Development Kit (JDK).
- Your system is compliant with Red Hat Enterprise Linux package requirements.
- You have attached subscriptions to Red Hat Enterprise Linux.
Procedure
To subscribe to the JBoss Web Server CDN repositories for your operating system version, enter the following command:
subscription-manager repos --enable <repository>
# subscription-manager repos --enable <repository>Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIn the preceding command, replace
<repository>with the following values:
-
On Red Hat Enterprise Linux 7, replace
<repository>withjws-5-for-rhel-7-server-rpmsandjb-coreservices-1-for-rhel-7-server-rpms. -
On Red Hat Enterprise Linux 8, replace
<repository>withjws-5-for-rhel-8-x86_64-rpms.
-
On Red Hat Enterprise Linux 7, replace
To install JBoss Web Server, enter the following command as the root user:
yum groupinstall jws5
# yum groupinstall jws5Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantWhen you install JBoss Web Server from RPM packages, the
JWS_HOMEfolder is/opt/rh/jws5/root/usr/share.
-
You can install each of the packages and their dependencies individually rather than use the
groupinstallcommand. The preferred method is to usegroupinstall. - The Red Hat JBoss Core Services repositories are required for the installation of JBoss Web Server, except on Red Hat Enterprise Linux 8 systems.
- The feature to enable NFS usage by using Software Collection is enabled. For more information about this feature, see the Packaging Guide: Using Software Collections over NFS.
3.4. Starting JBoss Web Server when installed from RPMs Copiar enlaceEnlace copiado en el portapapeles!
When you install JBoss Web Server from RPM packages, you can use the commmand line to start JBoss Web Server. You can subsequently view the output of the service status command to verfiy that Tomcat is running successfully.
Red Hat Enterprise Linux 6 is no longer supported and subsequently was removed from the documentation.
Procedure
Enter the following command as the root user:
systemctl start jws5-tomcat.service
# systemctl start jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThis is the only supported method of starting JBoss Web Server for an RPM installation.
Verification
To verify that Tomcat is running, enter the following command as any user:
systemctl status jws5-tomcat.service
# systemctl status jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteFor more information about installing and configuring HTTPD on RHEL 8, see Deploying Different Types of Server: Setting up the Apache HTTP web server.
3.5. Stopping JBoss Web Server when installed from RPMs Copiar enlaceEnlace copiado en el portapapeles!
When you install JBoss Web Server from RPM packages, you can use the command line to stop JBoss Web Server. You can subsequently view the output of the service status command to verfiy that Tomcat is running successfully.
Red Hat Enterprise Linux 6 is no longer supported and subsequently was removed from the documentation.
Procedure
Enter the followng command as the root user:
systemctl stop jws5-tomcat.service
# systemctl stop jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
To verify that Tomcat is no longer running, enter the following command as any user:
systemctl status jws5-tomcat.service
# systemctl status jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information about installing and configuring HTTPD on RHEL 8, see Deploying Different Types of Server: Setting up the Apache HTTP web server.
3.6. Configuring JBoss Web Server services to start at system startup Copiar enlaceEnlace copiado en el portapapeles!
When you install JBoss Web Server from RPM packages, you can configure JBoss Web Server services to start at system startup.
Procedure
Enter the following command:
systemctl enable jws5-tomcat.service
# systemctl enable jws5-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Red Hat Enterprise Linux 6 is no longer supported and subsequently was removed from the documentation.
3.7. SELinux policies for JBoss Web Server Copiar enlaceEnlace copiado en el portapapeles!
You can use Security-Enhanced Linux (SELinux) policies to define access controls for JBoss Web Server. These policies are a set of rules that determine access rights to the product.
3.7.1. SELinux policy information for jws5-tomcat Copiar enlaceEnlace copiado en el portapapeles!
The SELinux security model is enforced by the kernel and ensures that applications have limited access to resources such as file system locations and ports. SELinux policies ensure that any errant processes that are compromised or poorly configured are restricted or prevented from running.
The jws5-tomcat-selinux packages in your JBoss Web Server installation provide a jws5_tomcat policy. The following table contains information about the supplied SELinux policy.
| Name | Port Information | Policy Information |
|---|---|---|
|
|
Four ports in |
The
|
3.7.2. Enabling SELinux policies for a JBoss Web Server RPM installation Copiar enlaceEnlace copiado en el portapapeles!
When you install JBoss Web Server from RPM packages, the jws5-tomcat-selinux package provides SELinux policies for JBoss Web Server. These packages are available in the JBoss Web Server channel.
Procedure
Install the
jws5-tomcat-selinuxpackage:yum install -y jws5-tomcat-selinux
yum install -y jws5-tomcat-selinuxCopy to Clipboard Copied! Toggle word wrap Toggle overflow