September 2013
« Aug   Oct »

Install, configure and launch application on Jboss server.

I had an opportunity to setup a Jboss server for client to complete the dev. activities. I had any previous experience with Jboss even though just had hosted Opentaps few years before.

1. Where do I get Jboss installer file.

You may need to open an account with Jboss portal to download the latest jboss. Jboss 7.1.1.Final is the latest when the blog was posted which having 127MB in zip format.

2. JBOSS System requirements.

a. Latest JDK 1.7+ (java
b. System variables and Path ( JAVA_HOME,JBOSS_HOME) and add the binaries in system path.

I have created a file in system script folder(/etc/profile.d/ having the following lines.


Then execute the command,

 source /etc/profile.d/

Testing the variables was set.

root@dream [/home/installation]# echo $JAVA_HOME $JBOSS_HOME
/usr/local/jdk /usr/local/jboss7

3. Download the Jboss binary, unzip and copy to “/usr/local/jboss7”. We can run the JboSS in two modes either on standalone and domain mode. We can host any no. sites in standalone mode and domain mode is widely used for clustering setup supported by load balancer features.

Ok cool. Now we are ready to start Jboss server,

Starting jboss in a standalone mode,

Starting jboss : /usr/local/jboss7/bin/ > /dev/null 2>&1 &

4. How to configure Jboss to listen in all NIC adapters and enabling AJP connectors.

By default, Jboss listen only on loopback ip. So that you can access the default site (http://localhost:8080) and administrative url (:9990). Also AJP connector did not enabled by default jboss settings. I need to enable AJP connector (:8009)in order to run the application over Apache web server on a clean url.

The core configuration file is standalone.xml.

Enabling JBOSS listening to all IP address .

Now you need to take backup of standalone.xml and replace all the string to inside it. That’s it.

How to enable AJP port in Jboss

You just need to add the following line in standalone.xml just before the Virtualhost directive start (/usr/local/jboss7/standalone/configuration/standalone.xml).

  <connector name="AJP" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>


Your configuration file will look likes as shown below,

 <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
            <connector name="AJP" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
            <virtual-server name="default-host" default-web-module="myproject">
                <alias name="localhost"/>
                <alias name=""/>

Pls note my project module name is “myproject” which is running as default application for the domain “”

Now we need to start the JBoss application and verify that AJP connector is enabled.

#/usr/local/jboss7/bin/ > /dev/null 2>&1 &

Find out the AJP port and other listening ports,

root@dream [~]# netstat -nlp | grep "java"
tcp        0      0      *                   LISTEN      25071/java          
tcp        0      0      *                   LISTEN      25071/java          
tcp        0      0      *                   LISTEN      25071/java          
tcp        0      0      *                   LISTEN      25071/java          
tcp        0      0      *                   LISTEN      25071/java          
root@dream [~]#

Ok Perfect !

How do I deploy application in Jboss,

There are 5 ways I found from Google and I used 2 ways. ie

a. Uploading war file directly
to “deployment(/usr/local/jboss7/standalone/)” folder which is automatically deployed and can be accessible at http://serverip:8080/sampleapp/.

B. Use Web administrative url http://serverip:9990/sampleapp/ to upload your war file, Before you trying this option you may need to complete the following steps.

How Do I create JBOSS a admin user.
You can create admin user by command,

root@dream [/usr/local/jboss7/bin]# pwd
root@dream [/usr/local/jboss7/bin]#
What type of user do you wish to add?
 a) Management User (
 b) Application User (
(a): a
Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : jbossadmin
Password :
Re-enter Password :
About to add user 'jbossadmin' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'jbossadmin' to file '/usr/local/jboss7/standalone/configuration/'
Added user 'jbossadmin' to file '/usr/local/jboss7/domain/configuration/'
root@dream [/usr/local/jboss7/bin]

Once you created a Jboss Management userm you access the admin url at http://serverip:9990/console/App.html#deployments.


You may get the sample war file to test from here[].Once you able to upload successfully, you can see the application running at http://serverip:8080/sample or http://serverip/sample in AJP environment. If you want to run this application on root space itself, Just change the “context” path to “/” instead of “sample” on the second window after the war upload 🙂

7. How do I add the Jboss in system startup.

Jboss installer itself has shipped with an startup script which will be found in “$JBOS_HOME/bin/init.d” folder. Now you need to copy the file to etc,

root@dream [/usr/local/jboss7/bin/init.d]# pwd
root@dream [/usr/local/jboss7/bin/init.d]# ls
root@dream [/usr/local/jboss7/bin/init.d]# mkdir /etc/jboss-as/
[root@dream]# cp jboss-as.conf /etc/jboss-as/
[root@dream]#cp /etc/init.d/

Now we need to edit,/etc/jboss-as/jboss-as.conf and update the variable “JBOSS_USER to root”

In order to complete the start script, just to set JAVA_HOME and JBOSS_HOME variables inside it. That’s it.

root@dream [/usr/local/jboss7/bin/init.d]#chkconfig jboss on
 root@dream [/usr/local/jboss7/bin/init.d]# service jboss stop
Stopping jboss-as: *** JBossAS process (23943) received TERM signal ***   [  OK  ]
root@dream [/usr/local/jboss7/bin/init.d]# netstat -nlp | grep "java"
root@dream [/usr/local/jboss7/bin/init.d]# service jboss start
Starting jboss-as:                         [  OK  ]
root@dream [/usr/local/jboss7/bin/init.d]#

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>