WildFly, formerly known as JavaBeans Open Source Software Application Server (JBoss AS, or simply JBoss) is an application server that implements the Java Platform, Enterprise Edition (Java EE).

JBoss is written in Java and as such is cross-platform: usable on any operating system that supports Java.JBoss_by_Red_Hat

JBoss was developed by JBoss, now a division of Red Hat. Licensed under the terms of the GNU Lesser General Public License, JBoss is free and open source software.

JBoss itself is open source, but Red Hat charges to provide a support subscription for JBoss Enterprise Middleware. Before November 2010 JBoss was licensed as annual subscription in bundles of 4 and 32 CPU sockets. As of November 2010 the licensing changed and all cores on the system are now counted. The core bundles licensing is available for 16 and 64 cores.The renaming to WildFly was done to reduce confusion. The renaming only affects the JBoss Application Server project. The JBoss Community or the Red Hat JBoss product line (with JBoss Enterprise Application Platform) all retain their names.

Install JBoss 6 on CentOS

Step 1: Download and Install the Java Development Kit (JDK)
You can download the JDK here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
I’m using JDK 6, update 24, the latest as of this post. The JDK is specific to 32 and 64 bit versions.
My CentOS box is 64 bit, so I’ll need: jdk-6u24-linux-x64.bin.
If you are on 32 bit, you’ll need: jdk-6u24-linux-i586.bin
Download the appropriate JDK and save it to a directory. I’m saving it to /root.
Move (mv) or copy (cp) the file to the /opt directory:
[root@sv2 ~]# mv jdk-6u24-linux-x64.bin /opt/jdk-6u24-linux-x64.bin

Create the directory /usr/java.
[root@sv2 ~]# mkdir /usr/java

Change to the /usr/java directory we created and install the JDK using ‘sh /opt/jdk-6u24-linux-x64.bin’
1. [root@sv2 ~]# cd /usr/java
2. [root@sv2 java]# sh /opt/jdk-6u24-linux-x64.bin

We now have the JDK installed at /usr/java/jdk1.6.0_24. We’ll use this for our JAVA_HOME a bit later in step

Step 2: Download and Install JBoss 6.0 Application Server

Download jboss-6.0.0.Final.zip at http://sourceforge.net/projects/jboss/files/JBoss/jboss-6.0.0.Final/ or use wget:
Move (mv) or copy (cp) the file to /usr/share/jboss-6.0.0.Final.zip.
[root@sv2 ~]# mv jboss-as-distribution-6.0.0.Final.zip /usr/share/jboss-as-distribution-6.0.0.Final.zip

Change to the /usr/share directory and unzip the file:
1. [root@sv2 ~]# cd /usr/share
2. [root@sv2 share]# unzip -q jboss-as-distribution-6.0.0.Final.zip

The unzip will create the following directory: /usr/share/jboss-6.0.0.Final
This directory will be our JBOSS_HOME, which we will use below in Step 4.

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

Since we will want to run JBoss as a non-root user with minimal privileges, we’ll create a user, jboss, who will own the JBoss files and JBoss will run under his account.
To do this, we can need to the following.

Create a new group, jboss, and then create the user jboss and add the user to the jboss group.
1. [root@sv2 ~]# groupadd jboss
2. [root@sv2 ~]# 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.
[root@sv2 ~]# chown -Rf jboss.jboss /usr/share/jboss-6.0.0.Final/

Step 4: Set the required JAVA_HOME and JBOSS_HOME paths

We no need to set the JAVA_HOME and JBOSS_HOME.
The JAVA_HOME is where we installed the JDK above, /usr/java/jdk1.6.0_24, and the JBOSS_HOME is where we installed JBoss above /usr/share/jboss-6.0.0.Final.

Add the following to the jboss users .bash_profile:
1. JAVA_HOME=/usr/java/jdk1.6.0_24
2. export JAVA_HOME
4. export PATH
5. JBOSS_HOME=/usr/share/jboss-6.0.0.Final
6. export JBOSS_HOME

To set the JAVA_HOME for users, we add this to the user ~/.bashrc or ~/.bash_profile of the user. We can also add it /etc/profile and then source it to give to all users.
1. JAVA_HOME=/usr/java/jdk1.6.0_24
2. export JAVA_HOME
4. export PATH

