Skip to content


How to install Jboss Application server on Linux.

Howto Install Jboss on Linux ?

# First install JDK

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

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

# Give Excute permission to binary file

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

# Now run the binary file

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

# Now create Softlink

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

# Export the JAVA HOME and JAVA path

[root@proot 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@proot local]# source /root/.bash_profile

# Now Download JBoss Application Server
http://downloads.sourceforge.net/jboss/jboss-4.2.3.GA.zip?modtime=1216412104&big_mirror=1
/

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

# Create Softlink

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

# Export the JBOSS path

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

# Add the following lines

JBOSS_HOME=/usr/local/jboss

export JBOSS_HOME

# Save and exit

[root@proot local]# cd jboss
[root@proot jboss]# cd bin

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

[root@proot 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@proot 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@proot 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@proot 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@proot /]# download tomcat-connectors-1.2.27-src.tar.gz
[root@proot /]# tar -zxvf tomcat-connectors-1.2.27-src.tar.gz
[root@proot /]# cd tomcat-connectors-1.2.27-src

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

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

# Copy mod_jk.so file under modules directory

[root@proot native]# cd apache 2.0

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

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

[root@proot /]# 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@proot /]# 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@proot /]# 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 unixsurgeon.com
ServerAlias http://www.unixsurgeon.com
DocumentRoot /home/unix/
ServerAdmin info@unixsurgeon.com
JkMount /* node1
</VirtualHost>

<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@p-root /]#

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

Enjoy Linux……….. !!!

Posted in JBoss.

Tagged with , .


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. KrisBelucci says

    I really liked this post. Can I copy it to my site? Thank you in advance.



Some HTML is OK

or, reply to this post via trackback.