Tuesday, October 18, 2011

Installation of Jboss 6.1 Server on Centos 6

JBoss Application Server (or JBoss AS) is an open-source Java EE-based application server.

1Download and Install the Java Development Kit (JDK)
i.Downoad Latest version of JDK and move it to /opt directory.
ii.Create the  directory /usr/java and install the JDCK from here.
 Go to /usr/java  and
#chmod +x /opt/jdk-6u26-linux-..bin
#./ jdk-6u26-linux-..bin

2.Download and Install Jboss.
    First download jboss and then  Put jboss directory to /usr/share

3: Create the user, jboss, who will own and run JBoss
# groupadd jboss 
# useradd -s /bin/bash -g jboss jboss 
Change ownership of the JBoss home directory, /usr/share/jboss-6.0.0.Final so all files are owned by the user jboss we created.
# chown -Rf jboss.jboss /usr/share/jboss-6.1.0.Final/ 

 Set the required JAVA_HOME and JBOSS_HOME paths
i.go to jboss home folder
#cd /home/jboss
ii.List the Directory
#ls –a
iii.Open .bash_profile file and add the following to the file
JAVA_HOME=/usr/java/jdk1.6.0_26 
export JAVA_HOME 
PATH=$JAVA_HOME/bin:$PATH 
export PATH 
JBOSS_HOME=/usr/share/jboss-6.1.0.Final 
export JBOSS_HOME 

To check
#su jboss
#echo $JAVA_HOME.This should display following
/usr/java/jdk1.6.0_26
#  echo $JBOSS_HOME  This should display following
/usr/share/jboss-6.0.0.Final 

 Create a start/stop/restart script for JBoss.
i.Copy existing script to /etc/init.d
#cd /usr/share/jboss-6.1/bin
#cp jboss_init_redhat.sh /etc/init.d/jboss
Now go to /etc/init.d
Open jboss and add followings
i.Add lines 3,4, and 5:

# description: JBoss Start Stop Restart
# processname: jboss
# chkconfig: 2345 20 80

ii.Set the JBOSS_HOME to where we unpacked JBoss.
JBOSS_HOME=${JBOSS_HOME:-"/usr/share/jboss-6.0.0.Final"}


iii.Set the JAVA_HOME to where we installed the JDK.
JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.6.0_26"}


iv. Add line 34, which sets the JBOSS_HOST to 0.0.0.0, allowing JBoss to bind to any IP.
JBOSS_HOST="0.0.0.0"
       (Just aboce JBOSS_BIND_ADDR)

Run JBoss as a Service.
Go to /etc/init.d
#chmod 755 jboss 
#chkconfig --add jboss 
#chkconfig --level 234 jboss on 
#service jboss start

Jboss takes some times to start.

Now access Jboss server on browser.
http://localhost:8080
The default username and password is admin admin
The default username and password can be changed by editing
 /usr/share/jboss-6.1.0.Final/server/default/conf/props  file.


No comments:

Post a Comment