Install JBoss EAP using the JBoss EAP installer file(JAR file).
| Resources | |
|---|---|
| Files |
/home/student/jboss-eap-7.4.0-installer.jar
|
| Application URL | http://localhost:8080 |
Outcomes
You should be able to install an instance of JBoss EAP 7.
Use the following command to download the relevant lab files, and to verify that no prior JBoss EAP installation exists:
[student@workstation ~]$ lab start features-installing
Instructions
JBoss EAP can be installed in multiple ways. However, for the purposes of this lab, the JAR-based GUI installer is the simplest. The procedure is the same on different operating systems, such as Windows, GNU/Linux, and Mac OS X.
The JBoss EAP installer is a GUI based application that unzips the JBoss EAP server files on your workstation, and helps you set up an administrator user for managing JBoss EAP.
You need to run the installer with root privileges, because you install JBoss EAP into the /opt directory on your workstation.
Start the JBoss EAP GUI Installer:
Open a terminal window and configure Java 8 as the default Java version in RHEL.
The JBoss EAP GUI installer only runs with Java 8.
[student@workstation ~]$sudo alternatives --config javaThere are 2 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.14.1.1-6.el9.x86_64/bin/java)2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-9.el9.x86_64/jre/bin/java)
Press the number corresponding to the Java 8 version, and then press Intro.
Run the installer by executing the following command:
[student@workstation ~]$sudo java -jar \jboss-eap-7.4.0-installer.jar
The JBoss EAP installer supports a number of languages. For this course, select , which is the default option, and click . Then, select the checkbox.
Briefly read through and accept the End User License Agreement (EULA). Then, click .
For the installation path, use:
/opt/jboss-eap-7.4
Then, click .
Complete the GUI Installer:
The Component Selection screen shows which packs (server components) are going to be installed. The AppClient and Docs packs are optional and can be unselected. The AppClient is a set of files used to start JBoss EAP programmatically. The Docs pack contains some configuration file templates for usage. Click the button to continue without changing the default values.
![]() |
You need to create an administrative user to access the JBoss EAP Management Console and manage the JBoss EAP server after installation.
Use admin as the username and redhat123 for the user password.
Click .
Then, click in the validation warning window.
Review the information entered so far and click the button to continue.
![]() |
The JBoss EAP installer installs selected components. After the installation is complete, you should see the following screen:
![]() |
Click the button to continue.
You can customize the JBoss EAP installation and select the subsystems that you want to install in this screen. For the purposes of this lab, select and click .
![]() |
Some post-install tasks execute. When the post-install tasks finish, review the information and click .
On the final step of the wizard, click .
Save the file as myinstall.xml at the /opt/jboss-eap-7.4 directory, which is the default.
This myinstall.xml file can be used by an administrator to automatically perform an JBoss EAP installation by using the selected options without running the installer again.
Click the button to close the installer.
Verify that you now have a directory named jboss-eap-7.4 under your /opt directory.
This directory is referred to as JBOSS_HOME.
You need to set an environment variable called JBOSS_HOME pointing to the JBoss EAP installation directory.
That variable is used by various scripts to locate where JBoss EAP is installed.
Similarly, change the PATH variable to run JBoss EAP scripts in the JBOSS_HOME/bin directory from any directory. In order to set these variables, open /home/student/.bashrc with your preferred text editor and add the following lines at the end of the file:
JBOSS_HOME=/opt/jboss-eap-7.4 PATH=$PATH:$JBOSS_HOME/bin export JBOSS_HOME PATH
Logout and login as student to make these changes visible for the student user.
You need to create a user called jboss to start and run JBoss EAP.
The -r flag is used to create a system user.
Run the following command:
[student@workstation ~]$ sudo useradd -r jbossTo verify if the user is a system account, run the following command:
[student@workstation ~]$ id jbossThe UID from the jboss user should be a number below 1000.
The JBOSS_HOME directory needs to be owned by this user.
[student@workstation ~]$ sudo chown -R jboss:jboss /opt/jboss-eap-7.4Open the file JBOSS_HOME/myinstall.xml as root using sudo.
This is the file created when you clicked the button at the last step of the installer wizard.
You can use this file to install another JBoss EAP instance with the same settings.
Open the /opt/jboss-eap-7.4/myinstall.xml file and inspect the value of the installpath attribute.
Inspect also the following two lines:
<entry key="adminUser" value="admin"> <entry autoPrompt="true" key="adminPassword">
Instead of hard coding the admin password in the file directly, it is set in the myinstall.xml.variables file.
Open the file /opt/jboss-eap-7.4/myinstall.xml.variables as root using sudo and add redhat123 as the value for the adminPassword property.
Verify that the $JBOSS_HOME/uninstaller directory exists.
This directory must contain a single executable JAR file named uninstaller.jar.
Start JBoss EAP standalone server
Configure the workstation machine operating system to use Java 11 again.
[student@workstation ~]$sudo alternatives --config javaThere are 2 programs which provide 'java'. Selection Command -----------------------------------------------* 1 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.14.1.1-6.el9.x86_64/bin/java)+ 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-9.el9.x86_64/jre/bin/java)
Press the number corresponding to the Java 11 version, and the press Intro.
On the workstation VM, enter the following command to start JBoss EAP standalone server as the jboss user.
On RHEL:
[student@workstation ~]$ sudo -u jboss /opt/jboss-eap-7.4/bin/standalone.sh
...output omitted...
05:38:56,424 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.0.GA (WildFly Core 15.0.2.Final-redhat-00001) started in 3311ms - Started 317 of 556 services (343 services are lazy, passive or on-demand)
...output omitted...JBoss EAP 7 starts up very quickly. It should be up and running within 3-5 seconds.
Verify JBoss EAP is running:
Point your web browser to http://localhost:8080. You should see the following welcome page:
![]() |
The page you are viewing is the index.html page found in JBOSS_HOME/welcome-content.
Shutdown the JBoss EAP 7 server by pressing Ctrl+C in the terminal window where you started JBoss EAP 7.
Apply the provided patch to the JBoss EAP instance.
In the same terminal run the following command.
[student@workstation ~]$sudo /opt/jboss-eap-7.4/bin/jboss-cli.sh\--command="patch apply /home/student/jboss-eap-7.4.11-patch.zip"{ "outcome" : "success", "result" : {} }
Start JBoss EAP again to test that the version number is 7.4.11.
[student@workstation ~]$sudo -u jboss /opt/jboss-eap-7.4/bin/standalone.sh...output omitted... 06:15:25,984 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP7.4.11.GA(WildFly Core 15.0.26.Final-redhat-00001) started in 4490ms - Started 318 of 557 services (343 services are lazy, passive or on-demand) ...output omitted...
Shutdown the JBoss EAP 7 server by pressing Ctrl+C in the terminal window where you started JBoss EAP 7.
(Optional) Configure JBoss EAP to start as a service.
In a production environment, starting up JBoss EAP from the command line is not usual because it requires manual intervention. To avoid the need of running a command from a bash script, you can install JBoss EAP as a service to initialize JBoss EAP during the boot time from an OS. In the following steps, a set of commands is executed to achieve this goal.
Inspect the script responsible for starting and stopping JBoss EAP.
The file is provided by JBoss EAP in the JBOSS_HOME/bin/init.d directory, and it is responsible for verifying that JBoss EAP is running, starting JBoss EAP, and loading a configuration file to customize the JBoss EAP runtime environment.
Open the /opt/jboss-eap-7.4/bin/init.d/jboss-eap-rhel.sh file with your favorite text editor as the jboss user by using sudo -u jboss <textEditor>.
The script starts JBoss EAP as a background process, creating a process identifier (PID) file, starting it as a specific user, generating a log file to a defined place, and running JBoss EAP standalone server, or in a managed domain. In order to allow some customization, a configuration file with environment variables is loaded to identify the directories and configuration files used by an JBoss EAP instance.
The initscripts RHEL package is not installed in RHEL 9 by default.
Some JBoss EAP scripts use functions from that package. Verify the installation of that package by using the following command:
[student@workstation ~]$ dnf list installed | grep initscripts
initscripts.x86_64 ...
initscripts-rename-device.x86_64 ...
initscripts-service.noarch ...Inspect the init script configuration file available at /opt/jboss-eap-7.4/bin/init.d/jboss-eap.conf with your favorite text editor as the jboss user using sudo -u jboss <textEditor>, to evaluate its contents.
The configuration file defines environment variables, such as the following ones:
JBOSS_HOME: Points to the directory where JBoss EAP is installed.
JAVA_HOME: Points to the directory where the Java is installed.
JBOSS_USER: the operating system user responsible for running the JBoss EAP process.
JBOSS_MODE: the managing way of JBoss EAP: standalone server mode, or in managed domain mode.
The environment variables are clearly documented by comments in the file.
Remove the # in front of each variable and update the following environment variables:
JAVA_HOME: "/etc/alternatives/java_sdk"
JBOSS_HOME: "/opt/jboss-eap-7.4"
JBOSS_USER: jboss
JBOSS_MODE: standalone
JBOSS_CONFIG: standalone.xml
JBOSS_CONSOLE_LOG: "/var/log/jboss-eap/console.log"
Copy the file jboss-eap.conf file to the /etc/default directory by running the following command:
[student@workstation ~]$sudo cp \/opt/jboss-eap-7.4/bin/init.d/jboss-eap.conf \/etc/default/jboss-eap.conf
To make the init script visible for systemctl, you must store the script at the /etc/init.d directory with execution permission.
Copy the jboss-eap-rhel.sh file to the /etc/init.d directory with jboss-eap as the file name, and change its permission to be executable by running the following commands:
[student@workstation ~]$sudo cp \/opt/jboss-eap-7.4/bin/init.d/jboss-eap-rhel.sh \/etc/init.d/jboss-eap[student@workstation ~]$sudo chmod 755 /etc/init.d/jboss-eap
To make the script on the host part of the current systemctl
configuration, run the following command:
[student@workstation ~]$ sudo systemctl daemon-reloadTo trigger the JBoss EAP startup during the boot process, run the following command:
[student@workstation ~]$ sudo systemctl enable jboss-eapTo verify if the setup was successful, run:
[student@workstation ~]$ sudo systemctl start jboss-eapor reboot the system.
Access the JBoss EAP instance by opening a web browser and accessing http://localhost:8080 .
To make sure this service does not conflict with the next laboratories, disable and stop the service by running:
[student@workstation ~]$sudo systemctl disable jboss-eap[student@workstation ~]$sudo systemctl stop jboss-eap