Installing WildFly as a service on Linux has multiple advantages like automatic start on system boot, convinient management with service command, better security and other.

To install WildFly as a service on CentOS and other RPM-based Linux distributions do steps described below.

This guide is suitable for installing WildFly 8 and 9.

Install Java (requires JDK in order to support JSP)

yum install java-1.8.0-openjdk-devel

Download WildFly and unpack binaries

wget http://download.jboss.org/wildfly/9.0.1.Final/wildfly-9.0.1.Final.zip
unzip wildfly-9.0.1.Final.zip -d /opt/

Create symbolic link in order to simplify WildFly updates in future

ln -s /opt/wildfly-9.0.1.Final /opt/wildfly

Copy and edit init script configuration

cp /opt/wildfly/bin/init.d/wildfly.conf /etc/default/wildfly.conf

Edit variables in /etc/default/wildfly.conf

## Location of JDK
JAVA_HOME="/usr/lib/jvm/java-1.8.0" ## Location of WildFly
JBOSS_HOME="/opt/wildfly" ## The username who should own the process.
JBOSS_USER=wildfly ## The mode WildFly should start, standalone or domain
JBOSS_MODE=standalone ## Configuration for standalone mode
JBOSS_CONFIG=standalone-full-ha.xml ## Configuration for domain mode
# JBOSS_DOMAIN_CONFIG=domain.xml
# JBOSS_HOST_CONFIG=host-master.xml ## The amount of time to wait for startup
STARTUP_WAIT=60 ## The amount of time to wait for shutdown
SHUTDOWN_WAIT=60 ## Location to keep the console log
JBOSS_CONSOLE_LOG="/var/log/wildfly/console.log" ## Additionals args to include in startup
# JBOSS_OPTS="--admin-only -b 172.0.0.1"

Copy init script

cp /opt/wildfly/bin/init.d/wildfly-init-redhat.sh /etc/init.d/wildfly

Add WildFly as a service

chkconfig --add wildfly
chkconfig wildfly on

Create directory for logs

mkdir -p /var/log/wildfly

Add user to run WildFly

adduser wildfly

Change the owner of WildFly directories

chown -R wildfly:wildfly /opt/wildfly-9.0.1.Final
chown -R wildfly:wildfly /opt/wildfly
chown -R wildfly:wildfly /var/log/wildfly

Start WildFly

service wildfly start

See also how to install WildFly on Ubuntu.

just to add a bit:
you can create a nologin/ no home user with

# adduser --no-create-home wildfly 
# usermod -s /sbin/nologin wildlfy

------------------------------------

http://developer-should-know.com/post/112230363742/how-to-install-wildfly-as-a-service-on-linux

http://blog.csdn.net/yuqiongran/article/details/52524483

How To Install WildFly as a Service on Linux的更多相关文章

  1. Mysql安装出现=========== install/remove of the Service Denied

    在安装mysql过程中遇到一个问题  install/remove of the Service Denied,这个问题说明自己没有安装和删除的权利,原因是自己在运行cmd过程是没有使用管理员身份运行 ...

  2. Install/Remove of the Service Denied!

    在windos 的cmd下安装mysql 在mysql的bin目录下面执行: mysqld --install 报错: 信息如下一: Install/Remove of the Service Den ...

  3. Mysql安装错误:Install/Remove of the Service Denied!解决办法

    Mysql安装错误:Install/Remove of the Service Denied!解决办法 在windos 的cmd下安装mysql 在mysql的bin目录下面执行: mysqld -- ...

  4. [mysql] Install/Remove of the Service Denied

    在windos 的cmd下安装mysql 在mysql的bin目录下面执行: mysqld --install 报错: 信息如下: Install/Remove of the Service Deni ...

  5. 安装mysql Install/Remove of the Service Denied!错误的解决办法

    在window 的cmd下安装mysql 在mysql的bin目录下面执行: mysqld --install 报错: 信息如下: Install/Remove of the Service Deni ...

  6. MySQL—Install/Remove of the Service Denied

    在Windos7下通过命令"mysqld --install"安装MySQL数据库时出现了"Install/Remove of the Service Denied&qu ...

  7. 安装mysql时出现 mysql Install/Remove of the Service Denied! 错误的解决办法

    用cmd在mysql的bin目录下面执行: mysqld --install 命令,出现错误: mysql Install/Remove of the Service Denied! 解决方法:以管理 ...

  8. 【记录】安装mysql Install/Remove of the Service Denied!错误的解决办法

    最近安装 Mysql 5.6版本,在安装的过程中出现Install/Remove of the Service Denied!错误!(本人Win10 系统) 出现此问题是由于当前用户权限不够,需要以管 ...

  9. How to run OFBiz as a Service on linux

    Windows See this specific guide: How to Run OFBiz as Windows Service with Java Service Wrapper Linux ...

随机推荐

  1. mysql5.7以上安装

    下载:https://dev.mysql.com/downloads/mysql/ 1.在解压的mysql下(bin目录统计),创建my.ini 文件,内容日下(路径根据自己的目录修改) [mysql ...

  2. git连接到github

    基本流程如图 如何配置SSH key:在gitBash里执行. 1.检查电脑上是否生成过了,如果已经生成了,则需要删除后再操作 cd ~ cd .ssh 提示:No such file or dire ...

  3. css的类选择器

    css的类选择形式 .类名{} 通配类选择器:*.类名{} 某种元素的类选择器:元素名.类名{} 多类选择器:<p class="css1  css2"></p& ...

  4. 各个版本spring的jar包以及源码下载地址,目前最高版本到spring4.3.8,留存备用:

    http://maven.springframework.org/release/org/springframework/spring/

  5. css进行网站布局

    一.一列布局(例如百度首页) 通常用 {margin:0 auto;} 控制. <!DOCTYPE> <html xmlns="http://www.w3.org/1999 ...

  6. 51nod1016

    1016 水仙花数 V2 1 秒 131,072 KB 160 分 6 级题   水仙花数是指一个 n 位数 ( n≥3 ),它的每个位上的数字的 n 次幂之和等于它本身.(例如:1^3 + 5^3 ...

  7. Deepfakes:AI换脸技术自制明星XX片

    ps:亮瞎狗眼 去年开始就在国外网站上比较火的项目了,通过Deepfakes技术可以将视频中的人脸换成自己喜欢的明星, 当时就有不少人制作了换脸视频,其中大部分是替换了XX片的女主角. 国外网站Red ...

  8. BZOJ3724PA2014Final Krolestwo——欧拉回路+构造

    题目描述 你有一个无向连通图,边的总数为偶数.设图中有k个奇点(度数为奇数的点),你需要把它们配成k/2个点对(显然k被2整除).对于每个点对(u,v),你需要用一条长度为偶数(假设每条边长度为1)的 ...

  9. Docker最全教程

    摘自雪雁大佬的博客,地址:https://www.cnblogs.com/codelove/default.html 目录: Docker最全教程——从理论到实战(一) Docker最全教程——从理论 ...

  10. POJ1860-Currency Exchange-判正环

    两种货币的交换可以当成两条边,建图后跑Bellman_ford算法就好了. Bellman_ford算法可以用来处理负边权,所以可以判断是否存在负环.反过来就可以判断是否存在正环. /*------- ...