Setup JBoss WildFly
WildFly is a lightweight application server with CLI and an admin console. In this tutorial, we will see different server modes and configurations of the JBoss WildFly application server.
- Setup Java
- Server Mode
- Deployment
- Server Configuration
- Monitoring
Setup Java
WildFly needs to setup Java environment variable as JAVA_HOME in order to setup JDK on the operating system and to fully configured WildFly 21 that is available on the official marketplace of RedHat.
Server Modes
WildFly application server has server modes that is divided into two categories by default:
- Standalone
- Domain
Standalone
Download WildFly as ZIP directory from the official website to your local repository and extract it. Later on, we need to execute the user script on Linux or Windows. It depends on your operating system that you have installed already on your computer.
DevOps engineer that usually installs WildFly on the deployment server should run the add-user.sh for Linux or add-user.bat for Windows on bin directory.
When DevOps engineers want as always to have a best practice for server management should use another account for server credentials in order to create them.
Note: This will be used ManagementRealm for the admin user in WildFly app server.
After changing the password, we need to run the startup script on WildFly which is standalone.sh for Linux and standalone.bat for Windows on bin directory.
The administration console will be the IP address on the local machine as always: http://127.0.0.1:9990 as shown in the output console window. The server is running...
Domain
The domain mode has multiple server instances being managed by a single host controller. The startup script is domain and not standalone as previously.
Follow the startup process as before, and the server instances will be running on http://127.0.0.1:8080/ and http://127.0.0.1:8456/
Deployment
In order to make a deployment process via WildFly and Spring Boot or any other Java application supported by RedHat application servers, should we use maven-war-plugin as always and is shown in the next slideshow:
Build the project:
$ mvn clean package
Deploy App
In order to make a deployment process on WildFly app server, software developers and DevOps engineers can upload the JAR, WAR or EAR files, but it depends on each system if it is a single Spring Boot application, JSF web application, Apache Wicket web application or many more options, and we follow the process as shown below:
Add -> Upload Deployment -> Choose a fileβ¦
This file always is saved on target directory, as Apache Maven saves it in order to make a deployment easier.
Server Configuration
Server Configuration Files
The admin console has the option to export the file in XML and using a consistent configuration through XML files simplifies managing multiple local or remote environments.
Monitoring
The command-line interface for WildFly app server allows for updating configuration values in the same way as on the administration console on the web browser.
If we want to use CLI, we execute:
jboss-cli.bat
on the bin directory.
Enter the command-line argument:
[disconnected /] connect
[domain@localhost:9990 /]
After connection that will be successful, we can access the configuration in real-time to our server instance.
The CLI toolkit is really useful and is also used for runtime stats of the server subsystems.