How to install JBoss EAP – step-by-step guide

How to install JBoss EAP – step by step guide

Introduction

In this article we will discuss step-by-step guide to install JBoss EAP. Here we will install the JBoss EAP on a Linux (RHEL) machine.

JBoss EAP can be installed multiple ways –

  • ZIP installation (preferred) – installation binaries are in a ZIP file.
  • Installer installation – installation is done from JBoss EAP installer file
  • RPM installation – using Red Hat Package Manager. This requires subscription.

We will discuss the ZIP installation steps.

Prerequisite

Steps to install JBoss EAP manually

We will install JBoss EAP 7.4, you can apply similar steps for other version of JBoss. If there is change in major version of JBoss EAP (for example, if you install JBoss EAP 6.4), then you need to follow the official document from Red Hat and do the changes in the steps.

Step 1: Log into the Linux machine

This is the first step; log into the VM on which JBoss EAP will be installed.

Step 2: Download the binaries

Download the JBoss EAP binaries.

  1. To download the binaries, we need to create an account on Red Hat Customer Portal
  2. Once we create an account and log in, then we can download the binaries and put it in some repository like Nexus, JFrog artifactory etc.
  3. And finally, we can use curl command to download it from repository.

In our case, we have already downloaded it in the /opt directory.

[root@RHEL01 opt]# ls
jboss-eap-7.4.zip  jdk-18.0.2.1

Curl command to download,

curl -u “user:password” -X GET “URL_of_JBoss_EAP” -o jboss-eap-7.4.zip

Step 3: Unzip the binaries

After downloading the ZIP file, we need to unzip it.

Command to unzip,

[root@RHEL01 opt]# unzip jboss-eap-7.4.zip

After unzipping it will create a new folder.

[root@RHEL01 opt]# ls
jboss-eap-7.4  jboss-eap-7.4.zip  jdk-18.0.2.1

Step 4: Create a user for JBoss EAP

We need to create a user for JBoss EAP to run.

[root@RHEL01 opt]# useradd jboss-user

After creating the jboss user, we need to change the owner & group of the JBoss EAP folder.

[root@RHEL01 opt]# chown -R jboss-user:jboss-user jboss-eap-7.4/

Step 5: Edit JBoss EAP configuration file

We need to edit the /opt/jboss-eap-7.4/bin/init.d/jboss-eap.conf file. Below lines need to be added –

  • JAVA_HOME=/opt/jdk-18.0.2.1
  • JBOSS_HOME=/opt/jboss-eap-7.4
  • JBOSS_USER=jboss-user

You need to modify the above values according to your environment. After adding the above lines, save the file.

If you want to install Java through automation, then head over to below article –

Automation of Java installation – using Ansible

Step 6: Update /etc/profile file

Now we need to edit the /etc/profile file. We need to add the below line.

  • export JBOSS_HOME=/opt/jboss-eap-7.4
  • export PATH=$PATH:$JBOSS_HOME/bin

Once you added the above line and save the file, then run the below command to reload the profile.

[root@RHEL01 ~]# source /etc/profile

Now we should get below output.

[root@RHEL01 ~]# echo $JAVA_HOME
/opt/jdk-18.0.2.1
[root@RHEL01 ~]# echo $JBOSS_HOME
/opt/jboss-eap-7.4

Step 7: Configuring JBoss EAP Service file

We need to copy the below two file.

  • Copy /opt/jboss-eap-7.4/bin/init.d/jboss-eap.conf file to /etc/default
  • Copy /opt/jboss-eap-7.4/bin/init.d/jboss-eap-rhel.sh file to /etc/init.d/

(Before copying the jboss-eap-rhel.sh file ensure that it has executable permission)

[root@RHEL01 init.d]# pwd
/opt/jboss-eap-7.4/bin/init.d
[root@RHEL01 init.d]#
[root@RHEL01 init.d]# ls
jboss-eap.conf  jboss-eap-rhel.sh
[root@RHEL01 init.d]#
[root@RHEL01 init.d]# cp jboss-eap.conf /etc/default/
[root@RHEL01 init.d]# cp jboss-eap-rhel.sh /etc/init.d/
[root@RHEL01 init.d]#

Next, we need to run below two commands –

[root@RHEL01 opt]# restorecon /etc/init.d/jboss-eap-rhel.sh
[root@RHEL01 opt]# chkconfig --add jboss-eap-rhel.sh

Step 8: Start JBoss EAP service

Run the below commands to enable JBoss EAP service.

[root@RHEL01 opt]# systemctl enable jboss-eap-rhel
[root@RHEL01 opt]# systemctl start jboss-eap-rhel

Step 9: Check the status of JBoss EAP

Run the below command to check the status of JBoss EAP service.

[root@RHEL01 opt]# systemctl status jboss-eap-rhel

Output:

* jboss-eap-rhel.service - SYSV: JBoss EAP startup script
   Loaded: loaded (/etc/rc.d/init.d/jboss-eap-rhel.sh; static; vendor preset: disabled)
   Active: active (running) since Sat 2022-11-26 07:24:02 UTC; 3h 25min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 6495 ExecStart=/etc/rc.d/init.d/jboss-eap-rhel.sh start (code=exited, status=0/SUCCESS)
    Tasks: 53 (limit: 23900)
   Memory: 428.0M
   CGroup: /system.slice/jboss-eap-rhel.service
           |-6514 /bin/sh /opt/jboss-eap-7.4/bin/standalone.sh -c standalone.xml
           `-6639 /opt/jdk-18.0.2.1/bin/java -D[Standalone] -server -Xlog:gc*:file=/opt/jboss-eap-7.4/standalone/log/gc.log:tim>

Nov 26 07:23:31 RHEL01 systemd[1]: Starting SYSV: JBoss EAP startup script...
Nov 26 07:23:31 RHEL01 runuser[6512]: pam_unix(runuser:session): session opened for user jboss-user by (uid=0)
Nov 26 07:23:31 RHEL01 runuser[6512]: pam_unix(runuser:session): session closed for user jboss-user
Nov 26 07:23:31 RHEL01 jboss-eap-rhel.sh[6495]: Starting jboss-eap: /
Nov 26 07:24:02 RHEL01 jboss-eap-rhel.sh[6495]: [  OK  ]
Nov 26 07:24:02 RHEL01 systemd[1]: Started SYSV: JBoss EAP startup script.

This is all for now, we have installed JBoss EAP successfully.

 

Thank You.

 

If you are interested in learning DevOps, please have a look at the below articles, which will help you greatly.