Lewati ke isi

Instalasi WildFly pada Linux

# Install Java OpenJDK
apt-get update && apt-get upgrade -y
apt-get install -y default-jdk
# Create a user
groupadd -r wildfly
useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
# Download & install WildFly
WILDFLY_VERSION=23.0.1.Final
wget https://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz -P /tmp
tar xf /tmp/wildfly-$WILDFLY_VERSION.tar.gz -C /opt/
ln -s /opt/wildfly-$WILDFLY_VERSION /opt/wildfly
chown -RH wildfly: /opt/wildfly
# Configure SystemD
mkdir -p /etc/wildfly
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
# 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
cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/
sh -c 'chmod +x /opt/wildfly/bin/*.sh'
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now wildfly
systemctl status wildfly
# Configure WildFly Authentication
/opt/wildfly/bin/add-user.sh
What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a):
Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : amantra
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should be different from the username
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password : 
WFLYDM0099: Password should have at least 8 characters!
Are you sure you want to use the password entered yes/no? yes
Re-enter Password : 
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: 
About to add user 'amantra' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'amantra' to file '/opt/wildfly-23.0.1.Final/standalone/configuration/mgmt-users.properties'
Added user 'amantra' to file '/opt/wildfly-23.0.1.Final/domain/configuration/mgmt-users.properties'
Added user 'amantra' with groups  to file '/opt/wildfly-23.0.1.Final/standalone/configuration/mgmt-groups.properties'
Added user 'amantra' with groups  to file '/opt/wildfly-23.0.1.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process? 
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server Jakarta Enterprise Beans calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="dmlzaWt1" />

Access web interface

from remote not localhost

nano /etc/wildfly/wildfly.conf

# 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

# The address console to bind to
WILDFLY_CONSOLE_BIND=0.0.0.0

nano /opt/wildfly/bin/launch.sh

#!/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

Koneksi ke PostgreSQL

Referensi