Install and configure Jboss 7 on Linux

Download and Installation and Launch 

1. Install JDK 

2. Create a user for jboss

useradd jboss

2. Download the jboss to the target folder  /home/jboss

wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz

3. tar -zxvf jboss-as-7.1.1.Final.tar.gz

4. Now, let's start JBoss AS

in standalone mode:

jboss-as-7.1.1.Final/bin/standalone.sh

in domain mode:

jboss-as-7.1.1.Final/bin/domain.sh

Noet: if you want to launch Jboss as backend jobs, you can use command :./standalone.sh &

5. That's it, JBoss AS is installed and running! Visit http://localhost:8080/ to check the server has started properly.

Stop Jboss:

1. If your jboss is running as front jobs, simply press Crtl-C whilst the terminal has focus.

2. If your jboss is running as backend jobs, you should use jboss CLI (path:jboss-as-7.1.1.Final/bin/jboss-cli.sh)

STOP standalone mode:

$jboss-cli.sh

[disconnected /]connect

Connect to localhost:9999

[localhost:9999]:shutdown

PS: You can edit the /etc/profile(for all users on this server) or .bash_profile(for the specific user who installed jboss,like /home/someuser/jboss-as-7.1.1.Fina), asfollows;

JBOSS_HOME=/veris/upc/aiupc/jboss-as-7.1.1.Final
PATH=$PATH:$JBOSS_HOME/bin
CLASSPATH=.:$CLASSPATH:$JBOSS_HOME/lib
export JBOSS_HOME PATH CLASSPATH

source .bash_profile

OR

$jboss-cli.sh --connect  command=:shutdown

STOP domain mode:

$jboss-cli.sh

[disconnected /]connect

Connect to localhost:9999

[localhost:9999]:/host=master:shutdown

PS: Command: /host=master:shutdown. this "master" is from $JBOSS_HOME/domain/configuration/host.xml,as follows;

<host name="master" xmlns="urn:jboss:domain:1.2">

If you change the name in this file, you also should change the same location in that command. And If you have servergroup, you can use this parameter to identify each member of the group. For instance, you have servergroup: aitest. There are three members in this group: test1,test2,test3, so you can identify which member(host) that you want to stop. /host=test1:shutdown

Reload Jboss:

$jboss-cli.sh

[disconnected /]connect

Connect to localhost:9999

[localhost:9999]:reload

Start Remote Host Jboss   ( server ip: 10.100.59.11 with vagrant virtual box)

If you want to remote access jboss(standalone)  ,like http://10.100.59.11:8080. You can:

1. ./standalone.sh -b 10.100.59.11 &  (Just can access homepage, can't access management console)

2../standdlone.sh -b 10.100.59.11 -bmanagement 10.100.59.11 & (also can access management console)

-b -> “listen” for requests on this ip address

-bmanagement -> “listen” for management console access on this ip address

& run as a background process

Note: If you can access the remote host,  try to close the firewall /etc/init.d/iptables stop . OR add iptable rules :

sudo iptables -A INPUT -p tcp --dport8080 -j ACCEPT (or other ports)

If you want to remote access jboss(domain)  ,like http://10.100.59.11:8080. You can:

1../domain.sh -b 10.100.59.11 &  (Just can access homepage, can't access management console)

OR

you can change the configuration file standalone.xml($JBOSS_HOME/standalone/configuration/) or host.xml($JBOSS_HOME/domain/configuration/)

 <interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:
127.0.0.1}"/>
        </interface>
        <interface name="public">
           <inet-address value="${jboss.bind.address:127.0.0.1}"/>
        </interface>
        <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>

change three ip from 127.0.0.1 to 0.0.0.0

PS: After changing this file, you can open http://localhost:8080, you can access the management console with link:http://<host>:9990/console

STOP Remote Host jboss(192.168.0.22):

$jboss-cli.sh

[disconnected /]connect 192.168.0.22

Authenticating against security realm: ManagementRealm

Username:admin1234

Passwd:

Connected to 192.168.1.22:9999

[192.168.1.10:9999]:shutdown




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章