Once you have added the above to ~/.bash_profile or ~/.bashrc, you should su to the user jboss and verify that the JAVA_HOME and JBOSS_HOME are set correctly.
1. [root@sv2 ~]# su jboss
2. [jboss@sv2 ~]# echo $JAVA_HOME
3. /usr/java/jdk1.6.0_24
4. [jboss@sv2 ~]# echo $JBOSS_HOME
5. /usr/share/jboss-6.0.0.Final

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

For our JBoss script we will simply copy the existing jboss_init_redhat.sh script located at at /usr/share/jboss-6.0.0.Final/bin, copy it to /etc/init.d and rename it to ‘jboss’:
So, as root:
1. [root@sv2 ~]# cd /usr/share/jboss-6.0.0.Final/bin
2. [root@sv2 bin]# cp jboss_init_redhat.sh /etc/init.d/jboss

In the jboss script (shown completed below), make the following changes:

1. Add lines 3,4, and 5:
# description: JBoss Start Stop Restart
# processname: jboss
# chkconfig: 234 20 80
2. Line 22, Set the JBOSS_HOME to where we unpacked JBoss in step 2 above:

3. Line 28. Set the JAVA_HOME to where we installed the JDK in step 1 above:

4. Add line 34, which sets the JBOSS_HOST to, allowing JBoss to bind to any IP.
1. #!/bin/sh
2. #
3. # description: JBoss Start Stop Restart
4. # processname: jboss6
5. # chkconfig: 234 20 80
6. # $Id: jboss_init_redhat.sh 81068 2008-11-14 15:14:35Z dimitris@jboss.org $
7. # JBoss Control Script
8. # To use this script run it as root – it will switch to the specified user
9. # Here is a little (and extremely primitive) startup/shutdown script
10. # for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
11. # it’s run by user ‘jboss’ and JDK binaries are in /usr/local/jdk/bin.
12. # All this can be changed in the script itself.
13. # Either modify this script for your requirements or just ensure that
14. # the following variables are set correctly before calling the script.
15. #define where jboss is – this is the directory containing directories log, bin, conf etc
16. JBOSS_HOME=${JBOSS_HOME:-“/usr/share/jboss-6.0.0.Final”}
17. #define the user under which jboss will run, or use ‘RUNASIS’ to run as the current user
18. JBOSS_USER=${JBOSS_USER:-“jboss”}
19. #make sure java is in your path
20. JAVAPTH=${JAVAPTH:-“/usr/java/jdk1.6.0_24”}
21. #configuration to use, usually one of ‘minimal’, ‘default’, ‘all’
22. JBOSS_CONF=${JBOSS_CONF:-“default”}
24. #if JBOSS_HOST specified, use -b to bind jboss services to that address

Step 6: Run JBoss as a Service.

To run JBoss as a service and enable start up at boot, make the script we created above executable and add it to our chkconfig so it starts at boot.
1. [root@sv2 init.d]# chmod 755 jboss
2. [root@sv2 init.d]# chkconfig –add jboss
3. [root@sv2 init.d]# chkconfig –level 234 jboss on
We should now be able to Start, Stop, and Restart JBoss as a service.

Start JBoss:

Note: JBoss can take some time to start.
1. [root@sv2 init.d]# service jboss6 start
2. JBOSS_CMD_START = cd /usr/share/jboss-6.0.0.Final/bin; /usr/share/jboss-6.0.0.Final/bin/run.sh -c default -b
Stop JBoss:
1. [root@sv2 init.d]# service jboss6 stop
2. JBOSS_CMD_START = cd /usr/share/jboss-6.0.0.Final/bin; /usr/share/jboss-6.0.0.Final/bin/run.sh -c default -b
3. Shutdown message has been posted to the server.
4. Server shutdown may take a while – check logfiles for completion

Step 7: Access the JBoss Admin.

Make sure JBoss is started and you should now be able to access the Jboss Console at:

http://yourdomain.com:8080 or http://yourip:8080

The default user name and password for the JBoss Admin Console is admin/admin


Posted on July 10, 2013, in Link Pages. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: