8

Install JBoss EAP 7.x on CentOS 8|RHEL 8|Rocky Linux 8

 2 years ago
source link: https://computingforgeeks.com/install-jboss-eap-on-centos-rhel-rocky-linux/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Install JBoss EAP 7.x on CentOS 8|RHEL 8|Rocky Linux 8

This guide aims to demonstrate how to install JBoss EAP 7.x on CentOS 8|RHEL 8|Rocky Linux 8. But before we dive into the nub of this matter, we will elucidate and get to know what JBoss EAP is all about.

What is JBoss EAP?

JBoss EAP is an open-source Java-based application server whose main function is to build, deploy and host highly-transactional Java applications and services. JBoss is developed and maintained by RedHat. This middleware platform is built in compliance with the Java Enterprise Edition 7 specification. One of the main features related to JBoss EAP is its ability to enable a service only when required hence improving the startup speed.

There are two operating modes for JBoss EAP:

  • JBoss EAP standalone server – this basicaly represents running JBoss EAP on a single server instance
  • JBoss EAP managed domain – Here, multiple JBoss EAP instances are managed from a single control point.

Features of JBoss EAP

The key features associated with JBoss EAP are:

  • Supports Java EE and Web Services standards
  • Eclipse-based Integrated Development Environment (IDE) is available using JBoss Developer Studio
  • Caching, clustering, and high availability, are provided by the subsystem Infinispan (formely JBoss Cache)
  • Web application services, including Apache Tomcat for JavaServer Pages (JSP) and Java Servlets
  • Integration and messaging services, including J2EE Connector Architecture (JCA), Java Database Connectivity (JDBC), and Java Message Service (JMS)
  • Management and Service-Oriented Architecture (SOA) using Java Management Extensions (JMX)
  • Security services, including Java Authentication and Authorization Service (JAAS) and pluggable authentication modules (PAM)
  • Additional administration and monitoring features are available using JBoss Operations Network
  • EJB that includes JNDI and RMI
  • Java persistence using Hibernate
  • Object request broker (ORB) using JacORB for interoperability with CORBA objects

With the above knowledge about JBoss EAP, we are set to dive into the installation.

Install JBoss EAP 7.x on CentOS 8|RHEL 8|Rocky Linux 8

This guide demonstrates how to install JBoss EAP 7.x on CentOS 8|RHEL 8|Rocky Linux 8 using the JBoss EAP using the JBoss Installer.

1. Install Java Development Kit (JDK)

First, you are required to meet the requirement of installing a supported Java Development Kit (JDK). In this guide, we will choose to install OpenJDK 11 which is compatible with JBoss EAP 7.x.

Install OpenJDK 11 on CentOS 8|RHEL 8|Rocky Linux 8 as below.

sudo yum install java-11-openjdk-devel

Dependency tree:

Dependencies resolved.
================================================================================
 Package                  Arch   Version                        Repo       Size
================================================================================
Installing:
 java-11-openjdk-devel    x86_64 1:11.0.13.0.8-3.el8_5          appstream 3.4 M
Installing dependencies:
 copy-jdk-configs         noarch 4.0-2.el8                      appstream  29 k
 java-11-openjdk          x86_64 1:11.0.13.0.8-3.el8_5          appstream 265 k
 java-11-openjdk-headless x86_64 1:11.0.13.0.8-3.el8_5          appstream  39 M
 javapackages-filesystem  noarch 5.3.0-2.module+el8.3.0+125+5da1ae29
                                                                appstream  29 k
 lksctp-tools             x86_64 1.0.18-3.el8                   baseos     98 k
 ttmkfdir                 x86_64 3.0.9-54.el8                   appstream  61 k
 tzdata-java              noarch 2021e-1.el8                    appstream 190 k
 xorg-x11-fonts-Type1     noarch 7.5-19.el8                     appstream 521 k
Enabling module streams:
 javapackages-runtime            201801                                        

Transaction Summary
================================================================================
Install  9 Packages

Total download size: 44 M
Installed size: 178 M
Is this ok [y/N]: y

Verify the installed Java version on your system.

$ java --version
openjdk 11.0.13 2021-10-19 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8-LTS, mixed mode, sharing)

2. Download JBoss EAP 7.x on CentOS 8|RHEL 8|Rocky Linux 8

To download JBoss EAP 7.x, you are required to create a RedHat account. Then log into the account with the created credentials. Click on downloads and on the list under RUNTIMES, select the Red Hat JBoss Enterprise Application Platform as shown below.

Then select the desired JBoss EAP version.

Click on download and the JBoss EAP Jar file will be pulled.

3. Install JBoss EAP 7.x on CentOS 8|RHEL 8|Rocky Linux 8

With the Jar file successfully downloaded, you can install it using the GUI or console method if you do not have GUI on your CentOS 8|RHEL 8|Rocky Linux.

First, move the JBoss EAP Jar file to your $HOME directory.

cd Downloads
sudo mv jboss-eap-7.4.0-installer.jar $HOME 

Run JBoss EAP 7.x installer on CentOS 8|RHEL 8|Rocky Linux 8 using the console as below.

