> Company- and IT-organisation

> IT-equipment and installation

> Service-applications for the Server

JBoss Application-Server

For this document and all references (links) please obey the hints and regulations concerning copyright, disclaimer and trademarks.

This document describes the the installation of the JBoss Java-Application-Server.

The JBoss-Application-Server is a special service, that controls and administers Enterprise-Java-Beans (EJBs).
EJBs contain program-code for application-programs.
These EJBs can be called from client-programs running on workstations and provide business-functionality to users.

Prerequisites:

Preparation:

I assume, that JBoss will be accessing other databases (mySQL, IBM-DB2, Oracle, etc.) than the included HypersoniqSQL-database.
For security-reasons this databases should not run under the user 'root'.

To have a user exclusively for JBoss and the accessed database-system, a special user ('jboss') and a group is created now.
groupadd jboss
useradd -g jboss -G office jboss

For security reasons it is highly advisable not to give a password to the user 'jboss'.
This increases the protection against spying or malversation from remote computers.

Installation-instructions:

The most current version (3.2.5 at the time of the last revision of this document, Juli 2004) can be downloaded as zipped file from the following internet-site:
http://www.jboss.org/downloads.jsp

Download the zipped file to a directory of your choice (furtheron referred as download_directory).

For the further installation, I describe several scenarios. According to your selection of a scenario, please proceed to the according installation-instructions.

Scenario

Suitable for / advantages / disadvantages

Development Environment on local machine

This scenario is for base, stand-alone-development of J2EE-components. The developed components are tested on the machine where they are developed.
Advantage of this scenario is, that only one PC is needed, deployment is easy and fast, 'printouts' of jBoss can be watched in a Terminal-window and changes of modules to not interfere with the development or test of other developers.
Disadvantage is, that security is on a very low level and it is not advised, to use and leave confident data in the database on the machine.

Development Environment on a separate machine

This scenario is for base, stand-alone-development of J2EE-components with capabilities to share test-data among a group. The developed components are tested on a separate machine.
Advantage of this scenario is, that the 'printouts' can be viewed on a separate monitor and switching of terminals can be avoided. With the database on a separate machine it is also possible to share data among a group of developers.
Disadvantage is, that security is on a very low level and it is not advised, to use and leave confident data in the database on the separate machine.

Test- or Production-Environment for a small company. Easy access to jboss-deployment for every user.


Production-environment with controlled access to jboss-deployment. Only authorized users have a permit to deploy new modules for jBoss.



Installation-instructions – Development Environment on local machine:

After the download is complete, change to the directory where the unzipped files of jboss will be stored (in our example /opt)
and unzip:
cd /opt
unzip /download_directory/jboss-3.2.5.zip

The unzipping procedure makes a sub-directory named jboss-3.2.5.
To easy typing of commands later on, the directory will be linked to a directory with a shorter name:
ln -s /opt/jboss-3.2.5 /opt/jboss

The access-rights are defined very liberal. This allows any user to start or stop the jBoss application-server without further authorization.
chown -R jboss /opt/jboss
chgrp -R jboss /opt/jboss
chmod -R 777 /opt/jboss

The environment-variables for jBoss are set in the file /etc/profile by appending the following lines:
# JAVA_HOME-Environment for the jBoss ejb-Application-Server

# (assuming that the SUN Java-SDK is used)

export JAVA_HOME=/usr/java/j2sdk1.4.2_04
# JBOSS_HOME-Environment for the jBoss ejb-Application-Server

export JBOSS_HOME=/opt/jboss

If another Java-environment is installed and should be used, please export the according directory.

Starting jBoss as Development Environment on local machine:

It is assumed, that the Development machine has a Graphical User Interface (GUI) installed (as there should also run some development GUI like Eclipse).

To start jBoss, do the following:
* Open a Terminal-window.
* Start jBoss by entering the command:
/opt/jboss/bin/run.sh

jBoss is started when the it does not print any more lines in the Terminal-window and the message ring
Started in 3m:24s:884ms
appears in one of the last lines.

If jBoss was started succesfully can be verified as described unter Test jBoss via a web-browser.

Installation-instructions – Development Environment on a separate machine









Test jBoss via a web-browser:

Prerequisite to test jBoss over a web-browser is, that jBoss-application-server was successfully started on the PC acting as a server.

To test the availability of jBoss, a web-browser on any computer is opened. Then the following string is entered in the web-browser:
http://192.168.0.1:8080

(Where 192.168.0.1
is the TCP/IP-address of the Server hosting JBoss.)

If jBoss is operational, the jBoss Online Resources and Jboss Management console is displayed.







Then change to the directory where the unzipped files are to be stored (in our example /SMB_Disk/progs_honest)
and unzip:
cd /SMB_Disk/progs_honest
unzip /download_directory/jboss-3.2.5.zip

The unzipping procedure makes a directory named jboss-3.2.5.
To easy typing of commands lateron, the directory will be renamed to a shorter name:
mv /SMB_Disk/progs_honest/jboss-3.2.5 /SMB_Disk/progs_honest/jboss

To specify, which Java-environment is used to run JBoss, the file /etc/profile must be appended with the following lines:
# JAVA_HOME for Jboss-App-Server
# (IBM Java-SDK Ver. 1.4.1 in this example)
export JAVA_HOME=/opt/IBMJava2-141

If another Java-environment is installed and should be used, please export the according directory.









Berechtigungen der Unterverzeichnisse für eine Produktion-Umgebung:

Damit andere User als 'root' Dateien für den Applikation-Server 'abliefern' können, wird ein eigenes Unterverzeichnis eingerichtet, daß die Funktion eines 'Postfaches' hat.
mkdir /SMB_Disk/progs_brav/jboss3/todeploy

