centos7 安装wildfly10.x standalone模式

添加账号

groupadd wildfly
useradd -g wildfly wildfly -s /sbin/nologin

usermod -G root wildfly#添加一个副组

chown wildfly:wildfly -R /opt/jboss

chkconfig --add wildfly

chkconfig --level 35 jboss on

制做service或systemd文件

wildfly-10.0.0.Final\docs\contrib\scripts

vim /etc/default/wildfly.conf
# General configuration for the init.d scripts,
# not necessarily for JBoss AS itself.
# default location: /etc/default/wildfly

## Location of JDK      
# JAVA_HOME="/usr/lib/jvm/default-java"

## Location of WildFly
JBOSS_HOME="/opt/wildfly/latest"

## The username who should own the process.
JBOSS_USER=wildfly
#JBOSS_USER=root

## The mode WildFly should start, standalone or domain
JBOSS_MODE=standalone

## Configuration for standalone mode
JBOSS_CONFIG=standalone.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=600

## 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 127.0.0.1"
JBOSS_OPTS="-b 0.0.0.0"
 

 

放开tcp端口

iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

iptables -I INPUT -p tcp --dport 9990 -j ACCEPT

/etc/rc.d/init.d/iptables save #保存配置

重定向端口

将对端口80的访问重定向到8080端口
# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
针对本地loopback接口的规则
# iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 8080

 

ip端口限制

只允许46.166.150.22访问本机的80端口。如果要设置其他ip或端口。

iptables -I INPUT -p TCP --dport 80 -j DROP
iptables -I INPUT -s 46.166.150.22 -p TCP --dport 80 -j ACCEPT

 

 bin/standalone.conf

JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=0.0.0.0"

JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address.management=0.0.0.0"

 

service  iptables status

服务器改成支持外网访问

http://bgasparotto.com/enable-wildfly-remote-access/

 

在standalone.xml文件中找到

<interface name="public">

            <inet-address value="${jboss.bind.address:127.0.0.1}"/>

</interface>

改为:

<interface name="public

">

    <!--<any-ipv4-address/>-->

    <any-address/>

 </interface>

 

 

Getting started with WildFly 8

http://www.itbuzzpress.com/wildfly-8-administration/getting-started-with-wildfly-8.html

http://www.mastertheboss.com/jboss-server/jboss-eap/eap-6-as-a-service

转载于:https://my.oschina.net/masterworker/blog/818448

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值