Install and Configure WildFly (JBoss7) App Server on Ubuntu 20.04

Step 1: Install OpenJDK
sudo apt install openjdk-8-jdk
Step 2: Setup WildFly User
sudo groupadd -r wildfly
sudo useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
Step 3: Download and Configure WildFly
cd /tmp
wget https://download.jboss.org/wildfly/20.0.0.Final/wildfly-20.0.0.Final.tar.gz
tar xvf wildfly-20.0.0.Final.tar.gz
sudo mkdir /opt/wildfly
sudo mv wildfly-20.0.0.Final/ /opt/wildfly
sudo chown -RH wildfly: /opt/wildfly
Step 4: create WildFly service
sudo mkdir -p /etc/wildfly
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/
sudo sh -c ‘chmod +x /opt/wildfly/bin/
.sh’
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/
sudo systemctl enable wildfly.service
sudo systemctl stop/start/status wildfly.service
undefined
run the commands below to create a user account that will connect and manage the app server web console:
sudo /opt/wildfly/bin/add-user.sh

step 5: enable admin console remote login
Out of the box, the server console is restricted to the local server only… If you’d like to connect from a remote location, Open it’s configuration file by running the commands below:
edit /etc/wildfly/wildfly.conf as below:

# The configuration you want to run
WILDFLY_CONFIG=standalone.xml
# The mode you want to run
WILDFLY_MODE=standalone
# The address to bind to
WILDFLY_BIND=0.0.0.0
#WildFly Console bind 
WILDFLY_CONSOLE_BIND=0.0.0.0

edit /opt/wildfly/bin/launch.sh as below:

#!/bin/bash
if [ "x$WILDFLY_HOME" = "x" ]; then
    WILDFLY_HOME="/opt/wildfly"
fi
if [[ "$1" == "domain" ]]; then
    $WILDFLY_HOME/bin/domain.sh -c $2 -b $3 -bmanagement $4
else
    $WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement $4
fi

edit /etc/systemd/system/wildfly.service as below:

[Unit]
Description=The WildFly Application Server
After=syslog.target network.target
Before=httpd.service

[Service]
Environment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnvironmentFile=-/etc/wildfly/wildfly.conf
User=wildfly
LimitNOFILE=102642
PIDFile=/var/run/wildfly/wildfly.pid
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_CONSOLE_BIND
StandardOutput=null

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload
sudo systemctl restart wildfly.service
That’s it! You can now access the admin console remotely…
http://192.168.0.43:9990/console/index.html
undefined

Leave a Reply

Your email address will not be published. Required fields are marked *