WildFly is a powerful, free and open-source server that helps you build amazing applications. It can be considered the next generation of JBoss AS server. In this article we will review the features of WildFly and help you about How to Install and Configure WildFly on Ubuntu 22.04. You can check and purchase Ubuntu VPS server packages provided on the Eldernode website.
Table of Contents
How to Install and Configure WildFly on Ubuntu
Features of WildFly
–> Configuring WildFly is simple and user-centric.
–> The WildFly has an aggressive approach to memory management. It can run with existing JVM settings as well as on small devices, while leaving more space for application data and supporting higher scalability.
–> WildFly implements the latest Jakarta EE and Eclipse Microprofile enterprise Java standards. This allows you to focus on the core business needs of your application.
In the continuation of this article from the Ubuntu training series, we intend to teach you step by step How to Install WildFly on Ubuntu 22.04.
How to Install WildFly on Ubuntu 22.04
First update the system using the following command before starting installation:
sudo apt update
Then install the default version of Open Java, which is available through the Ubuntu 22.04 OpenJDK 11 repository, using the following command:
sudo apt install default-jdk
Then confirm the Java version with the following command:
java --version
Now download the latest archive file from WildFly website by clicking the DOWNLOAD THE TGZ button. You can also right-click and select “Copy link address“. You can use it with the following command.
wget https://github.com/wildfly/wildfly/releases/download/26.0.0.Final/wildfly-26.0.0.Final.tar.gz
Run the following command to extract the downloaded file:
tar -xf wildfly-*.Final.tar.gz
To prevent the file from being deleted, run the following command:
sudo mv wildfly-*Final /opt/wildlfy
To run WildFly, we create a separate user who will only have access to its files and folders. Run the following commands to add User and Group:
sudo useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
sudo groupadd -r wildfly
Run the following command to allow WildFly users to access the /opt directory:
sudo chown -RH wildfly:wildfly /opt/wildfly
How to Configure WildFly on Ubuntu 22.04
To configure WilFly, create a WildFly directory under /etc:
sudo mkdir -p /etc/wildfly
Then copy the important configuration files to the system background:
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/
Make script files executable with the following command:
sudo chmod +x /opt/wildfly/bin/*.sh
How to Enable WildFly on Ubuntu 22.04
To run WildFly with system boot, use the following commands:
sudo systemctl enable --now wildfly
sudo systemctl daemon-reload
Run the following command to check status:
systemctl status wildfly
Then run the following commands to restart or stop WildFly:
sudo systemctl restart wildfly
sudo systemctl stop wildfly
To configure the existing admin user or create a new user, run the command below:
sh /opt/wildfly/bin/add-user.sh
How to Configure WildFly Admin Hal Management Console
If you try to access the Admin interface by default, you will encounter 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.
The configuration file should be edited to remove the above error and login to Management console, for this purpose run the following command:
sudo nano /etc/wildfly/wildfly.conf
Then apply the changes as shown below:
WILDFLY_BIND= 127.0.0.1
To:
WILDFLY_BIND= 0.0.0.0
Then run the command below to restart the WildFly service:
sudo systemctl restart wildfly
Next, open the port of Firewall and run the following commands:
sudo ufw allow 8080/tcp
sudo ufw allow 9090/tcp
Open the following address in the server or desktop browser:
http://127.0.0.1:8080
Click on the Administration Console according to the image below:
Login to access the Hal Management interface:
How to Access WildFly Remotely on Ubuntu 22.04
To access this software on some Ubuntu 22.04 servers, you should first edit the configuration file:
sudo nano /opt/wildfly/standalone/configuration/standalone.xml
From the Interfaces section of the file, change the IP address from 127.0.0.1 to 0.0.0.0. Then press Ctrl+O to save the file, press Enter and then Ctrl+X to exit. This way, all machines that have access to the IP address of the server can receive the WilFly web interface remotely.
If you want to allow access to a specific machine in the Management Console, in the public section of the interface, link its address to the IP address of the selected system:
<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:0.0.0.0}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:0.0.0.0}"/> </interface> </interfaces>
Edit the front end configuration file according to the following command, then change the address to 0.0.0.0 and save the file:
sudo nano /etc/wildfly/wildfly.conf
Finally restart the server using the command below:
sudo systemctl restart wildfly
Conclusion
In this article, we introduced the features of WildFly, which is a powerful, free and open-source server. Also you learned How to install and Configure WildFly on Ubuntu 22.04 and ways to access WildFly on Ubuntu 22.04 were reviewed.