How to install JBoss application server in CentOS

To install JBoss application server in CentOS

JBoss open source application server program and related middleware services marketed under the JBoss Enterprise Middleware brand. JBoss is an open source alternative to IBM WebSphere and SAP NetWeaver. It is Java-based, the JBoss application server operates cross-platform which is usable on any operating system that supports Java.

Installing JBoss

JBoss requires prior installation of Java on your system. Install it if it is not there on your system. Download the java package from the oracle website: http://download.oracle.com/otn/java/jdk/7u5-b06/jdk-7u5-linux-x64.tar.gz

You need an Oracle account to download this file..
Choose the version you want to download.

Download has been completed.

Once the file is downloaded, create directory for java in /usr/ directory.

[root@localhost  ~]# mkdir /usr/java 

Once th directory is created, change its location to Downloads and move the downloaded file to /usr/java

[root@localhost  ~]# cd Downloads
[root@localhost  Downloads]# mv jdk-7u5-linux-x64.tar.gz /usr/java/

Change directory to /usr/java/ and extract the package.

[root@localhost  Downloads]# cd /usr/java
[root@localhost  java]# tar &ndash xvf jdk-7u5-linux-x64.tar.gz

jdk1.7.0_05/jre/lib/amd64/libzip.so
jdk1.7.0_05/jre/lib/amd64/headless/
jdk1.7.0_05/jre/lib/amd64/headless/libmawt.so
jdk1.7.0_05/jre/lib/amd64/libjsound.so
&hellip 
&hellip 
&hellip 
jdk1.7.0_05/jre/plugin/desktop/
jdk1.7.0_05/jre/plugin/desktop/sun_java.png
jdk1.7.0_05/jre/plugin/desktop/sun_java.desktop
jdk1.7.0_05/jre/COPYRIGHT
jdk1.7.0_05/LICENSE
jdk1.7.0_05/COPYRIGHT

Now all is set for the installation of JBoss. Download the JBoss installation package by using the link: http://jbossas.jboss.org/downloads

[root@localhost share]# wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
--2017-02-23 13:28:17--  http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
Resolving download.jboss.org... 104.108.220.155
Connecting to download.jboss.org|104.108.220.155|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 133255203 (127M) [application/zip]
Saving to: “ jboss-as-7.1.1.Final.zip” 
100%[====================================================================> ] 133,255,203  411K/s   in 4m 24s  
2017-02-23 13:32:41 (493 KB/s) - “ jboss-as-7.1.1.Final.zip”  saved [133255203/133255203]

Unzip the downloaded package by invoking the following command.

[root@localhost share]# unzip -q jboss-as-7.1.1.Final.zip

Rename the directory as follows.

[root@localhost share]# mv jboss-as-7.1.1.Final jboss-as

Add the JBoss group and user in it as follows.

[root@localhost share]# groupadd jboss
[root@localhost share]# useradd -s /bin/bash -g jboss jboss

Now change the ownership for jboss-as directory as follows.

[root@localhost share]# chown -Rf jboss.jboss /usr/share/jboss-as

Place the Java package into the path of JBoss and root users.

[root@localhost share]# cd /home/jboss/
[root@localhost jboss]# ls -la
total 28
drwx------. 4 jboss jboss 4096 Feb 23 13:38 .
drwxr-xr-x. 4 root  root  4096 Feb 23 13:38 ..
-rw-r--r--. 1 jboss jboss   18 Feb 22  2013 .bash_logout
-rw-r--r--. 1 jboss jboss  176 Feb 22  2013 .bash_profile
-rw-r--r--. 1 jboss jboss  124 Feb 22  2013 .bashrc
drwxr-xr-x. 2 jboss jboss 4096 Nov 12  2010 .gnome2
drwxr-xr-x. 4 jboss jboss 4096 Feb  9 20:14 .mozilla
[root@localhost jboss]# vim .bash_profile

Add the following lines to the file.

JAVA_HOME=/usr/java/jdk1.7.0_05  
export JAVA_HOME  
PATH=$JAVA_HOME/bin:$PATH  
export PATH

[root@localhost jboss]# cd /root/
[root@localhost ~]# vim .bash_profile 

Also, add the following lines to the file.

JAVA_HOME=/usr/java/jdk1.7.0_05  
export JAVA_HOME  
PATH=$JAVA_HOME/bin:$PATH  
export PATH

Check your java version with the help of the following command.

[root@localhost ~]# java --version
java version " 1.7.0_09-icedtea" 
OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_64)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

After checking, change the directory to init.d directory.

[root@localhost ~]# cd /usr/share/jboss-as/bin/init.d/
[root@localhost init.d]# ll
total 8
-rw-r--r--. 1 jboss jboss  369 Mar 10  2012 jboss-as.conf
-rwxr-xr-x. 1 jboss jboss 3681 Mar 10  2012 jboss-as-standalone.sh

Copy the jboss-as-standalone.sh script file to /etc/init.d/jboss

[root@localhost init.d]# cp jboss-as-standalone.sh /etc/init.d/jboss

And now change directory to init.d

[root@localhost init.d]# cd /etc/init.d/

Once the directory is changed, edit the jboss file by adding the following lines below Export JAVA_HOME

JBOSS_USER=jboss
export JBOSS_USER

Next step is to set permission for the jboss file

[root@localhost init.d]# chmod 755 jboss 

Start the JBoss service as follows.

[root@localhost init.d]# service jboss start
Starting jboss-as:                                         [  OK  ]

Now, stop the JBoss service

[root@localhost init.d]# service jboss stop
Stopping jboss-as: *** JBossAS process (29014) received TERM signal ***
                                                           [  OK  ]

Change directory to /usr/share/jboss-as/standalone/configuration/

[root@localhost init.d]# cd /usr/share/jboss-as/standalone/configuration/

And then edit the standalone.xml file. Open the file as follows

[root@localhost configuration]# vim standalone.xml 


Once you are in the standalone.xml file, change the bind address in the public interface as follows. Save it and exit after the appropriate changes are made.
Change it from 127.0.0.1 to 0.0.0.0

Finally start the JBoss service by using the following command.

[root@localhost configuration]# service jboss start
Starting jboss-as:                                         [  OK  ]


Open the web browser and navigate to http://192.168.7.215:8080. The Jboss Application server welcome page appears on your screen.

FAQ
Q
Where do I configure logs in JBoss AS 6?
A
Log configuration has moved from the "conf" folder to the deploy folder. The new configuration file name is JBoss-logging.xml.
Q
What is JBoss Tools Integration Stack?
A
JBoss Tools integration stack is a set of Eclipse plugins that add support for JBoss SOA and Business rules related frameworks, such as Drools, jbpm, SwitchYard, Fuse, etc.
Q
What is JBoss Tools?
A
JBoss Tools is a set of plugins for Eclipse that complements, enhances and goes beyond the support that exists for JBoss and related technologies in the default Eclipse distribution
Q
Which operating systems, runtimes, and frameworks does JBoss Tools support?
A
In general JBoss Tools attempts to ensure you can continue to use both old and new runtimes & frameworks with its releases but we do not add new features to old streams. Support for the latest & greatest runtimes will only be available in the latest releases. This Matrix gives an overview of the various supported frameworks, runtimes, operating systems, platforms, and JDK versions.
Q
How do I install JBoss Tools Integration Stack?
A
The recommended approach is to use JBoss Central to select the features from the Integration Stack you would like to use. JBoss Central is included in both JBoss Tools and JBoss Developer Studio for your convenience.