cd $HOME 
java -jar jboss-eap-7.4.0-installer.jar -console

Proceed to language selection as below.

Select your language below : 
0: English
1: 中文
2: Deutsch
3: français
4: 日本語
5: português
6: español
Please choose [0] : 0

Read through and agree to the End User License Agreement as below.

END USER LICENSE AGREEMENT
 RED HAT JBOSS(r) MIDDLEWARE(tm)
PLEASE READ THIS END USER LICENSE AGREEMENT CAREFULLY BEFORE USING SOFTWARE FROM RED HAT. BY USING RED HAT SOFTWARE, YOU SIGNIFY YOUR ASSENT TO AND ACCEPTANCE OF THIS END USER LICENSE AGREEMENT AND ACKNOWLEDGE YOU HAVE READ AND UNDERSTAND THE TERMS. AN INDIVIDUAL ACTING ON BEHALF OF AN ENTITY REPRESENTS THAT HE OR SHE HAS THE AUTHORITY TO ENTER INTO THIS END USER LICENSE AGREEMENT ON BEHALF OF THAT ENTITY. IF YOU DO NOT ACCEPT THE TERMS OF THIS AGREEMENT, THEN YOU MUST NOT USE THE RED HAT SOFTWARE. THIS END USER LICENSE AGREEMENT DOES NOT PROVIDE ANY RIGHTS TO RED HAT SERVICES SUCH AS SOFTWARE MAINTENANCE, UPGRADES OR SUPPORT. PLEASE REVIEW YOUR SERVICE OR SUBSCRIPTION AGREEMENT(S) THAT YOU MAY HAVE WITH RED HAT OR OTHER AUTHORIZED RED HAT SERVICE PROVIDERS REGARDING SERVICES AND ASSOCIATED PAYMENTS. 
This end user license agreement (EULA) governs the use of the Red Hat JBoss Middleware and any related updates, source code, appearance, structure and organization (the Programs), regardless of the delivery mechanism. 
.......
opyright (c) 2013 Red Hat, Inc. All rights reserved. Red Hat, JBoss and the JBoss logo are registered trademarks of Red Hat, Inc. All other trademarks are the property of their respective owners. 
press 1 to continue, 2 to quit, 3 to redisplay.1

Then set the desired PATH for JBoss EAP, you can also define your own JBoss EAP_HOME path.

Select the installation path:  [/home/thor/EAP-7.4.0] Press Enter
press 1 to continue, 2 to quit, 3 to redisplay. 
1

Now choose the JBoss EAP pack to install, packs with the Required argument are mandatory

Select the packs you want to install:
1    [x] [Required]      [Red Hat JBoss Enterprise Application Platform] (33.15 MB)
2    [x]                 [AppClient] (31.93 KB)
3    [x]                 [Docs] (19.94 MB)
4    [x] [Required]      [Modules] (195.61 MB)
5    [x] [Required]      [Welcome Content] (2.1 MB)
Total Size Required: 250.83 MB
Press 0 to confirm your selections
Please select which packs you want to install
0

Once selected, press 0 to confirm and then 1 to proceed. Next, create an admin user to be used to log in to the Web interface or CLI.

Set your preferred password for the admin user.

Create an Administrative User
This user will be added to the host container's management realm for administrative purposes. It can be used to access the management console, the management CLI, or other applications secured in this realm.

For minimal security, the password should be at least eight characters long, with one alphabetic character, one digit, and one non-alphanumeric symbol excluding "&".

Admin username: [admin] 
admin

Admin password: [] 
*********
Confirm admin password: [********] 
********

Choose the configuration, select the default configuration which can be customized later.

Configure Runtime Environment
There are several additional options for configuring Red Hat JBoss Enterprise Application Platform now that the server has been installed. Each option can be individually chosen, and will be configured in the order displayed upon pressing "Next". What would you like to do now?
0  [x] Perform default configuration
1  [ ] Perform advanced configuration
Input Selection: 
Press Enter 

You can generate an automation script by typing Y. This script can be used to do another JBoss EAP installation with similar configurations.

[ Starting processing ]
Starting process Logging installation information (1/3)
IzPack variable state written to /home/thor/EAP-7.4.0/installation/InstallationLog.txt
Starting process Adding admin user (2/3)
Starting process Cleanup extraneous folders and tepmorary files (3/3)

Create shortcuts in the start menu (y/n) [y]:y
Select a program group for the shortcuts: [JBoss Platform]:

[ Creating shortcuts ....... ]
Installation has completed successfully.
Application installed on /home/thor/EAP-7.4.0

Would you like to generate an automatic installation script and properties file? (y/n) [n]:
y
Select path for the automatic installation script: [/home/thor/EAP-7.4.0/auto.xml] 

XML written successfully.
[ Console installation done ]

Your console installation is now complete.

4. Starting JBOSS EAP on CentOS 8|RHEL 8|Rocky Linux 8

JBoss EAP can be started in a standalone mode by running the standalone.shin the EAP_HOME/bin as below.

