1. 程式人生 > >jboss7.1部署安裝

jboss7.1部署安裝

jboss7.1安裝部署

環境:Redhat6.5

jboss安裝包:jboss-as-7.1.1.Final.zip

jdk安裝包:jdk-7u45-linux-x64.rpm


安裝jdk

rpm -ivh jdk-7u45-linux-x64.rpm

使用rpm安裝jdk會只自動安裝到 /usr/java/目錄下

在 /etc/profile 文件中添加一下信息

export JAVA_HOME=/usr/java/jdk1.7.0_45
export JRE_HOME=/usr/java/jdk1.7.0_45/jre
export PATH=$PATH:/usr/java/jdk1.7.0_45/bin
export CLASSPATH=./:/usr/java/jdk1.7.0_45/lib:/usr/java/jdk1.7.0_45/jre/lib

加載文件並查看jdk是否安裝成功

[root@localhost ~]# source /etc/profile
[root@localhost ~]# java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)


安裝JBOSS

直接解壓到安裝目錄並在/etc/profile文件中添加

[root@localhost ~]unzip jboss-as-7.1.1.Final.zip -d /usr/

export JBOSS_HOME=/usr/jboss-as-7.1.1.Final #JBOSS的安裝目錄
export PATH=$PATH:$JBOSS_HOME/bin #JBOSS的bin目錄

啟動JBOSS

[root@localhost ~]# /usr/jboss-as-7.1.1.Final/bin/standalone.sh
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /usr/jboss-as-7.1.1.Final


JAVA: /usr/java/jdk1.7.0_45/bin/java

JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

=========================================================================

03:39:12,095 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
03:39:12,766 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
03:39:12,828 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
03:39:14,930 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
03:39:14,943 INFO [org.xnio] XNIO Version 3.0.3.GA
03:39:14,974 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
03:39:15,001 INFO [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
03:39:15,036 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
03:39:15,044 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
03:39:15,091 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
03:39:15,144 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
03:39:15,152 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
03:39:15,174 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
03:39:15,201 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
03:39:15,291 INFO [org.jboss.as.security] (MSC service thread 1-1) JBAS013100: Current PicketBox version=4.0.7.Final
03:39:15,341 INFO [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
03:39:15,384 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
03:39:15,484 INFO [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
03:39:15,734 INFO [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
03:39:16,140 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.2.GA
03:39:16,313 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
03:39:16,702 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory /usr/jboss-as-7.1.1.Final/standalone/deployments
03:39:16,735 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:9999
03:39:16,754 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:4447
03:39:16,873 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
03:39:16,944 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
03:39:16,944 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 5470ms - Started 133 of 208 services (74 services are passive or on-demand)


到這裏表示啟動成功,但是不會返回到當前目錄,而是直接停在這裏。如果ctrl+c停止的話,jboss也就被強制停掉。可以用下面這條命令執行啟動腳本,讓進程在後臺運行

[root@localhost usr]# nohup /usr/jboss-as-7.1.1.Final/bin/standalone.sh &
[3] 3339
[root@localhost usr]# nohup: ignoring input and appending output to `nohup.out‘
^C
[root@localhost usr]#


使用虛擬機自帶的firefox瀏覽器在瀏覽器輸入localhost:8080可直接訪問

如果你使用電腦上的瀏覽器 需要將虛擬機網卡設置為橋接,並修改配置文件

文件的第280行,默認IP是127.0.0.1修改為虛擬機的實際IP

如下:

[root@localhost ~]# vim /usr/jboss-as-7.1.1.Final/standalone/configuration/standalone.xml

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


==》

<interface name="public">
<inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>


我是在虛擬機安裝並且iptables已被關閉所以不存在端口問題,如果iptables是在開啟狀態需要開啟對應的端口8080才能訪問

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT


jboss7.1部署安裝