Howto install JBoss Application server.

Dec-26th-2008

How to Install Jboss on Fedora | Centos | Redhat

# First we need to install JDK

[root@map007 /]# cd /usr/local

[root@map007 local]# downlaod JDK http://java.sun.com/javase/downloads/index.jsp

# Give Excute permission to binary file

[root@map007 local]# chmod u+x jdk-6u11-linux-i586.bin

# Now run the binary file

[root@map007 local]# ./jdk-6u11-linux-i586.bin

# Now create Softlink

[root@map007 local]# ln -s /usr/local/jdk1.6.0_11 jdk

# Export the JAVA HOME and JAVA path

[root@map007 local]# vi /root/.bash_profile & vi /root/.bashrc

# Add the following lines

JAVA_HOME=/usr/local/jdk

export JAVA_HOME

JAVA=/usr/local/jdk/bin

export JAVA

# Save and exit

[root@map007 local]# source /root/.bash_profile

# Now Download JBoss Application Server

[root@map007 local]# wget http://downloads.sourceforge.net/jboss/jboss-4.2.3.GA.zip?modtime=1216412104&big_mirror=1

[root@map007 local]# unzip jboss-4.2.3.GA.zip

[root@map007 local]# cd jboss-4.2.3.GA

# Create Softlink

[root@map007 local]# ln -s /usr/local/jboss-4.2.3.GA jboss

# Export the JBOSS path

[root@map007 local]# vi /root/.bash_profile & vi /root/.bashrc

# Add the following lines

JBOSS_HOME=/usr/local/jboss

export JBOSS_HOME

# Save and exit

[root@map007 local]# cd jboss

[root@map007 jboss]# cd bin

# Now you have to edit run.sh , shutdown.sh and create start.sh file

[root@map007 bin]# vi run.sh

# Edit following lines

JAVA_HOME=”/usr/local/jdk/”

export JAVA_HOME

JAVA=”/usr/local/jdk/bin/java”

JBOSS_HOME=”/usr/local/jboss”

export JBOSS_HOME

# Now comment out Setup the JVM section and check following lines as per figure.

runjar=”$JBOSS_HOME/bin/run.jar”

JAVAC_JAR_FILE=”$JAVA_HOME/lib/tools.jar”

# These two lines should be as in figure.
# Now after making these changes save and quit from run.sh

# Now edit shutdown.sh file

[root@map007 bin]# vi shutdown.sh

# Now comment out Setup the JVM section and add following lines as per figure.

JAVA_HOME=”/usr/local/jdk/”

export JAVA_HOME

JAVA=”/usr/local/jdk/bin/java”

export JAVA

# After adding these lines, save and quit from shutdown.sh script.
# Now is the time to write a small startup script, named start.sh

[root@map007 bin]# vi start.sh

#!/bin/bash

JBOSS_HOME=/usr/local/jboss

export JBOSS_HOME

touch $JBOSS_HOME/nohup.out

nohup sh run.sh -c all &

(sleep 5; chmod 755 $JBOSS_HOME/nohup.out) &

# Save and Exit

# Use start.sh script to start JBoss Server, and tail –f nohup.out command to see the Jboss server output on STDOUT,

# You can also bind any ip with it through this command.

[root@map007 bin]# ./run.sh -b 192.168.0.1

# Now access your Jboss on 8080 port from the Browser !!!

***** Now JBOSS integration with Apache ******

# Install mod_jk tomcat connector

[root@map007 /]# download tomcat-connectors-1.2.27-src.tar.gz
[root@map007 /]# tar -zxvf tomcat-connectors-1.2.27-src.tar.gz
[root@map007 /]# cd tomcat-connectors-1.2.27-src

[root@map007 tomcat-connectors-1.2.27-src]# cd native

[root@map007 native]# ./configure –with-apxs=/usr/local/apache/bin/apxs
[root@map007 native]# make
[root@map007 native]# make install

# Copy mod_jk.so file under modules directory

[root@map007 native]# cd apache 2.0

[root@map007 native]# cp mod_jk.so /usr/local/apache/modules/

# Now create workers.properties file and add the following lines

[root@map007 /]# vi /usr/local/apache/conf/workers.properties

workers.jboss_home=/usr/local/jboss

workers.java_home=/usr/local/jdk

ps=/

worker.list=node1

worker.default.port=8009

worker.default.host=localhost

worker.default.type=ajp13

worker.default.lbfactor=1

# Save and Exit

# Create mod_jk.conf file and add following line

[root@map007 /]# vi /usr/local/apache/conf/mod_jk.conf

JkWorkersFile /usr/local/apache/conf/workers.properties

JkLogFile /var/log/mod_jk.log

JkLogLevel info

JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ”

JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

JkRequestLogFormat “%w %V %T”

# Save and Exit

# Now add following line in httpd.conf

[root@map007 /]# vi /etc/httpd/conf/httpd.conf

LoadModule jk_module modules/mod_jk.so

Include “/usr/local/apache/conf/mod_jk.conf”

<VirtualHost 192.168.0.1:80>
ServerName linuxsurgeon.org
ServerAlias http://www.linuxsurgeon.org
DocumentRoot /home/linux/
ServerAdmin info@linuxsurgeon.org
JkMount /* node1
</VirtualHost>

# Save and Exit

# Now you have successfully install and integrate JBoss AP with Apache

[root@map007 /]#

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

Enjoy Linux !!!

Mega World News Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google Yahoo Buzz StumbleUpon Weekend Joy

Comments

  1. isurux Said,

    Really useful information. Thnax a lot ‘piyushmap’

  2. Wordpress Themes Said,

    Genial brief and this post helped me alot in my college assignement. Gratefulness you on your information.

Add A Comment

*