JBoss是什么?
Jboss是一个基J2EE的开放源代码的应用服务器。jboss的最后一个版本为JBoss AS7,在这之后JBoss社区已将它变更为WildFly项目,作为JBoss的新版本。WildFly官方网站:http://wildfly.org/。
Jboss的下载地址:http://jbossas.jboss.org/downloads/
Jboss服务的运行需要java环境,因此首先安装jdk:
摘自 <http://7424593.blog.51cto.com/7414593/1832403>
192.168.1.152 | jdk7,jboss7.1.1 |
os | rhel7.2 |
1、初始化系统
# vi /etc/selinux/config
SELINUX=disabled |
# systemctl disable firewalld
# hostnamectl set-hostname xxx
# reboot
2、java环境安装
# oracle官网下载 jdk7 #一开始用了jdk8,然后启动jboss,就一直卡着。。。
# rpm -ivhjdk-7u80-linux-x64.rpm
# vi/etc/profile
JAVA_HOME=/usr/java/jdk1.7.0_80 CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib PATH=$JAVA_HOME/bin:$PATH |
# source/etc/profile
# java -version
java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) |
3、Jboss安装
# cd/usr/local/src
#wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz
# tar -zxfjboss-as-7.1.1.Final.tar.gz
# mvjboss-as-7.1.1.Final/usr/local/jboss
# vi /etc/profile
export JBOSS_HOME=/usr/local/jboss export PATH=$JBOSS_HOME/bin:$PATH |
# source /etc/profile
#cd /usr/local/jboss/standalone/configuration/
#vi standalone.xml #设置监听网卡
<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:0.0.0.0}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:0.0.0.0}"/> </interface> <!-- TODO - only show this if the jacorb subsystem is added --> <interface name="unsecure"> <!-- ~ Used for IIOP sockets in the standard configuration. ~ To secure JacORB you need to setup SSL --> <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/> </interface> </interfaces> |
4、启动查看
#cd /usr/local/jboss/bin/
#screen -S jboss
#./standalone.sh
# Ctrl +D
#./add-user.sh #创建管理员用户
What type of user do you wish to add? a) Management User (mgmt-users.properties) b) Application User (application-users.properties) (a):
Enter the details of the new user to add. Realm (ManagementRealm) : Username : mzh Password : Re-enter Password : About to add user 'mzh' for realm 'ManagementRealm' Is this correct yes/no? yes Added user 'mzh' to file '/usr/local/jboss/standalone/configuration/mgmt-users.properties' Added user 'mzh' to file '/usr/local/jboss/domain/configuration/mgmt-users.properties' |
# netstat -tunlp | grep java
tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 5923/java tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 5923/java tcp 0 0 0.0.0.0:4447 0.0.0.0:* LISTEN 5923/java tcp 0 0 0.0.0.0:9990 0.0.0.0:* LISTEN 5923/java |
# WEB 端登录测试:
#http://192.168.1.152:9990/console #输入mzh账号密码登录管理页
#http://192.168.1.152:8080 #出现欢迎界面
#注意:项目部署 war包上传至/usr/local/jboss/standalone/deployments路径下即可