Skip to content

Instantly share code, notes, and snippets.

@slominskir
Last active May 7, 2024 12:26
Show Gist options
  • Save slominskir/294cb388294d2149f0c09e6fe48e6450 to your computer and use it in GitHub Desktop.
Save slominskir/294cb388294d2149f0c09e6fe48e6450 to your computer and use it in GitHub Desktop.
Setup Wildfly

Host OS Setup

Docker

Just use pre-built image to start with:

FROM quay.io/wildfly/wildfly:26.1.3.Final

RHEL 9

Use a Bash script to download Wildfly, and configure OS. Assumes you create a host.env config file and a /run/wildfly.env file:

wget https://raw.githubusercontent.com/JeffersonLab/smoothness/main/bash/wildfly/rhel9-setup.sh 
chmod +x rhel9-setup.sh
./rhel9-setup.sh host.env

Windows 11 with Windows Subsystem for Linux 2 (WSL2)

  1. Install WSL2 if not already installed.
  2. Download and unzip the distributable Wildfly package.
  3. Now launch bash from the Terminal with "bash". Notice path starts with /mnt/c/
  4. Now run server setup and app setup scripts as described below (perhaps using dos2unix on any .sh and .env files first).

Note: An advantage of using a local workstation installation of Wildfly is that it allows you to easily use an IDE to quickly build, run, and test changes. If running dependencies (services) in Docker (via deps.yaml) then the networking can be tricky. You may need to reference your local instance of Wildfly from within a Docker container. Referencing "localhost" won't work. One solution is to start Wildfly bound to the actual hostname and reference that name (wildfly-26.1.3.Final\bin\standalone.bat -b 0.0.0.0).

Server Setup

Use a Bash script to configure server-wide settings:

wget https://raw.githubusercontent.com/JeffersonLab/wildfly/main/scripts/server-setup.sh
chmod +x server-setup.sh
./server-setup.sh server.env

Note: Wildfly requires a Java Keystore to configure TLS. The script pem-java-keystore.sh may help.

App Setup

Use a Bash script to configure per-app settings:

wget https://raw.githubusercontent.com/JeffersonLab/wildfly/main/scripts/app-setup.sh 
chmod +x app-setup.sh
./app-setup.sh app.env

See Also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment