How To Install Jboss J2EE Application Server on Linux

jboss_logo

How To Install Jboss J2EE Application Server on Linux

Scope:
In this tutorial we will show how to install and configuration RHEL Jboss.

What is Jboss?

It is an open-source application server developed by RedHat based on the J2EE platform for developing and deploying enterprise Java applications, Web applications, Services, Portals and more. The J2EE allows applications to be standardized and modular allowing JAVA to handle many programming aspects when developing an application.

Jboss Directory Structure

Jboss Directory Structure Overview

Default Server Configuration File Set
An expanded view of the default server configuration file set conf and deploy directories

Prerequisites

Jboss binaries

*The most recent release of JBoss is available from the SourceForge JBoss project files page, http://sourceforge.net/projects/jboss. You will also find previous releases as well as beta and release candidate versions of upcoming releases.

Implementation Installation Steps

    Step 1: JDK installation and verification
    Step 2: Download JBoss and the installation procedure
    Step 3: Create the appropriate user
    Step 4: Start our new JBoss server and verify that the server has started properly
    Step 5: Stop the new JBoss server and verify that the server has shutdown properly

Step 1: JDK Installation and verification

The first step before installing JBoss AS 7, is to install a JDK. Any JDK can be used, such as Sun JDK, OpenJDK, IBM JDK, or JRocket etc. We chose Open JDK 6 for this tutorial, because it is the new Java reference implementation starting with Java 7.

NOTE: JDK 7 and above can also be used with JBoss. A JRE is also sufficient to run JBoss 7, however a JRE does not include some of the additional feature of a JDK.
Installing OpenJDK:
Issue the following command to install the JDK:

$ su -c “yum install java-1.8*”
Confirming the install:

Issue the following command to confirm that the proper version of the JDK is on your classpath:

$ java -version

NOTE: For our installation, we are not defining a explicit JAVA_HOME for JBoss AS 7. The default works in this situation, because we don’t have multiple java versions installed. For most production environments with multiple versions of Java, it is recommended to set the JAVA_HOME in the standalone.conf or domain.conf files.
Step 2: Download JBoss and the installation procedure

The next step is to download the appropriate version of JBoss AS 7. We will download the .zip version of JBoss AS 7, and install it using the unzip utility.
Downloading JBoss AS 7.1.1.Final:

Issue the following wget to download jboss-as-7.x Final.zip:

wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip

NOTE: jboss-as-7.1.1.Final.zip can also be downloaded with your favorite browser from the http://www.jboss.org/jbossas/downloads/ page.
Installing JBoss AS 7.1.1.Final:

Next, we issue the following unzip command to finally install jboss-as-7.1.1.Final in the /usr/share directory:

$ unzip jboss-as-7.1.1.Final.zip -d /usr/share

## chown jboss: -R /opt/jboss-as-7.1.1.Final

Ok, with all that in place we are somewhat ready to start the JBoss server. Before doing so, let’s fine-tune some stuff, like enable access to the JBoss web interface and set it up to run as a system service, so that it can automatically start on system start-up and you can use service jboss [start|stop] etc to manage the Jboss service.

– enable access to JBoss interface:

## vim /opt/jboss-as-7.1.1.Final/standalone/configuration/standalone.xml

<interface name=”management”>
<!–<inet-address value=”${jboss.bind.address.management:127.0.0.1}”/>–>
<any-ipv4-address/>
</interface>
<interface name=”public”>
<!–<inet-address value=”${jboss.bind.address:127.0.0.1}”/>–>
<any-ipv4-address/>
</interface>

This will make JBoss’ public and management frontend available from anywhere (using authentication of course) so you can manage it via a browser.

– set-up Jboss to run as a service

## cp /opt/jboss-as-7.1.1.Final/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss
## chmod +x /etc/init.d/jboss
## mkdir /etc/jboss-as

add the following configuration parameters

## vim /etc/jboss-as/jboss-as.conf

JBOSS_HOME=/opt/jboss-as-7.1.1.Final
JBOSS_CONSOLE_LOG=/var/log/jboss-console.log
JBOSS_USER=jboss

start and add the JBoss server to your CentOS VPS system start-up services using the following commands:

## service jboss start
## chkconfig jboss on
Alternatively, any directory can be chosen for the JBoss 7 installation.
Step 3: Create the appropriate user

Now that JBoss AS 7, is installed, we need to make sure that we create a user with the appropriate privileges. It is never a good idea to run JBoss as root for various reasons.
Create the new user:

We create a new user called jboss by issuing the following command:

n order to use the administration console you need to create new JBoss users using the add-user.sh script in the bin/ directory within your JBoss installation (which in this case is /opt/jboss-as-7.1.1.Final/bin).

example:

## cd /opt/jboss-as-7.1.1.Final/bin
## ./add-user.sh

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a): a

Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : testuser
Password :
Re-enter Password :
About to add user 'testuser' for realm 'ManagementRealm'
Is this correct yes/no? y
Added user 'testuser' to file '/opt/jboss-as-7.1.1.Final/standalone/configuration/mgmt-users.properties'
Added user 'testuser' to file '/opt/jboss-as-7.1.1.Final/domain/configuration/mgmt-users.properties'

You can now access your JBoss administration console at http://YOUR_IP:8080/console using the newly created testuser account.

Reference

Install Jboss Enterprise Application Platform on  RHEL 7.X
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/installation_guide/

Installing and Building Jboss Server
https://docs.jboss.org/jbossas/jboss4guide/r2/html/ch01.html

How To Install Jboss 7.X ON Cent OS
http://www.opensourcearchitect.co/resources/tutorials/installing-jboss-7-1-on-centos-6

Jboss Binaries Files
http://sourceforge.net/projects/jboss

The JBoss directory structure
https://docs.jboss.org/jbossas/guides/installguide/r1/en/html/dirs.html

Video Tutorials

How To Install Jboss on RHEL 7

How Manage Operations, Adminstrations, Management of JBOSS AS7

 

 


Leave a Reply

Your email address will not be published. Required fields are marked *