Monday, November 30, 2015

Configurar Wilf Fly en Linux UBUNTU como servicio

Cando se necesita configurar wildfly como servidor y como servicio para que inicie automaticamente la app, se realizan los siguientes pasos:

1: Aderir usuario wildfly
2: Aderir grupo wildfly

copiar el archivo wildlfly-xxx.zip a /opt, descomprimir alli, renombrar la carpeta como wildfly
3: darle propiedad al usuario wildfly y grupo wildfly a la carpeta wildlfy asi:

chown -R wildfly:wildlfy /opt/wildfly

To run Wildfly you can simply execute the standalone.sh script located at:
1
[WILDFLY_INSTALLATION_DIRECTORY]/bin/standalone.sh
 
This is a pretty straightforward approach and it does not require any configuration.
If you need Wildfly to run in the background (and maybe at system startup), you must install Wildfly as a service:

Copy wildfly.conf to /etc/default/ and change the name to wildfly

cp [WILDFLY_INSTALLATION_DIRECTORY]/bin/init.d/wildfly.conf /etc/default/wildfly
Edit this file to set your own configurations, they will be discarded by default because of the #.

You need to set some values, for example, JAVA_HOME must be set to where you have Java installed, JBOSS_USER (default: wildfly) must be set to the user who will be running Wildfly and who owns the main directory, JBOSS_HOME (default: /opt/widlfly) is the main directory where you have placed the installation files, JBOSS_CONSOLE_LOG is where logs will be stored (make sure the user have write access to this file).
Now you need to copy the wildfly-init-debian.sh to /etc/init.d and rename it to wildfly.


cp [WILDFLY_INSTALLATION_DIRECTORY]/bin/init.d/wildfly-init-debian.sh /etc/init.d/wildfly
And this is enough to install Wildfly as a service, to run the service, simply execute:


service wildfly start
 
 
Hasta este punto ya debemos de tener el servicio de wildfly corriendo, ahora para poder hacer que 
autoinicie cada vez que el servidor se encienda se debe de correr: 
update-rc.d wildfly defaults 
y con esto ya tendriamos Wildfly rodando cada vez que el servidor se reinicie

Para remover el Servicio de autoestarte se coloca update-rc.d -f wildfly remove



 
 
 
 

No comments:

Post a Comment