## For Localhost
$HOME/EAP-7.4.0/bin/standalone.sh

JBoss EAP will start as below.

=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/thor/EAP-7.4.0

  JAVA: java

  JAVA_OPTS:  -server -Xlog:gc*:file="/home/thor/EAP-7.4.0/standalone/log/gc.log":time,uptimemillis:filecount=5,filesize=3M -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED

=========================================================================

03:32:09,659 INFO  [org.jboss.modules] (main) JBoss Modules version 1.11.0.Final-redhat-00001
03:32:10,024 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final-redhat-00001
.....
3:32:13,503 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.0.GA (WildFly Core 15.0.2.Final-redhat-00001) started in 4194ms - Started 317 of 556 services (343 services are lazy, passive or on-demand)
03:32:13,504 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
03:32:13,505 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990

Here you can access the web console using the URL http://127.0.0.1:9990

Allow the port through the firewall.

sudo firewall-cmd --zone=public --permanent --add-port=9990/tcp 
sudo firewall-cmd --reload

To be able to manage our web application, we are required to access the JBoss EAP management console, by default, the page will run on 127.0.0.1 but we can alter this by adding the IP Address as below.

##For a Specific IP Address
$HOME/EAP-7.4.0/bin/standalone.sh -b 192.168.205.2 -bmanagement 192.168.205.2

Sample Output:

=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/thor/EAP-7.4.0

  JAVA: java

  JAVA_OPTS:  -server -Xlog:gc*:file="/home/thor/EAP-7.4.0/standalone/log/gc.log":time,uptimemillis:filecount=5,filesize=3M -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED

=========================================================================

03:41:41,307 INFO  [org.jboss.modules] (main) JBoss Modules version 1.11.0.Final-redhat-00001
03:41:41,650 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final-redhat-00001
.........
03:41:45,082 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://192.168.205.2:9990/management
03:41:45,083 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://192.168.205.2:9990

Now using the URL http://IP_address:9990, access the management console and log in using the credentials created earlier.

On successful authentication, you will be able to see this dashboard.

From here, you can now proceed to build, deploy and host your Java applications using JBoss EAP.

5. Manage JBoss EAP as a Service

This will enable us to start, stop, restart and enable the JBoss EAP service just like any other service on CentOS 8|RHEL 8|Rocky Linux 8.

Edit the below file

vim $HOME/EAP-7.4.0/bin/init.d/jboss-eap.conf

In the file, uncomment and edit the JBOSS_HOME parameter and JBOSS_USER to manage the service as below.

## Location of JBoss EAP
JBOSS_HOME="/home/thor/EAP-7.4.0"

## The username who should own the process.
JBOSS_USER=thor

Remember to replace the JBoss_HOME path and JBOSS_USER with your system user to manage the JBoss EAP service.

Copy the file to /etc/default.

sudo cp $HOME/EAP-7.4.0/bin/init.d/jboss-eap.conf /etc/default/

Also, copy the jboss-eap-rhel.sh file to the /etc/init.d as below and make it executable

sudo cp $HOME/EAP-7.4.0/bin/init.d/jboss-eap-rhel.sh /etc/init.d
sudo chmod +x /etc/init.d/jboss-eap-rhel.sh

Add the new jboss-eap-rhel.sh service

sudo chkconfig --add jboss-eap-rhel.sh

Now start and enable the JBoss EAP service to run on boot.

sudo service jboss-eap-rhel start
sudo chkconfig jboss-eap-rhel.sh on

Verify if the service is running correctly.

$ systemctl status jboss-eap-rhel
● jboss-eap-rhel.service - SYSV: JBoss EAP startup script
   Loaded: loaded (/etc/rc.d/init.d/jboss-eap-rhel.sh; generated)
   Active: active (running) since Fri 2021-12-03 05:44:27 EST; 12s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 44469 ExecStart=/etc/rc.d/init.d/jboss-eap-rhel.sh start (code=exite>
 Main PID: 44607 (java)
    Tasks: 118 (limit: 36438)
   Memory: 324.6M
   CGroup: /system.slice/jboss-eap-rhel.service
           ├─44488 /bin/sh /home/thor/EAP-7.4.0/bin/standalone.sh -c standalone>
           └─44607 java -D[Standalone] -server -Xlog:gc*:file=/home/thor/EAP-7.>

Dec 03 05:44:22 localhost.localdomain systemd[1]: Starting SYSV: JBoss EAP star>
Dec 03 05:44:22 localhost.localdomain runuser[44486]: pam_unix(runuser:session)>
Dec 03 05:44:22 localhost.localdomain runuser[44486]: pam_unix(runuser:session)>
Dec 03 05:44:22 localhost.localdomain jboss-eap-rhel.sh[44469]: Starting jboss->
Dec 03 05:44:27 localhost.localdomain jboss-eap-rhel.sh[44469]: [  OK  ]

Conclusion

That is it for now! I hope you were able to install JBoss EAP 7.x on CentOS 8|RHEL 8|Rocky Linux 8 with the aid of this guide.

Interested in more?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK