WildFly: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
<source lang="bash">
<syntaxhighlight lang="bash">
apt update; apt list --upgradable; cd /opt/
apt update; apt list --upgradable; cd /opt/
wget https://github.com/wildfly/wildfly/releases/download/27.0.1.Final/wildfly-27.0.1.Final.tar.gz
wget https://github.com/wildfly/wildfly/releases/download/27.0.1.Final/wildfly-27.0.1.Final.tar.gz
tar -xvzf wildfly-27.0.1.Final.tar.gz
tar -xvzf wildfly-27.0.1.Final.tar.gz
mv wildfly-27.0.1.Final wildfly
mv wildfly-27.0.1.Final wildfly
</source>
</syntaxhighlight>
 
==Permission==
==Permission==
<source lang="bash">
<syntaxhighlight lang="bash">
groupadd wildfly
groupadd wildfly
useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
Line 18: Line 17:
chown wildfly: /opt/wildfly/bin/launch.sh
chown wildfly: /opt/wildfly/bin/launch.sh
nano /opt/wildfly/bin/launch.sh
nano /opt/wildfly/bin/launch.sh
</source>
</syntaxhighlight>
 
==Config==
==Config==
<source lang="bash" highlight="4" line>
<syntaxhighlight lang="bash" highlight="4" line>
#!/bin/bash
#!/bin/bash


Line 34: Line 32:
   #$WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement=0.0.0.0
   #$WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement=0.0.0.0
fi
fi
</source>
</syntaxhighlight>


==Service==
==Service==
<source lang="bash">
<syntaxhighlight lang="bash">
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/wildfly.service
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/wildfly.service
nano /etc/systemd/system/wildfly.service
nano /etc/systemd/system/wildfly.service
</source>
</syntaxhighlight>
 
<syntaxhighlight lang="ini" highlight="2,8-10,12,13" line>
<source lang="ini" highlight="2,8-10,12,13" line>
[Unit]
[Unit]
Description=The WildFly Application Server
Description=The WildFly Application Server
Line 60: Line 57:
[Install]
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
</source>
</syntaxhighlight>
 
<syntaxhighlight lang="bash">
<source lang="bash">
systemctl daemon-reload
systemctl daemon-reload
systemctl enable wildfly
systemctl enable wildfly
Line 69: Line 65:
systemctl status wildfly
systemctl status wildfly
tail -f /opt/wildfly/standalone/log/server.log
tail -f /opt/wildfly/standalone/log/server.log
</source>
</syntaxhighlight>
 
  ssh [email protected] -L 8080:localhost:8080 -L 9990:localhost:9990
  ssh [email protected] -L 8080:localhost:8080 -L 9990:localhost:9990
  http://localhost:8080/
  http://localhost:8080/
Line 84: Line 79:
* [https://www.wildfly.org/downloads/ WildFly Jakarta EE Full & Web Distribution]
* [https://www.wildfly.org/downloads/ WildFly Jakarta EE Full & Web Distribution]
* [https://www.wildfly.org/news/2021/01/15/bootable-jar-3.0.Final-Released/ WildFly Bootable JAR]
* [https://www.wildfly.org/news/2021/01/15/bootable-jar-3.0.Final-Released/ WildFly Bootable JAR]
* [[Linux User Creation]]
* [[Keycloak]]
* [[Keycloak]]

Latest revision as of 16:59, 12 December 2024

apt update; apt list --upgradable; cd /opt/
wget https://github.com/wildfly/wildfly/releases/download/27.0.1.Final/wildfly-27.0.1.Final.tar.gz
tar -xvzf wildfly-27.0.1.Final.tar.gz
mv wildfly-27.0.1.Final wildfly

Permission

groupadd wildfly
useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
chown -R wildfly: /opt/wildfly/
chmod o+x /opt/wildfly/bin/
mkdir /etc/wildfly

cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/wildfly.conf
cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/
chown wildfly: /opt/wildfly/bin/launch.sh
nano /opt/wildfly/bin/launch.sh

Config

#!/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
else
    $WILDFLY_HOME/bin/standalone.sh -c $2 -b $3
   #$WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement=0.0.0.0
fi

Service

cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/wildfly.service
nano /etc/systemd/system/wildfly.service
[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
Group=wildfly
LimitNOFILE=102642
PIDFile=/var/run/wildfly/wildfly.pid
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND
StandardOutput=null

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable wildfly
systemctl start wildfly

systemctl status wildfly
tail -f /opt/wildfly/standalone/log/server.log
ssh [email protected] -L 8080:localhost:8080 -L 9990:localhost:9990
http://localhost:8080/
http://localhost:9990/

Knowledge

docker run --add-host=host.docker.internal:host-gateway\
 --rm alpine ping host.docker.internal

References