WildFly
WildFly is a Java application server. It was previously known as JBoss AS.
Installation¶
Initial Configuration¶
Replace X with the given WildFly version.
fetch -o wildfly.tar.gz http://download.jboss.org/wildfly/X.Final/wildfly-X.Final.tar.gz
- Extract:
mkdir wildfly && gtar zxvf wildfly.tar.gz -C wildfly --strip-components=1
- Reserve 7 TCP ports. For clarity, each port is described:
devil port add tcp NUM1 wf_jb_mngmnt_http
devil port add tcp NUM2 wf_jb_mngmnt_https
devil port add tcp NUM3 wf_jb_ajp
devil port add tcp NUM4 wf_jb_http
devil port add tcp NUM5 wf_jb_https
devil port add tcp NUM6 wf_txn_rec_env
devil port add tcp NUM7 wf_txn_stat_man
Replace NUM1–NUM7 with the reserved port numbers. Ports can also be reserved using DevilWEB.
WildFly Configuration¶
Edit the file wildfly/standalone/configuration/standalone.xml
. You can use any text editor: nano, vi, ee, mcedit. Insert the reserved port numbers in place of NUM1–NUM7.
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:NUM1}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:NUM2}"/>
<socket-binding name="ajp" port="${jboss.ajp.port:NUM3}"/>
<socket-binding name="http" port="${jboss.http.port:NUM4}"/>
<socket-binding name="https" port="${jboss.https.port:NUM5}"/>
<socket-binding name="txn-recovery-environment" port="NUM6"/>
<socket-binding name="txn-status-manager" port="NUM7"/>
Starting the Server¶
Run the application:
./wildfly/bin/standalone.sh &
Creating a WildFly User¶
To create a WildFly application user, run the command:
wildfly/bin/add-user.sh
Automatic Startup After Server Reboot¶
Add a Cron job to restart WildFly in case of a server reboot:
echo @reboot /usr/local/bin/bash /home/${USER}/wildfly/bin/standalone.sh | crontab -
Deployment¶
Procedure¶
Run the WildFly command line:
$ wildfly/bin/jboss-cli.sh
Connect to the port designated as NUM1.
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /]
connect`` ``localhost:NUM1
Deploy a .war file by providing its path:
[standalone@localhost:NUM1 /] deploy [path_to_file.war]
Accessing the Application on Ports 80/443¶
To make the application accessible externally beyond localhost, use the devil tool to add a proxy-type domain:
devil www add
target_domain
proxy localhost
NUM4
/
war_file_name_without_extension
Where target_domain is the name of your domain or subdomain, and NUM4 is the HTTP port configured for the application. A proxy page can also be added through DevilWEB.
Example of Running an Application¶
cd ~
git clone
https://github.com/wildfly/quickstart.git
cd ~/quickstart/helloworld && mvn clean package
~/wildfly/bin/jboss-cli.sh
[disconnected /]
connect`` ``localhost:NUM1
[standalone@localhost:NUM1 /]
deploy``
``~/quickstart/helloworld/target/helloworld.war
devil www add
domena_docelowa
proxy localhost
NUM4
/helloworld
Remote Access to the WildFly Web Console¶
To enable remote access to the WildFly web console, add a proxy-type site pointing to the port marked as NUM1 (wf_jb_mngmnt_http).
devil www add
domena_docelowa
proxy localhost
NUM1