This short tutorial describes how to configure JBoss Application Server (Jboss GA 5.1.0) on a debian linux (Debian GNU/Linux 5.x “Lenny” ). Article starts with installation of java JDK and continues with JBoss installation and basic configuration according to standard file system hierarchy. Also init.d. scripts configuration is given here.
Installing Java SDK
Nowadays installing Java environment on Debian is an easy task. I used JDK 1.6. Don’t confound JDK with JRE, because bare Java Runtime Environment is not enough for running JBoss. Debian Wiki maintains (hope) a list of available java .deb packages, which are easily can be installed with your preferred way. I prefer aptitude, but apt-get of course works too.
$ aptitude install sun-java6-jdk
#or by good old apt-get.
$ apt-get install sun-java6-jdk
Installation is done after seconds. Now test your java installation with
$ java -version
# Here example result on my configuration:
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)
If you get something like this, you’re done and your java should be already in the PATH.
Installing JBoss AS
Now let’s install JBoss Application Server.
Preparing
Normally you are not willing to start services (especially when they are accessed from outher machines) with root privileges. Therefore we have to define new user and group which will be used to manage JBoss. So next line will create new group and new user with this group.
$ groupadd jboss
$ useradd -s /bin/bash -d /home/jboss -m -g jboss jboss
This jboss user has no password, so nobody can login with this username. If you consider to login with jboss user, password has to be set. Use passwd jboss command for that.
Download, Installation, filesystem layout
Now download desired Jboss version. I started with JBoss 5.1.0 GA, which can be download with:
$ cd /tmp # swithch to temp dir
$ wget http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA.zip/download
Check also the whole list of verisons if interested. As you may noticed JBoss binaries are packaged with ZIP. So it is comfortable to use unzip tool. Maybe you have to install it first.
But before you extract downloaded file, we have to decide, where exactly should JBoss files be placed on a file-system. Unfortunately JBoss is not quite conform to Linux File System Hierarchy Standard per default, so there are many possibilities for a location configuration. Some of you may want to place JBoss into /opt directory. But I prefer to split the installation a little bit and want to start by putting JBoss core files in /usr/local/, where local, unchangeable and read-only files usually placed. E.g. I use /usr/local/jboss/510 as JBoss 5.1.0 GA root. So let’s create that location and extract files into it.
mkdir /usr/local/jboss #create new jboss directroy
chown jboss:jboss /usr/local/jboss #now its belongs touser jboss and group jboss
su jboss
mkdir /usr/local/jboss/510
cd /usr/local/jboss/510
unzip /tmp/jboss-5.1.0.GA.zip
At this moment you should have new working JBoss. If you want, test it with
bin/run.sh -b 0.0.0.0
Where -b 0.0.0.0 means that JBoss is listening for every ip address of current machine.
However at this stage the installed Jboss still brakes the Linux Filesystem Hierarchy Standard, so let’s improve this situation.
Read more »