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.
Operating-system installed ;-).
Logged on as user 'root'.
TCP/IP-address
and symbolic names defined; see the corresponding step in
Installation
of the Server with Linux** (RedHat** 7.1) or
Installation
of the Server with Linux** (RedHat**9)
If
this prerequite is not fulfilled, then JBoss can be installed but
EJB-methods can not be called from computers with other
TCP/IP-addresses.
Java-Runtime-Environment
installed.
JBoss-Applications-Server needs a SDK; JRE is not sufficient.
This
documents refers to a directory-structure as described in 'Linux
- file-structure and users' .
To
avoid unneccessary complication of the installation it is
recommended to use the same directories as describe in this
document.
See also Additional
hints.
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 |
---|---|
|
|
|
|
|
|
|
|
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 /
chmod -R 777 /opt
/jboss
chgrp -R jboss /
opt
/jboss
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, d
o
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
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 /
chmod -R
500 /SMB_Disk/progs_brav
/jboss3
chgrp -R jboss /
SMB_Disk/progs_brav
/jboss3
SMB_Disk/progs_brav
/jboss3
Damit
andere Anwender EJB-Dateien, die 'deployed' werden sollen, in das
'Postfach'-Unterverzeichnis
(
kopiert werden können wird dieses zum Lesen und Schreiben für
alle User freigegeben./opt/jboss3/todeploy
)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 /chmod
-R 555 /
SMB_Disk/progs_brav
/jboss3/libchmod
-R 555 /
SMB_Disk/progs_brav
/jboss3/serverSMB_Disk/progs_brav
/jboss3/server/default
chmod
-R 555 /SMB_Disk/progs_brav
/jboss3/server/default/lib
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.
chmod
-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
Dann
wird das Unterverzeichnis für das Schreiben wieder
gesperrt.
chmod
-R 500 /
SMB_Disk/progs_brav
/jboss3/bin
cd
/etc/rc3.d Dieses
Script wird in den entsprechenden Runlevels (/etc/rc3.d für
Start und /etc/rc5.d für Stop) verlinkt.
ln -s
/
jboss_init_redhat.sh
S01JBossSMB_Disk/progs_brav
/jboss3/bin/
cd
/etc/rc5.d
ln -s
/
jboss_init_redhat.sh
K23JBossSMB_Disk/progs_brav
/jboss3/bin/
Anschließend
kann wie unter Testen
beschrieben, geprüft werden ob die JBoss-Management-Konsole von
einem Webbowser aus aufgerufen werden kann.
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.