Wednesday, 30 January 2013

Jboss: Installation and Configuration Steps in Cent OS 6.3

*******************************************************************************
 
Step1: Firstly, we will need to install Java.


JBoss 7.1.1 will work with JDK 6 or JDK 7.


[root@CSSW2013NOC3 ~]#cd /home/sankar/Downloads/

[root@CSSW2013NOC3 ~]#mkdir  -p /usr/java

[root@CSSW2013NOC3 ~]#mv jdk-7u11-linux-i586.tar.gz  /usr/java/

[root@CSSW2013NOC3 ~]#cd /usr/java

#ls
jdk-7u11-linux-i586.tar.gz


Step 2:Extract it:

[root@CSSW2013NOC3 ~]#tar -xvzf jdk-7u11-linux-i586.tar.gz

[root@CSSW2013NOC3 ~]#cd jdk1.7.0_11/

[root@CSSW2013NOC3 ~]#pwd

/usr/java/jdk1.7.0_11

Step 3: Download and Install JBoss 7.1.1 Application Server

[root@CSSW2013NOC3 ~]#cd /usr/share/

[root@CSSW2013NOC3 ~]#wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip

[root@CSSW2013NOC3 ~]#unzip -q jboss-as-7.1.1.Final.zip

[root@CSSW2013NOC3 ~]#mv jboss-as-7.1.1.Final jboss-as

[root@CSSW2013NOC3 ~]#cd jboss-as


Step 4: Create the user jboss, who will own and run JBoss

[root@CSSW2013NOC3 ~]#groupadd jboss

[root@CSSW2013NOC3 ~]#useradd -s /bin/bash -g jboss jboss

[root@CSSW2013NOC3 ~]#chown -Rf jboss.jboss /usr/share/jboss-as


Step 5: Put Java into the path of jboss and root

[root@CSSW2013NOC3 ~]#cd /home/jboss/

[root@CSSW2013NOC3 ~]#vim .bash_profile

JAVA_HOME=/usr/java/jdk1.7.0_11
export JAVA_HOME 
PATH=$JAVA_HOME/bin:$PATH
export PATH          

As root, issue '. ~/.bash_profile' as below to put JAVA into the path of root immediately.

[root@CSSW2013NOC3 ~]#vim .bash_profile

JAVA_HOME=/usr/java/jdk1.7.0_11
export JAVA_HOME 
PATH=$JAVA_HOME/bin:$PATH
export PATH         

 
[root@CSSW2013NOC3 ~]#su - jboss

[jboss@CSSW2013NOC3 ~]$ java -version
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) Server VM (build 23.6-b04, mixed mode)

Step 6: Create a start/stop/restart script for JBoss.

[root@CSSW2013NOC3 ~]#cd /usr/share/jboss-as/bin/init.d

[root@CSSW2013NOC3 ~]#cp jboss-as-standalone.sh /etc/init.d/jboss

[root@CSSW2013NOC3 ~]#cat jboss-as-standalone.sh


 Step 7: To set the JBOSS_USER, add the following lines to script:

JBOSS_USER=jboss
export JBOSS_USER

You can add the lines just under 'export JAVA_HOME' on line 18 or so below. 

[root@CSSW2013NOC3 ~]#nano jboss-as-standalone.sh

export JAVA_HOME
JBOSS_USER=jboss
export JBOSS_USER

Step 8: Run JBoss as a Service.

[root@CSSW2013NOC3 ~]#chmod 755 jboss

[root@CSSW2013NOC3 ~]# chkconfig --add jboss

[root@CSSW2013NOC3 ~]#chkconfig --level 234 jboss on 

[root@CSSW2013NOC3 ~]#service jboss start

[root@CSSW2013NOC3 ~]#service httpd status

[root@CSSW2013NOC3 ~]#service jboss status


Step 9:Let's start with adding a Management user as shown on the error page:

As root, navigate to /usr/share/jboss-as/bin

[root@CSSW2013NOC3 ~]#cd /usr/share/jboss-as/bin

[root@CSSW2013NOC3 ~]#./add-user.sh
  1. What type of user do you wish to add?  
  2.  a) Management User (mgmt-users.properties)  
  3.  b) Application User (application-users.properties)  
  4. (a):  
  5.   
  6. Enter the details of the new user to add.  
  7. Realm (ManagementRealm) :  
  8. Username : sankar
  9. Password :  *********
  10. Re-enter Password :  ******
  11. About to add user 'david' for realm 'ManagementRealm'  
  12. Is this correct yes/no? yes  
  13. Added user 'david' to file '/usr/share/jboss-as/standalone/configuration/mgmt-users.properties'  
  14. Added user 'david' to file '/usr/share/jboss-as/domain/configuration/mgmt-users.properties'  

 Step 10: Retstart JBoss to reload the the change to standalone:

[root@CSSW2013NOC3 ~]# service jboss stop

 stopping jboss-as: *** JBossAS process (25794) received TERM signal ***

[root@CSSW2013NOC3 ~]#service jboss start 

Starting jboss-as:                                         [  OK  ] 

***************************************************************************

Now, navigate back to http://YourIP:9990 and you should be prompted for the Management user credentials you just created:  

[root@CSSW2013NOC3 ~]#firefox http://localhost:9990 &

login uname
Password:

===========Jboss Management Console =============

1 comment: