How to install Wildfly application server on Debian 11 Bullseye

0

Tutorial to learn the commands to install the latest version of WildFly (JBoss) on Debian 11 Bullseye using its repository and terminal.

Wildfly is an open source application server that was previously known as JBoss and it is the further development of JBoss under a new name. It is written in Java, so requires JDK support to install it; WildFly developed by RedHat to manage application execution and build applications.

The concept of application server management is based on a generic and untyped management API. Regardless of the management interface used, all modifications are kept and versioned. All server management interfaces are secure by default. These include a CLI, web administration console, native Java API, HTTP / JSON REST API, and JMX gateway.

Based on the Generic Management API, the CLI provides a complete view of all manageable resources on the server. A connection to a local or remote instance can be established with the script jboss-cli.sh Where jboss-cli.bat.

In summary, the CLI is a powerful tool for configuring and managing JBoss instances. The use of JVM-based scripting languages ​​allows integration into existing DevOps and monitoring tools. As an alternative to the CLI, other interfaces such as the web console or HTTP-based REST interfaces are also available.

Steps to install WildFly on Debian 11 Bullseye Linux

The steps shown here will be the same for Debian 10 Buster, Ubuntu 20.04, Linux Mint, and other similar operating systems based on Debian.

1. Updating the Apt system

We need to install a few packages using APT package manager, so it would be good to run the system update command once if you haven’t done so for a while. This will rebuild the APT cache.

sudo apt update

2. Install OpenJDK 11 by default

The default Open Java version available through the Debian repository is OpenJDK 11. Therefore, we opt for the same using the APT package manager command given below.

sudo apt install default-jdk

To confirm the Java version, you can use the given command:

java --version

3. Download WildFly on Debian 11 Bullseye

Well, just like many other open source tool packages, WildFly is also not available through the default Debian 11 base package repository. Therefore, we need to download its latest archive file available at the WildFly official site.

Go to the link then press the “Download LE TGZ”To get the archive file.

You can also right click on the button and select “Copy link address”. After that use it with wget order.

Example:

wget https://github.com/wildfly/wildfly/releases/download/26.0.0.Final/wildfly-26.0.0.Final.tar.gz

The downloaded file will contain the following:

Wildfly
Jakarta EE
Servlet distribution only
Application server source code
Source AL quick start source code
Release Notes

Now extract the archive that we downloaded in the previous step. Also, if you downloaded the WildFly through a browser, don’t forget to switch to the Downloads directory.

tar -xf wildfly-*.Final.tar.gz

To move to /opt directory, so that we don’t accidentally delete it.

sudo mv wildfly-*Final /opt/wildlfy

5. Creation of a dedicated WildFly user

To run the WildFly with a non-root user without sudo access, we create a separate user who will only have access to their files and folders.

Add group

sudo groupadd -r wildfly

Add a new user:

sudo useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly

6. Change owner

The directory where we copied the extracted files is under /opt, gives its authorization to WildFly users.

sudo chown -RH wildfly:wildfly /opt/wildfly

7. Configure WildFly (JBoss) running on Debian 11

Create the WildFly directory under / etc and copy some important configuration files like preconfigured service for Systemd to run the application server in the background of the system.

sudo mkdir -p /etc/wildfly

Copy the files:

sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/

8. Make the script executable

Now let’s make some script files executable to make them work on our Debian 11, required by WildFly to work properly.

Here are those:

add-user.sh, appclient.sh, common.sh, domain.sh, elytron-tool.sh, jboss-cli.sh, jconsole.sh, jdr.sh, launch.sh, standalone.sh, wsconsume.sh and wsprovide.sh.

sudo chmod +x /opt/wildfly/bin/*.sh

9. Start and activate the service

To have the WildFly application server run automatically with system startup; start and activate its service.

sudo systemctl enable --now wildfly
sudo systemctl daemon-reload

Check condition:

systemctl status wildfly

To stop or restart:

sudo systemctl restart wildfly
sudo systemctl stop wildfly

10. Create the WildFly management console and the application user

Then we run a script to either configure the “administrator”User or create a new one. Just run the given command:

sh /opt/wildfly/bin/add-user.sh

Create a debian WildFly administrator password

11. Configure the Wildfly Admin Hal management console

By default, you will not be able to access the administration interface because as you do, the system will display the following error:

Unable to redirect.

An automatic redirect to the Administration Console is not currently available. This is most likely due to the administration console being exposed over a network interface different from the one to which you are connected to.

To access the Administration console you should contact the administrator responsible for this WildFly installation and ask them to provide you with the correct address.

To remove this error and log into the management console on the system where you installed WildFly, edit its configuration file:

sudo nano /etc/wildfly/wildfly.conf

To replace 0.0.0.0 with 127.0.0.1 in the following line:

WILDFLY_BIND= 127.0.0.1

Restart the WildFly service:

sudo systemctl restart wildfly

Open port 8080 in the firewall:

If you are using a firewall, open the port:

sudo ufw allow 8080/tcp
sudo ufw allow 9090/tcp

Access the web interface, open your browser on the server or desktop where you installed this application server. And then point to-

http://127.0.0.1:8080

WildFly JBooss Web Interface

To access the Hal Management interface, you will first be asked to log in. Enter the user and password you created for the management interface.

Connection administration management interface

HAL Management Console Dashboard Interface

12. Access WildFly remotely

If you want to access this application server running on some Debian 11 or 10 servers. Then we need to make some changes first. Modify the standard configuration

Edit the configuration file:

sudo nano /opt/wildfly/standalone/configuration/standalone.xml

Scroll to the end of the file and find the Interfaces section and change the IP address of 127.0.0.1 at 0.0.0.0. After that save the file by pressing Ctrl + O, press the Enter, then Ctrl + X to leave. This will allow all machines that can access the server’s IP address to remotely access the WildFly web interface.

To note: For security reasons, if you want to link the public access of the management console to a particular trusted machine, then in the “Public”From the interface, link its address to the IP adress of the system through which you want to access it.



        


        

Now modify the front-end configuration file:

sudo nano /etc/wildfly/wildfly.conf

Again change the address to 0.0.0.0

Save the file.

Restart the server:

sudo systemctl restart wildfly

Once done, you can access your application server from any other computer by pointing to the IP address of the server you are running the WildFly on.

Other articles:

How to install the Cockpit Web Console on Debian 11 Bullseye
How to install MariaDB 10 on Debian 11 Bullseye Linux
Snap-on Linux – Install, Update, and Remove Commands


Source link

Share.

Comments are closed.