How to add Wildfly 10 as service in Ubuntu

When you need to distribute Wildfly on an Ubuntu-server you have to:

Install JDK

Download Wildfly<
and copy wildfly to /opt
sudo cp wildfly-10.1.0-Final /opt/wildfly-10.1.0-Final

Create an user for Wildfly
sudo adduser --no-create-home --disabled-password --disabled-login wildfly

Make a symbolic link to new folder:
ln -s /opt/wildfly-10.1.0-Final /opt/wildfly

Change ownership of directory and symbolic link to wildfly:
sudo chown -R wildfly:wildfly /opt/wildfly*

Now we copy the provided init-Files from Wildfly to /etc/init.d
sudo cp /opt/wildfly/docs/contrib/scripts/init.d/wildfly-init-debian.sh /etc/init.d/wildfly

Run update-rc.d to ensure wildfly starts on reboot:
sudo update-rc.d wildfly defaults

Copy the wildfly.conf file to /etc/default:
sudo cp /opt/wildfly/docs/contrib/scripts/init.d/wildfly.conf /etc/default/wildfly

nano /etc/default/wildfly

Uncomment and/or Edit the following lines:
JBOSS_HOME="/opt/wildfly"
JBOSS_USER=wildfly
JBOSS_MODE=standalone
JBOSS_CONFIG=standalone.xml — Change configuration file name in order to run full Java EE 7 Stack
STARTUP_WAIT=120 –Probably overkill wait time
SHUTDOWN_WAIT=120 –Probably overkill wait time
JBOSS_CONSOLE_LOG="/var/log/wildfly/console.log"

Try out the init.d and wildfly.conf settings and make sure the service can start:
service wildfly start

To stop:
service wildfly stop

Don’t foget to run the add-user.sh – script
Wildfly is listening only to localhost per default. To change this refer to bgasparotto – Enable Wildfly remote access

URLs:
:8080
:9990 (it’s better not to enable the remote access for the management console)

Sources:
gesker – WildFly 10 on Ubuntu 15.10
bgasparotto – Enable Wildfly remote access

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to How to add Wildfly 10 as service in Ubuntu

  1. tsvetatsvetov says:

    Not working at all…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s