How To Install WildFly as a Service on Linux
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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2016-04-20 Mysql 列转行统计查询 、行转列统计查询
2016-04-20 mysql 生成排名字段
2016-04-20 Spring data jpa批量插入和更新