Jboss是Java EE應用服務器(就像Apache是web服務器一樣),專門用來運行Java EE程序的。是一個基於J2EE的開放源代碼的應用服務器。 JBoss代碼遵循LGPL許可,可以在任何商業應用中免費使用。JBoss是一個管理EJB的容器和服務器,支持EJB 1.1、EJB 2.0和EJB3的規範。但JBoss核心服務不包括支持servlet/JSP的WEB容器,一般與Tomcat或Jetty綁定使用。
JBoss4包括web服務器(servlet/JSP容器,HTML服務器)、EJB2.0容器。完整的純Java的數據庫引擎,(Java消息服務)JMS,JavaMail,和Java事務處理API/Java事務處理服務(JTA/JTS)支持。早期的JBoss使用了ApacheTomcatWeb服務器,但在JBoss4.0中已經把Apache Tomcat內嵌到JBoss中了。後續又集成Java數據對象(JDO),對於JMS多點傳送機制支持的修補,對J2EE1.4的完全實現和分佈式事務機制。
當然後續出了Jboss5,Jboss5等等多種版本,寫這個的目的是爲了更好的理解Jboss到底是什麼東西,如果要深入瞭解Jboss 請去往百度。
JBoss的應用服務器控制和配置-JMX機制,運行一次可以部署所有的組件和服務。
搭建JBOSS
#安裝JAVA並配置環境變量
[root@localhost bin]# mkdir /usr/local/jdk1.8
[root@localhost bin]# tar zxf jdk-8u171-linux-x64.tar.gz -C /usr/local/jdk1.8
[root@localhost bin]# mkdir /usr/local/jdk1.8
#設置java環境
JAVA_HOME=/usr/local/jdk1.8/
JRE_HOME=/usr/local/jdk1.8/jre
PATH=JAVA_HOME/bin:JAVA_HOME/lib/dt.jar:JRE_HOMR/lib
export JAVA_HOME JRE_HOME PATH CLASS_PATH
#保存後執行source命令使該文件生效
#安裝JBOSS
[root@localhost bin]# unzip jboss-eap-6.4.0.zip
[root@localhost bin]# mv jboss-eap-6.4 /data/server/
[root@localhost bin]# vim /etc/profile
export JBOSS_HOME=/home/jboss/jboss7.1.1
export PATH=PATH
[root@localhost bin]# vim /data/server/jboss-eap-6.4/standalone/configuration/standalone.xml
#添加和修改
#註冊賬號
[root@localhost bin]# sh 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): a
Enter the details of the new user to add.
Using realm ‘ManagementRealm’ as discovered from the existing property files.
Username : root
The username ‘root’ is easy to guess
Are you sure you want to add user ‘root’ yes/no? yes
Password requirements are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password must not be one of the following restricted values {root, admin, administrator}
- The password must contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
- The password must be different from the username
Password :
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]:
About to add user ‘root’ for realm ‘ManagementRealm’
Is this correct yes/no? yes
Added user ‘root’ to file ‘/data/server/jboss-eap-6.4/standalone/configuration/mgmt-users.properties’
Added user ‘root’ to file ‘/data/server/jboss-eap-6.4/domain/configuration/mgmt-users.properties’
Added user ‘root’ with groups to file ‘/data/server/jboss-eap-6.4/standalone/configuration/mgmt-groups.properties’
Added user ‘root’ with groups to file ‘/data/server/jboss-eap-6.4/domain/configuration/mgmt-groups.properties’
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition
#啓動JBOSS
[root@localhost bin]# ./standalone.sh
#訪問IP:8080並登錄用戶