Creating copies of
JBOSS_HOME
13
Tip
JAVA_HOME
can be set system-wide in
/etc/profile
. But beware, some users may
not want to have
JAVA_HOME
set to this same SDK. Also, some may prefer to use the
alternatives
-selected one instead. These users may be affected by this global
setting of
JAVA_HOME
.
If you still need to set
JAVA_HOME
for some other reason, the
alternatives
-selected
SDK is in
/usr/lib/jvm/java
, so a export
JAVA_HOME=/usr/lib/jvm/java
will
do.
IMPORTANT
The entire JBoss AS suite runs under a new
jboss
system user. It may be necessary
to use the
su -s /bin/bash jboss
system command to run the server, change
configuration, deploy etc., due to file system permissions. Alternatively, a developer can
be listed in the
jboss
user group by the system administrator.
Yet another possibility is to create a personal copy of JBOSS_HOME (see
Section 4.3,
“ Creating copies of
JBOSS_HOME
”
below).
To create additional JBoss AS configurations besides the provided 'default', 'production', 'minimal' and
'all', you must create a new directory for your configuration as follows (note the switches given to the
cp
command):
JBOSS_BASE=/var/lib/jbossas
cd $JBOSS_HOME
cp -pL -R server/default server/myownconfig
You can then change the configuration and request it to be used by specifying it in the
-c
flag to
run.sh
, as usual.
4.3. Creating copies of
JBOSS_HOME
The analog of unzipping another copy of JBoss AS in a different directory is to make a copy of the
RPM-installed
JBOSS_HOME
, located at
/var/lib/jbossas
.
You probably want this copy to have your own userid and group, so use:
cp -L -R /var/lib/jbossas
my_new_jboss_home_directory
If you want to retain the
jboss
user and group ownership, use instead:
cp -pL -R /var/lib/jbossas
my_new_jboss_home_directory
To run multiple servers simultaneously you will need to adjust the configuration to avoid port conflicts,
as described in the JBoss AS documentation. Refer to
Section 4.5, “ Running multiple instances of
JBoss AS ”
for more information.