Install Wildfly 10 Service on CentOS 7

When you deploy Wildfly on the production, it is very convenient to run Wildfly as a back ground service. Running Wildfly as a background daemon, you can change change run level and enable Wildfly start once the system boost. So, in this post I will demonstrate how to install Wildfly 10 on CentOS as background process and enable the service to run once the system start.

Install and Create Wildfly User

You need to download Wildfly Application server. After download Wildfly Application Server, you create wildfly user and assign user to belong wildfly group.
#adduser wildlfly
#passwd wildfly
Changing password for user wildfly.

New password:
#groupadd wildfly
#usermod -a -G wildfly,wheel wildfly 
Copy wildfly application to /opt/wildfly
#chown -RH wildlfly:widlfly /opt
#su - wildlfy
$mkdir download
$cd download
$wget https://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.tar.gz
$tar xzf wildfly-10.1.0.Final.tar.gz
$mkdir /opt/wildfly
$cp -R wildfly-10.1.0.Final/* /opt/wildfly/
Next is to create $JAVA_HOME and $JBOSS_HOME
$sudo echo "export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64" >> /etc/profile
$sudo echo "export JBOSS_HOME=/opt/wildfly" >> /etc/profile
$sudo source /etc/profile
$echo $JAVA_HOME
/usr/java/jdk1.8.0_201-amd64
$echo $JBOSS_HOME
/opt/widlfly

Configure Systemd

The WildFly package includes files necessary to run WildFly as a service. Start by creating a directory which will hold the WildFly configuration file.
$sudo mkdir -p /etc/wildfly
Copy configuration file to /etc/wildfly
$sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
$sudo cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/
$sudo sh -c 'chmod +x /opt/wildfly/bin/*.sh'
$sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/

Next, reload daemon
$sudo systemctl daemon-reload

Finally is to start up service and change run level for auto start on boot.
$sudo systemctl start wildfly
$sudo systemctl enable wildfly
to check whether service is start or not you can check status as below.
$sudo systemctl status wildfly
* wildfly.service - The WildFly Application Server
   Loaded: loaded (/etc/systemd/system/wildfly.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2020-04-22 14:02:14 UTC; 1 weeks 3 days ago
 Main PID: 3561 (launch.sh)
   CGroup: /system.slice/wildfly.service
           |-3561 /bin/sh /opt/wildfly/bin/launch.sh standalone standalone.xml 0.0.0.0
           |-3562 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml -b 0.0.0.0
           `-3618 java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.mod...

Apr 22 14:02:14 wildfly systemd[1]: Started The WildFly Application Server.

Reference


  1. How to install Widlfly Service on CentOS 7
  2. Installing Widlfly Servie on CentOS 7




1 comment:

  1. It has the standard old} stuff like plenty of machines to play on, several of} modifications to earn free spins all through 1xbet korea the day, and flashy graphics with huge jackpots. This one also provides social casino events, a good friend system, and tournaments with as much as} 32 total players. Most of the one star rankings are from people who just about never win, so it is possible to play this recreation and never win.

    ReplyDelete

Feature Recently

Running Wildfly Application Server in Domain Mode

  Wildfly application server provides two modes of how to run application one wildfly application server. It is very simple if you run your ...

Most Views