In dem gerade angelegte 'Postfach'-Unterverzeichnis (/opt/jboss3/todeploy) wird eine Script-Datei mit dem Namen todeploy.sh angelegt.
Die Script-Kommandos sind hier zu finden
. Beachten Sie den Fallstrick !

Damit die Programm-Dateien gegen böswillige oder unabsichtliche Veränderung geschützt sind, wird Eigentümer, Guppe und Berechtigung (nur Lesen und Ausführen) gewechselt.
chown -R jboss /SMB_Disk/progs_brav/jboss3
chgrp -R jboss /SMB_Disk/progs_brav/jboss3
chmod -R 500 /SMB_Disk/progs_brav/jboss3

Damit andere Anwender EJB-Dateien, die 'deployed' werden sollen, in das 'Postfach'-Unterverzeichnis (/opt/jboss3/todeploy) kopiert werden können wird dieses zum Lesen und Schreiben für alle User freigegeben.
chmod 755 /SMB_Disk/progs_brav/jboss3
chmod -R 777 /SMB_Disk/progs_brav/jboss3/todeploy

Damit die Script-Datei nur vom User 'root' ausgeführt werden kann, wird die Berechtigung der Script-Datei eingeschränkt.
chmod 700 /SMB_Disk/progs_brav/jboss3/server/default/deploy

Damit der User 'root' Dateien mit EJBs im Jboss-Deploy-Unterverzeichnis vrwalten kann, wird dieses zum Lesen, Schreiben und Ausführen für den User 'root' freigegeben.
chmod 700 /SMB_Disk/progs_brav/jboss3/todeploy/todeploy.sh

Wenn auf Workstations Programme, die als Client auf EJBs zugreifen, ausgeführt werden sollen, dann ist es sinnvoll, die jars (Java-ARchives), die in den classpath aufgenommen werden müssen, auf dem Server freizugeben. Damit wird bei einer Änderung der Version von JBoss immer die aktuelle Version der jars in den classpath aufgenommen.
chmod -R 555 /SMB_Disk/progs_brav/jboss3/client
chmod -R 555 /SMB_Disk/progs_brav/jboss3/lib
chmod -R 555 /SMB_Disk/progs_brav/jboss3/server
chmod -R 555 /SMB_Disk/progs_brav/jboss3/server/default
chmod -R 555 /SMB_Disk/progs_brav/jboss3/server/default/lib

Manuelles Starten von JBoss:

Um JBoss manuell zu starten wird in das entsprechende Verzeichnis gewechselt und das Start-Script aufgerufen.
cd /SMB_Disk/progs_brav/jboss3/bin
./run.sh

Wenn JBoss gestartet ist, erscheint als letzte Zeile die Meldung.
Started in 1m:24s:884ms

Anschließend kann wie unter Testen beschrieben, geprüft werden ob die JBoss-Management-Konsole von einem Webbowser aus aufgerufen werden kann.

Automatisches Starten von JBoss:

Hinweis:
Wenn Sie Ausgaben beobachten wollen, die in EJBs codiert wurden (z.B. während der Entwicklung), eignet sich dieser Modus nicht weil die Meldungen nicht einfach gesehen werden können.
In diesem Fall empfehle ich, ein Terminal unter der graphischen Benutzeroberfläche zu öffen und JBoss wie unter Manuelles Starten von JBoss beschrieben zu starten.
Im Terminal können dann die Meldungen gesehen werden.

Damit JBoss beim Starten bzw. Beenden von RedHat**-Linux** automatisch gestartet werden kann, wird im Unterverzeichnis (/opt/jboss3/bin) eine Script-Datei mit dem Namen jboss_init_redhat.sh angelegt.
Die Script-Kommandos sind hier zu finden
.

Weil in einem früheren Schritt das Unterverzeichnis für das Schreiben gesperrt wurden, muß dieses wieder geöffnet werden.
c
hmod -R 700 /opt/jboss3/bin

Dann wird das Diskettenlaufwerk gemounted und die Datei kopiert.
mount dev/fd0 /mnt/floppy
cp /mnt/floppy/jboss_init_redhat.sh /SMB_Disk/progs_brav/jboss/bin/jboss_init_redhat.sh
umount dev/fd0

Beachten Sie den Fallstrick !

Dann wird das Unterverzeichnis für das Schreiben wieder gesperrt.
c
hmod -R 500 /SMB_Disk/progs_brav/jboss3/bin

Dieses Script wird in den entsprechenden Runlevels (/etc/rc3.d für Start und /etc/rc5.d für Stop) verlinkt.
cd /etc/rc3.d
ln -s /SMB_Disk/progs_brav/jboss3/bin/jboss_init_redhat.sh S01JBoss

cd /etc/rc5.d
ln -s /SMB_Disk/progs_brav/jboss3/bin/jboss_init_redhat.sh K23JBoss

Anschließend kann wie unter Testen beschrieben, geprüft werden ob die JBoss-Management-Konsole von einem Webbowser aus aufgerufen werden kann.

Additional hints:

Die Installation kann nur als 'root' ausgeführt werden.

Java-Client-Programme, die auf einer Workstation laufen und durch JBoss EJBs aufrufen, brauchen jar-Dateien aus der Jboss-Installation.
Weil Dateien in Verzeichnisse, die über einen symbolischen Link verbunden sind, unter NFS oder SaMBa nicht im Netzwerk sichtbar sind, ist es sinnvoll, JBoss gleich in einem Verzeichnis zu installieren, das für die Workstations zugänglich ist.



Zum Anfang des Dokuments.