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. dart正则

    1.前言 API中对于正则表达式的注释是:正则表达式的规范和语义与JavaScript相同详细的规范可以参考:http://ecma-international.org/ecma-262/5.1/#s ...

  2. Python:matplotlib绘制散点图

    与线型图类似的是,散点图也是一个个点集构成的.但不同之处在于,散点图的各点之间不会按照前后关系以线条连接起来. 用plt.plot画散点图     奇怪,代码和前面的例子差不多,为什么这里显示的却是散 ...

  3. 怎样利用ADO中的adoquery进行缓存更新?????(100分)

    我用BDE时,用query与updatesql相结合进行缓存更新,但是在ADO中没有updatesql,只有用adoquery,在DBGRID中,用CANCELUPADTE,只能取消一条记录,烦恼不已 ...

  4. Arrays类

    package cn.zhou.com; import java.util.Arrays; /* * Arrays 类 ? * * 数组工具类 操作数组! * * Arrays的方法? * * */ ...

  5. JS实现控制HTML5背景音乐播放暂停

    首先在网页中嵌入背景音乐,html5代码为: <script src="http://wuover.qiniudn.com/jquery.js"></script ...

  6. java中的几个概念

    1.JDK(Java Development Kit ):编写Java程序的程序员使用的软件(它是编写java程序,使用到的工具包,为程序员提供一些已经封装好的 java 类库) 2.JRE(Java ...

  7. c++ 动态生成string类型的数组

    定义一个字符串指针,将其初始化为空 char *a=NULL 然后输入输出 cin>>a cout<<a 编译无误,但执行会遇见错误 当为*a动态分配存储空间时,程序执行正常 ...

  8. Go语言类型(布尔、整型、数组、切片、map等)

    1.基本类型 布尔类型:bool 注意:布尔类型不能接受其他类型的赋值,不支持自动或强制的类型转换. 整型:int8.byte(uint8).int16.int.uint.uintptr int.ui ...

  9. MVC 动态菜单

    直接上代码: 一,创建菜单 Action public ActionResult GetMenu() { //获取菜单 List<MenuItem> mainMenu = mm.GetMe ...

  10. ☆ [NOIp2016] 天天爱跑步 「树上差分」

    题目类型:LCA+思维 传送门:>Here< 题意:给出一棵树,有\(M\)个人在这棵树上跑步.每个人都从自己的起点\(s[i]\)跑到终点\(t[i]\),跑过一条边的时间为1秒.现在每 ...