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

时间: 2024-09-30 16:24:06

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

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

在安装mysql过程中遇到一个问题  install/remove of the Service Denied,这个问题说明自己没有安装和删除的权利,原因是自己在运行cmd过程是没有使用管理员身份运行,解决方法:就是以管理员身份运行cmd,再进行安装 步骤: 1  打我的电脑------C盘-----window文件夹---------System32-----cmd.exe,右击cmd选择以管理员身份运行 2 在dos命令窗口执行cd e:\workspace\mysql-5.6.24-win

MySQL—Install/Remove of the Service Denied

在Windos7下通过命令"mysqld --install"安装MySQL数据库时出现了"Install/Remove of the Service Denied"错误,如何解决呢? 找到cmd.exe程序,使用"用管理员身份打开"打开该程序,然后重新输入安装命令即可.

兔子--安装或者卸载mysql服务出现Install/Remove of the Service Denied!错误

安装或者卸载mysql服务出现Install/Remove of the Service Denied!错误 解决办法:以管理员的身份打开cmd.exe

install and config bind9(named) on linux server

This article shows my process of installing and configuring bind9 DNS server on a linux server. I didn't touch every aspects of bind9, but following the process, a DNS server is configured with A/AAAA, NAPTR and SRV resource record types. The DNS ser

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 Assuming your Linux distro uses some variant of the System V Init framework to run its services, you can use the rc.ofbiz script inside the root OFBi

Python app in Azure App Service on Linux初探

使用Azure应用托管平台服务,可以为运维人员省去大量的基础服务器的管理工作,并且可以和Azure DevOps, GitHub, BitBucket, Docker Hub, Azure Container Registry等配合使用实现持续集成和持续部署.现阶段Global Azure也推出了Azure App Service on Linux 服务,用户可以托管他们的应用在Linux环境下,目前支持大多数开发语言和版本,对Python的支持处于public preview阶段,接下来我们做

How to install JDK (Java Development Kit) on Linux

This tutorial will guide you on how to install JDK (Java Development Kit) on Linux. Since I use Centos 5.4 x86_64 in everyday life, this guide is showing you how to install JDK in Centos 5.4 64bit. It must work in any other Linux distro such as Slack

HowTo: Restart SSH Service under Linux / UNIX

How do I restart SSH service under Linux or UNIX operating systems? The command to restart ssh are as follows (you must login as root user): CentOS / RHEL / Fedora / Redhat Linux Restart SSH # /etc/init.d/sshd restartOR# service sshd restart Debian /

【mysql】安装报错Install/Remove of the Service Denied!

问题如图: 解决问题: 用管理员身份打开命令行窗口 右键点击win-> 原文地址:https://www.cnblogs.com/xiaostudy/p/12262729.html