이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 2. Installing JBoss Web Server on Red Hat Enterprise Linux from archive files
You can install JBoss Web Server on Red Hat Enterprise Linux (RHEL) from archive files or RPM packages. If you want to install JBoss Web Server from archive files, you can download and extract the JBoss Web Server archive files from the Red Hat Customer Portal.
When you install JBoss Web Server from an archive file, you can manage the product in different ways. For example, you can use a system daemon at system startup or manage JBoss Web Server from a command line.
You can install JBoss Web Server on RHEL versions 8, 9, and 10. Red Hat does not provide a distribution of JBoss Web Server 6.x for RHEL 7 systems.
2.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- You have installed a supported Java Development Kit (JDK) by using the DNF package manager or from a compressed archive.
- Your system is compliant with Red Hat Enterprise Linux package requirements.
2.1.1. Installing a JDK by using the DNF package manager 링크 복사링크가 클립보드에 복사되었습니다!
You can use the DNF package manager to install a Java Development Kit (JDK). For a full list of supported JDKs, see JBoss Web Server operating systems and configurations.
This procedure describes how to install OpenJDK. If you want to install the Oracle JDK, see the Oracle documentation for more information.
Procedure
Subscribe your Red Hat Enterprise Linux system to the appropriate channel:
- rhel-8-for-x86_64-appstream-rpms
- rhel-9-for-x86_64-appstream-rpms
- rhel-10-for-x86_64-appstream-rpms
To install a supported JDK version, enter the following command as the root user:
dnf install java-<version>-openjdk-headless
# dnf install java-<version>-openjdk-headlessCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding command, replace
java-<version>withjava-11,java-17, orjava-21.NoteJBoss Web Server 6.x does not support OpenJDK 8.
To ensure the correct JDK is in use, enter the following command as the root user:
alternatives --config java
# alternatives --config javaCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command returns a list 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 uses the
javacommand uses the JDK set byalternatives. Changing Java alternatives might impact on the running of other software.
2.1.2. Installing a JDK from a compressed archive 링크 복사링크가 클립보드에 복사되었습니다!
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 JBoss Web Server operating systems and configurations.
Procedure
-
If you downloaded the JDK from the vendor’s website (Oracle or OpenJDK), use the installation instructions provided by the vendor and set the
JAVA_HOMEenvironment variable. If you installed the JDK 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-<version>-openjdk.x86_64
$ cat JWS_HOME/tomcat/bin/setenv.sh export JAVA_HOME=/usr/lib/jvm/jre-<version>-openjdk.x86_64Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
jre-<version>withjre-11,jre-17, orjre-21.
-
In the
2.1.3. Red Hat Enterprise Linux package requirements 링크 복사링크가 클립보드에 복사되었습니다!
Before you install JBoss Web Server on Red Hat Enterprise Linux, you must ensure that your system is compliant with the following package requirements.
On Red Hat Enterprise Linux version 8, 9, or 10, if you want to use OpenSSL or Apache Portable Runtime (APR), you must install the
opensslandaprpackages that Red Hat Enterprise Linux provides.To install the
opensslpackage, enter the following command as the root user:dnf install openssl
# dnf install opensslCopy to Clipboard Copied! Toggle word wrap Toggle overflow To install the
aprpackage, enter the following command as the root user:dnf install apr
# dnf 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:dnf remove tomcatjss
# dnf remove tomcatjssCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2. Downloading and extracting archive files for a base release of JBoss Web Server 링크 복사링크가 클립보드에 복사되었습니다!
A base release is the initial release of a specific product version (for example, 6.1.0 is the base release of version 6.1). You can download the JBoss Web Server archive files from the Software Downloads page on the Red Hat Customer Portal.
Prerequisites
- You have installed a supported Java Development Kit (JDK) by using the DNF package manager or from a compressed archive.
- Your system is compliant with Red Hat Enterprise Linux package requirements.
Procedure
- Open a browser and log in to the Red Hat Customer Portal.
- Click the Downloads tab.
- From the Product Downloads list, select Red Hat JBoss Web Server.
- On the Software Downloads page, from the Version drop-down list, select the appropriate JBoss Web Server version.
Click Download next to the
Red Hat JBoss Web Server 6.1.0 Application Serverfile.The downloaded file is named
jws-6.1.0-application-server.zipon your local host.If you also want to download the native JBoss Web Server components for your operating system, click Download next to the
Red Hat JBoss Web Server 6.1.0 Optional Native Components for <platform> <architecture>file. In this situation, ensure that you select the correct file that matches the platform and architecture for your system.The downloaded file is named
jws-6.1.0-optional-native-components-<platform>-<architecture>.zip(for example,jws-6.1.0-optional-native-components-RHEL8-x86_64.zip).Extract the downloaded archive files to your installation directory.
For example:
unzip jws-6.1.0-application-server.zip -d /opt/ unzip -o jws-6.1.0-optional-native-compoonents-<platform>-<architecture>.zip -d /opt/
# unzip jws-6.1.0-application-server.zip -d /opt/ # unzip -o jws-6.1.0-optional-native-compoonents-<platform>-<architecture>.zip -d /opt/Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The top-level directory for JBoss Web Server is created when you extract the archive. This document refers to the top-level directory for JBoss Web Server as JWS_HOME.
2.3. Downloading and extracting archive files for JBoss Web Server patch updates 링크 복사링크가 클립보드에 복사되었습니다!
If product patch updates are available for the appropriate JBoss Web Server version, you can install the archive files for the latest cumulative patches. You can download the JBoss Web Server archive files from the Software Downloads page on the Red Hat Customer Portal.
You cannot use cumulative patch updates to install the base (X.X.0) release of a product version. For example, the installation of a 6.1.2 patch would install the 6.1.1 and 6.1.2 releases but cannot install the base 6.1.0 release.
Service pack releases are cumulative. By downloading the latest service pack release, you also install any previous service pack releases automatically.
Prerequisites
Procedure
- Open a browser and log in to the Red Hat Customer Portal.
- Click the Downloads tab.
- From the Product Downloads list, select Red Hat JBoss Web Server.
- On the Software Downloads page, from the Version drop-down list, select the appropriate JBoss Web Server version.
- Click the Patches tab.
Click Download next to the latest
Red Hat JBoss Web Server 6.1 Update XX Application Serverfile.The downloaded file is named
jws-6.1.x-application-server.zipon your local host.If you also want to download the native JBoss Web Server components for your operating system, click Download next to the latest
Red Hat JBoss Web Server 6.1 Update XX Optional Native Components for <platform> <architecture>file. In this situation, ensure that you select the correct file that matches the platform and architecture for your system.The downloaded file is named
jws-6.1.x-optional-native-components-<platform>-<architecture>.zip(for example,jws-6.1.x-optional-native-components-RHEL8-x86_64.zip).Extract the downloaded archive files to your installation directory.
For example:
unzip jws-6.1.x-application-server.zip -d /opt/ unzip -o jws-6.1.x-optional-native-compoonents-<platform>-<architecture>.zip -d /opt/
# unzip jws-6.1.x-application-server.zip -d /opt/ # unzip -o jws-6.1.x-optional-native-compoonents-<platform>-<architecture>.zip -d /opt/Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. Managing JBoss Web Server by using systemd when installed from an archive file 링크 복사링크가 클립보드에 복사되었습니다!
When you install JBoss Web Server from an archive file on Red Hat Enterprise Linux, you can use a system daemon to perform management tasks. Using the JBoss Web Server with a system daemon provides a method of starting the JBoss Web Server services at system startup. The system daemon also provides start, stop and status check functions.
On Red Hat Enterprise Linux versions 8, 9, and 10, the default system daemon is systemd.
Prerequisites
Procedure
To determine which system daemon is running, enter the following command:
ps -p 1 -o comm=
$ ps -p 1 -o comm=Copy to Clipboard Copied! Toggle word wrap Toggle overflow If
systemdis running, the following output is displayed:systemd
systemdCopy to Clipboard Copied! Toggle word wrap Toggle overflow To set up the JBoss Web Server for
systemd, run the.postinstall.systemdscript as the root user:cd JWS_HOME/tomcat sh .postinstall.systemd
# cd JWS_HOME/tomcat # sh .postinstall.systemdCopy to Clipboard Copied! Toggle word wrap Toggle overflow To control the JBoss Web Server with
systemd, you can perform any of the following steps as the root user:To enable the JBoss Web Server services to start at system startup by using
systemd:systemctl enable jws6-tomcat.service
# systemctl enable jws6-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To start the JBoss Web Server by using
systemd:systemctl start jws6-tomcat.service
# systemctl start jws6-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe
SECURITY_MANAGERvariable is now deprecated for JBoss Web Server configurations that are based on archive file installations. Consider the following deprecation comment:SECURITY_MANAGER has been deprecated. To run tomcat under the Java Security Manager use:
# SECURITY_MANAGER has been deprecated. To run tomcat under the Java Security Manager use: JAVA_OPTS="-Djava.security.manager -Djava.security.policy==\"$CATALINA_BASE/conf/"catalina.policy\"""Copy to Clipboard Copied! Toggle word wrap Toggle overflow To stop the JBoss Web Server by using
systemd:systemctl stop jws6-tomcat.service
# systemctl stop jws6-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify the status of the JBoss Web Server by using
systemd:systemctl status jws6-tomcat.service
# systemctl status jws6-tomcat.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteAny user can run the
statusoperation.
2.5. JBoss Web Server configuration for managing archive installations from the command line 링크 복사링크가 클립보드에 복사되었습니다!
When you install JBoss Web Server from an archive file on Red Hat Enterprise Linux, you can start and stop JBoss Web Server directly from the command line. Before you can run JBoss Web Server from the command line, you must perform the following series of configuration tasks:
-
Set the
JAVA_HOMEenvironment variable for Tomcat. -
Create a
tomcatuser and its parent group. -
Grant the
tomcatuser access to JBoss Web Server.
When you manage JBoss Web Server by using a system daemon rather than from the command line, the .postinstall.systemd script performs these configuration steps automatically.
2.5.1. Setting the JAVA_HOME environment variable for Apache Tomcat 링크 복사링크가 클립보드에 복사되었습니다!
Before you run JBoss Web Server from the command line for the first time, you must set the JAVA_HOME environment variable for Apache Tomcat.
Prerequisites
Procedure
-
On a command line, go to the
JWS_HOME/tomcat/bindirectory. -
Create a file named
setenv.sh. In the
setenv.shfile, enter theJAVA_HOMEpath definition.For example:
export JAVA_HOME=/usr/lib/jvm/jre-11-openjdk.x86_64
export JAVA_HOME=/usr/lib/jvm/jre-11-openjdk.x86_64Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.5.2. Creating a Tomcat user and group 링크 복사링크가 클립보드에 복사되었습니다!
Before you run JBoss Web Server from the command line for the first time, you must create a tomcat user account and user group to enable simple and secure user management. On Red Hat Enterprise Linux, the user identifer (UID) for the tomcat user and the group identifier (GID) for the tomcat group both have a reserved value of 53.
You must perform all steps in this procedure as the root user.
Prerequisites
Procedure
-
On a command line, go to the
JWS_HOMEdirectory. Create the
tomcatuser group:groupadd -g 53 -r tomcat
# groupadd -g 53 -r tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
tomcatuser in thetomcatuser group:useradd -c "tomcat" -u 53 -g tomcat -s /sbin/nologin -r tomcat
# useradd -c "tomcat" -u 53 -g tomcat -s /sbin/nologin -r tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The preceding commands set both the UID and the GID to 53. If you subsequently want to change the UID and GID values, see Changing the UID and GID for the tomcat user and group.
2.5.3. Granting the Tomcat user access to JBoss Web Server 링크 복사링크가 클립보드에 복사되었습니다!
Before you run JBoss Web Server from the command line for the first time, you must grant the tomcat user access to JBoss Web Server by assigning ownership of the Tomcat directories to the tomcat user.
You must perform all steps in this procedure as the root user.
Prerequisites
Procedure
-
Go to the
JWS_HOMEdirectory. Assign ownership of the Tomcat directories to the
tomcatuser:chown -R tomcat:tomcat tomcat/
# chown -R tomcat:tomcat tomcat/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the
tomcatuser has execute permissions for all parent directories:chmod -R u+X tomcat/
# chmod -R u+X tomcat/Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the
tomcatuser is the owner of the directory:ls -l
# ls -lCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.6. Starting JBoss Web Server from the command line when installed from an archive file 링크 복사링크가 클립보드에 복사되었습니다!
When you install JBoss Web Server from an archive file on Red Hat Enterprise Linux, you can start JBoss Web Server directly from the command line.
Prerequisites
Procedure
Enter the following command as the
tomcatuser:sh JWS_HOME/tomcat/bin/startup.sh
$ sh JWS_HOME/tomcat/bin/startup.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.7. Stopping JBoss Web Server from the command line when installed from an archive file 링크 복사링크가 클립보드에 복사되었습니다!
When you install JBoss Web Server from an archive file on Red Hat Enterprise Linux, you can stop JBoss Web Server directly from the command line.
Prerequisites
Procedure
Enter the following command as the
tomcatuser:sh JWS_HOME/tomcat/bin/shutdown.sh
$ sh JWS_HOME/tomcat/bin/shutdown.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.8. SELinux policies for JBoss Web Server 링크 복사링크가 클립보드에 복사되었습니다!
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.
2.8.1. SELinux policy information for jws6-tomcat 링크 복사링크가 클립보드에 복사되었습니다!
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 jws6-tomcat-selinux packages in your JBoss Web Server installation provide a jws6_tomcat policy. The following table contains information about the supplied SELinux policy.
| Name | Port Information | Policy Information |
|---|---|---|
|
|
Four ports in |
The
|
2.8.2. Installing SELinux policies for a JBoss Web Server archive installation 링크 복사링크가 클립보드에 복사되었습니다!
In this release, the archive packages provide SELinux policies. The tomcat folder of the jws-6.1.0-application-server-<platform>-<architecture>.zip archive includes the .postinstall.selinux file. If required, you can run the .postinstall.selinux script.
Procedure
Install the
selinux-policy-develpackage:dnf install -y selinux-policy-devel
dnf install -y selinux-policy-develCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run 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:
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 NoteThe 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 preceding
semanagecommand to provide the necessary permissions, and replace<port>with the required port.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
jws6_tomcat:ps -eo pid,user,label,args | grep jws6_tomcat | head -n1
ps -eo pid,user,label,args | grep jws6_tomcat | head -n1Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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 that JBoss Web Server provides is not active and the Tomcat processes run in the unconfined_java_t domain. This domain does not confine the processes.
If you choose not to enable the SELinux policy that is provided, you can take the following security measures:
-
Restrict file access for the
tomcatuser, so that thetomcatuser only has access to the files and directories that are necessary for the JBoss Web Server runtime. - Do not run Tomcat as the root user.
When JBoss Web Server is installed from an archive file, Red Hat does not officially support the use of network file sharing (NFS). If you want your JBoss Web Server installation to use an NFS-mounted file system, you are responsible for ensuring that SELinux policies are modified correctly to support this type of deployment.
2.9. Changing the UID and GID for the tomcat user and group 링크 복사링크가 클립보드에 복사되었습니다!
On Red Hat Enterprise Linux, the user identifer (UID) for the tomcat user and the group identifier (GID) for the tomcat group both have a reserved value of 53. Depending on your setup requirements, you can change the UID and GID for the tomcat user and group to some other value.
To avoid SELinux conflicts, use UID and GID values that are less than 500. If SELinux is set to enforcing mode, UID and GID values greater than 500 might cause unexpected issues.
Prerequisites
-
You have created a
tomcatuser account and group.
Procedure
-
If JBoss Web Server is already running, stop JBoss Web Server as the
tomcatuser. For more information, see Stopping JBoss Web Server from the command line when installed from an archive file. To view the current UID and GID for the
tomcatuser and group, enter the following command as the root user:id tomcat
id tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command displays the user account and group details. For example:
uid=53(tomcat) gid=53(tomcat) groups=53(tomcat)
uid=53(tomcat) gid=53(tomcat) groups=53(tomcat)Copy to Clipboard Copied! Toggle word wrap Toggle overflow To assign a new GID to the
tomcatgroup, enter the following command as the root user:groupmod -g <new_gid> tomcat
groupmod -g <new_gid> tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
groupmod -g 410 tomcat
groupmod -g 410 tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow To assign a new UID to the
tomcatuser, enter the following command as the root user:usermod -u <new_uid> -g <new_gid> tomcat
usermod -u <new_uid> -g <new_gid> tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
usermod -u 401 -g 410 tomcat
usermod -u 401 -g 410 tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow To reassign file and directory permissions to the new UID, enter the following command as the root user:
find / -not -path '/proc*' -uid <original_uid> | perl -e '$ug = @ARGV[0]; foreach $fn (<STDIN>) { chomp($fn);$m = (stat($fn))[2];chown($ug,-1,$fn);chmod($m,$fn)}' <new_uid># find / -not -path '/proc*' -uid <original_uid> | perl -e '$ug = @ARGV[0]; foreach $fn (<STDIN>) { chomp($fn);$m = (stat($fn))[2];chown($ug,-1,$fn);chmod($m,$fn)}' <new_uid>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding command, replace <original_uid> with the old UID and replace <new_uid> with the new UID. For example, to reassign file and directory permissions from UID
53to UID401, enter the following command:find / -not -path '/proc*' -uid 53 | perl -e '$ug = @ARGV[0]; foreach $fn (<STDIN>) { chomp($fn);$m = (stat($fn))[2];chown($ug,-1,$fn);chmod($m,$fn)}' 401# find / -not -path '/proc*' -uid 53 | perl -e '$ug = @ARGV[0]; foreach $fn (<STDIN>) { chomp($fn);$m = (stat($fn))[2];chown($ug,-1,$fn);chmod($m,$fn)}' 401Copy to Clipboard Copied! Toggle word wrap Toggle overflow To reassign file and directory permissions to the new GID, enter the following command as the root user:
find / -not -path '/proc*' -gid <original_gid> | perl -e '$ug = @ARGV[0]; foreach $fn (<STDIN>) { chomp($fn);$m = (stat($fn))[2];chown(-1,$ug,$fn);chmod($m,$fn)}' <new_gid># find / -not -path '/proc*' -gid <original_gid> | perl -e '$ug = @ARGV[0]; foreach $fn (<STDIN>) { chomp($fn);$m = (stat($fn))[2];chown(-1,$ug,$fn);chmod($m,$fn)}' <new_gid>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding command, replace <original_gid> with the old GID and replace <new_gid> with the new GID. For example, to reassign file and directory permissions from GID
53to GID410, enter the following command:find / -not -path '/proc*' -gid 53 | perl -e '$ug = @ARGV[0]; foreach $fn (<STDIN>) { chomp($fn);$m = (stat($fn))[2];chown(-1,$ug,$fn);chmod($m,$fn)}' 410# find / -not -path '/proc*' -gid 53 | perl -e '$ug = @ARGV[0]; foreach $fn (<STDIN>) { chomp($fn);$m = (stat($fn))[2];chown(-1,$ug,$fn);chmod($m,$fn)}' 410Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
To restart JBoss Web Server as the
tomcatuser, see Starting JBoss Web Server from the command line when installed from an archive file.