添加账号
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