STMA: Installing WildFly 12

Get Java 8

Most of what I’ve seen online says to use Oracle Java 8, but as far as I can tell, WildFly 11 runs fine on OpenJDK. Also as far as I can tell, you only need the headless version of OpenJDK. Most of the installation information is available in the WildFly docs. * Arch Linux: unneeded (the AUR package takes care of this dependency) * CentOS 7: sudo yum install java-1.8.0-openjdk-headless

Get WildFly 12

Arch Linux

  1. git clone https://github.com/nstickney/wildfly-aur
  2. cd wildfly-aur && makepkg -si

CentOS 7

  1. cd /opt
  2. sudo curl -L http://download.jboss.org/wildfly/12.0.0.Final/wildfly-12.0.0.Final.tar.gz -o wildfly.tar.gz
  3. sudo tar xzf wildfly.tar.gz
  4. sudo ln -s /opt/wildfly-12.0.0.Final /opt/wildfly

Create the WildFly user and group

On Arch Linux, the steps below are taken care of by the installation scripts. These steps are required on CentOS 7 (and probably other distributions). 1. sudo groupadd -r -g 505 wildfly 1. sudo useradd -r -u 505 -g wildfly -d /opt/wildfly -s /sbin/nologin

Configure systemd

On Arch Linux, the steps below are taken care of by the installation scripts. These steps are required on CentOS 7 (and probably other distributions). 1. sudo mkdir /etc/wildfly && sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/ 1. sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/ 1. sudo cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/ && sudo chmod +x /opt/wildfly/bin/launch.sh

I prefer to have the WildFly management interface also listen on the network, at least in standalone mode. * sudo vim /etc/wildfly/wildfly.conf

...
# The management address to bind to
WILDFLY_MGMT_BIND=0.0.0.0
...
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_MGMT_BIND
...

Add a management user

Optional: set up TLS

From the Wildfly Docs.

Allow access through the host firewall

WildFly listens on ports 8080 (main) and 9990 (management) by default. If you enabled TLS in the previous step, it will listen on 8443 (main) and 9993 (management). I use the TLS ports below, so change that if you prefer other ports. You might also want to masquerade 8443 to 443, and redirect 80 to 443 using something like nginx….

CentOS 7

I use the setup described here; if you are using different zones, make changes as appropriate. * sudo firewall-cmd --permanent --zone=public --add-port=8443/tcp * sudo firewall-cmd --permanent --zone=internal --add-port=9993/tcp

Arch Linux

I use nftables on Arch; you can find my configuration in my dotfiles. *

Optional: Install JRebel

Apparently IntelliJ IDEA is capable of hot-swapping, though that is new to me. More investigation to come.

Start and/or enable the service

  1. sudo systemctl enable wildfly
  2. sudo systemctl start wildfly

Finally

Realize this all might be a waste of time and just use the Docker container.