You are on page 1of 7

Setup JBoss on Red Hat Enterprise Linux 5 (RHEL5) Server

Install JDK (Java Development Kit)


o o o

After the download is complete, extract and install the JDK. Login to your Linux box as the root user Launch Terminal by selecting Applications > Accessories > Terminal

o o o

Change directory to where you placed the JDK file that you downloaded. Make the download executable with this command Execute the installater

1 ./jdk-6u7-linux-i586-rpm.bin

Note: The "./" is part of the above code, use it like it is seen or it will not work. I know this happened to me.
o

A license agreement will appear on your screen displayed through the more command. Simply press the enter key until you get to the end, or just press the q key to skip right to the end.

o o

At the end of the agreement, type yes to agree to it and continue with the install. The JDK will unpack and install itself. Your screen output should look similar to the following:

Note: In this example, the JDK was already inflated, hence the choice to overwrite.

The install routine installs the files into the directory /usr/java/jdk1.6.0_07. It also creates two links in that directory named default and latest. Add the JDK to the PATH for all users by editing the /etc/profile file and place the following two lines at the bottom of your file:

1 JAVA_HOME=/usr/java/default; export JAVA_HOME 2 PATH=$JAVA_HOME/bin:$PATH; export PATH o

Logout of the system and then login, you should be able to run the java command through Terminal to display the version. Run the this command:

java -version

Install Jboss o Download JBoss Application Server I used the latest Stable release, version 4.2.3.GA.

Then select jboss-4.2.3.GA.zip and press download.

After the download is complete, use Computer, go to Filesystem, usr, lib

Create a folder jboss

Drag jboss-4.2.3.GA.zip to the folder /usr/lib/jboss

Double-click jboss-4.2.3.GA.zip

Press extract and choose All Files to the folder jboss

In the jboss folder, press run.sh, and when prompted select Run in Terminal.

The terminal window will look like the following if all went well.

By default jboss will run and only be accessible as 127.0.0.1 and not available to any other connection.

So that JBoss Application Server will be available outside of 127.0.0.1 a bind needs to be made. When launching JBoss in Terminal or with a link, use the following commands:

cd /usr/lib/jboss/jboss-4.2.3.GA/bin ./run.sh -b 192.168.1.55 all

Note: change the IP address to your IP address.


o

To have the JBoss Application Server be part of a cluster, use the following commands instead.

cd /usr/lib/jboss/jboss-4.2.3.GA/bin ./run.sh -c all -Djboss.bind.address=192.168.1.55

The results of the command switches from another workstation:

Create the script in /etc/rc.d/init.d


As root (su - root) type vi /etc/rc.d/init.d/jboss and paste the below:

#! /bin/sh start(){ echo "Starting jboss.." # If using an SELinux system such as RHEL 4, use the command below # instead of the "su": # eval "runuser - jboss -c '/opt/jboss/current/bin/run.sh > /dev/null 2> /dev/null &' # if the 'su -l ...' command fails (the -l flag is not recognized by my su cmd) try: # sudo -u jboss /opt/jboss/bin/run.sh > /dev/null 2> /dev/null & su -l jboss -c '/opt/jboss/current/bin/run.sh > /dev/null 2> /dev/null &' } stop(){ echo "Stopping jboss.." # If using an SELinux system such as RHEL 4, use the command below # instead of the "su": # eval "runuser - jboss -c '/opt/jboss/current/bin/shutdown.sh -S &' # if the 'su -l ...' command fails try: # sudo -u jboss /opt/jboss/bin/shutdown.sh -S & su -l jboss -c '/opt/jboss/current/bin/shutdown.sh -S &' } restart(){ stop # give stuff some time to stop before we restart sleep 60 # protect against any services that can't stop before we restart (warning this kills all Java instances running as 'jboss' user) su -l jboss -c 'killall java'

# if the 'su -l ...' command fails try: # sudo -u jboss killall java start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo "Usage: jboss {start|stop|restart}" exit 1 esac exit 0

You might also like