7

I am trying to install the WildFly 8.0.0.Final application server on a Virtual Machine running Ubuntu 12.04 LTS. I've done some searches on Google, but I found only third-party scripts and, I think, non standard ways to do this.

Currently, to start the server, I open an SSH connection to the virtual machine and run the following commands:

cd <WILDFLY_HOME>/bin
nohup standalone.sh -b=0.0.0.0 -bmanagement=0.0.0.0 > /dev/null &

And to stop:

kill <pid of java process running wildfly>

But, what is the best way to install the server as a service on Ubuntu? If I restart the machine, the server will start automatically?

My environment:

  • Ubuntu 12.04 LTS;
  • Java 7;
  • WildFly 8.0.0 Final;
10

WildFly includes an init.d script in the bin folder...

Follow this steps:

sudo cp $WILDFLY_HOME/bin/init.d/wildfly-init-debian.sh /etc/init.d/wildfly
sudo cp $WILDFLY_HOME/bin/init.d/wildfly.conf /etc/default/wildfly
sudo adduser --system --group --disabled-login wildfly
sudo chown -R wildfly:wildfly $WILDFLY_HOME
sudo update-rc.d wildfly defaults

Modify /etc/default/wildfly to fit your needs... Test.

4

In my opinion the best way is to use installation script:

wildfly-8.0.0.Final/bin/init.d/wildfly-init-debian.sh

it will create you init script so if you want WildFly to start automaticly you should execute command:

update-rc.d wildfly defaults

after execution of wildfly-init-debian.sh script

2

[EDIT]

The accepted answer is outdated, the scripts have been moved to:

The accepted answer is actually technically correct, since the question is about WildFly 8. Thanks @JorSol for pointing that out!

However, I got here while searching for "installing WildFly 10 as a service on Ubuntu", and I am sure others will too.

In WildFly 10, the location of the init.d file has been moved to:

$WILDFLY_HOME/docs/contrib/scripts/inid.d

  • The question is to the version 8.0.0 of WildFly, so the accepted answer is technically correct. – JorSol Jun 18 '16 at 20:52
  • @JorSol you are right, I have updated my answer. Thank you! – Francisco C. Jun 19 '16 at 17:45
1

I would modify the previous answer from JorSol to

sudo cp $WILDFLY_HOME/bin/init.d/wildfly-init-debian.sh /etc/init.d/wildfly

because his command would create a security exploit should anyone be able to gain the permissions of wildfly and modify $WILDFLY_HOME/bin/init.d/wildfly-init-debian.sh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.