Red Hat Application Stack is a set of software components that have been tested and certified to work together in an integrated fashion. Red Hat Application Stack is designed for dynamic web applications for both the LAMP and Java (TM) platforms.
Red Hat Application Stack V.2.0 has been tested and certified on Red Hat Enterprise Linux 5 systems. It is not certified for use with earlier versions of Red Hat Enterprise Linux. Please follow the separate instructions for installing Red Hat Enterprise Linux 5 before installing Red Hat Application Stack V.2.0.
Red Hat Application Stack V.2.0 is available for 32- and 64-bit Intel architectures only (i386 and x86_64).
Red Hat Application Stack V.2.0 includes JBoss Enterprise Application Platform 4.2, for running web applications in a standard middleware environment. Note that the JBoss Enterprise Application Platform uses an embedded Tomcat and does not require a stand-alone Tomcat. Before installing and running the JBoss Application Server (the application server component of JBoss Enterprise Application Platform 4.2), you will require a working installation of Java 1.5. Currently Red Hat Application Stack is certified with the Sun JVM 1.5.0 update 12 or later, and the latest BEA JVM available through RHN. Please refer to Chapter 2, Configuring the Java Environment for instructions on configuring the Java environment for JBoss Application Server.
If you intend to use the production config (started by default), you will need atleast 1.5GB of physical memory.
In most cases, Red Hat Application Stack contains more recent versions of packages than those that are included in Red Hat Enterprise Linux. Installing Red Hat Application Stack may update/overwrite these packages. Please ensure you review the complete package list before beginning the installation process.
JBoss Application Server relies on an installed JVM, such as those by Sun, or BEA. Both JVMs are available from the Red Hat Enterprise Linux 5 Supplementary channels.
Currently Red Hat Application Stack is certified with the Sun JVM version 1.5.0 update 12 or later and the latest BEA JVM available through RHN. This may change in future releases.
With Red Hat Enterprise Linux 5 there are 1.5 versions of the BEA (JRockit), IBM and SUN SDKs.
We have adopted the jpackage.org style for the packaging of our Java offerings. This requires that the jpackage-utils rpm be installed on your system. A JPackage-style JVM must be installed via yum (see channel details below) and jpackage-utils will be automatically brought in as a dependency.
Install a Java SDK from RHN
Java SDKs are provided by the Red Hat Enterprise Linux 5 Supplementary channel for your Linux variant and architecture. Depending on the architecture, the channel names are:
rhel-i386-server-supplementary-5 and rhel-x86_64-server-supplementary-5
The java-1.5.0-bea, java-1.5.0-ibm and java-1.5.0-sun SDKs are available from these channels. Make sure you also install the -devel subpackages.
Selecting alternatives for java, javac and java_sdk_1.5.0 (setting java_sdk_1.5.0 is optional).
This is only needed if you want to use the SysV service script and/or want this installed SDK to be the default java and javac in the system. This choice can often be overridden by setting the JAVA_HOME environment variable.
The alternatives system allows different versions of Java, from different sources to co-exist on your system. You should make sure the desired one is selected so that the service script uses the one you want.
As root, issue the following command:
/usr/sbin/alternatives --config java
and make sure the desired one is selected (marked with a '+'), or select it by entering its number as prompted.
Make sure you do the same for javac and java_sdk_1.5.0. We recommend that all point to the same manufacturer and version.
Update your RHEL5 installation and install the JVM as described above.
Subscribe to the Red Hat Application Stack child channel:
e.g: rhel-x86_64-5-appstk-2 or rhel-i386-5-appstk-2
Install JBoss Application Server:
For the Application Server (which includes an embedded Tomcat), run:
yum install jbossas
Refer also to Chapter 4, Using JBoss Application Server below.
To install using yum / DVD:
Update your installation and install the JVM as described above.
Mount the Red Hat Application Stack V.2.0 DVD.
Create a new file in /etc/yum.repos.d/ with the following contents to update directly from the RPMs on the disk:
[stacksv2] name=Red Hat App Stack baseurl=file:///path/to/mounted/DVD/Stacks/ enabled=1
Install JBoss Application Server:
For the Application Server (which includes an embedded Tomcat), run:
yum install jbossas
After the installation is complete, remove the file you added in /etc/yum.repos.d/ in Step 3 (or set enabled=0 in that file). Failure to do this will result in yum exiting with an error whenever it is run again without mounting the Red Hat Application Stack V.2.0 DVD.
Refer also to Chapter 4, Using JBoss Application Server below.
To install Red Hat Application Stack V.2.0:
If you have an existing database, back up your data and shut down the database:
If you are using PostgreSQL:
Back-up your database. For example, run:
su - rm -rf /tmp/pg.backup su - postgres /usr/bin/pg_dumpall > /tmp/pg.backup exit
If you are using MySQL:
Backing-up your database is optional but recommended. Run as root:
mysqldump --all-databases -p > /tmp/mysqldumpfile.sql
Stop the daemons:
/sbin/service httpd stop
To shut down MySQL:
/sbin/service mysqld stop
To shut down PostgreSQL:
/sbin/service postgresql stop
Install the software:
Option 1. To install from RHN, which is the preferable option to avoid dependency issues:
Subscribe to the Red Hat Application Stack child channel:
e.g: rhel-x86_64-5-appstk-2 or rhel-i386-5-appstk-2
Run as root: yum update
Run as root: yum groupinstall stacks
Option 2. To install from RPMs on Disk:
Follow the instructions in Section 2.2.2, “ Using yum / DVD ” to mount the DVD and set up the local RHN channel (steps 1-3). Then as root run:
yum update
Followed by:
yum groupinstall stacks
After the installation is complete, remove the file you added in /etc/yum.repos.d/ (or set enabled=0 in that file). Failure to do this will result in yum exiting with an error whenever it is run again without mounting the Red Hat Application Stack V.2.0 DVD.
You may need to install the following packages to satisfy dependencies before executing the above command, if they are not already installed:
apr-devel
apr-util-devel
libc-client
mx
pcre-devel
You can also install specific components of the stack via the yum groupinstall directive specified in Section 3. In addition to "stacks", the following groups are defined:
j2ee - Installs jbossas, jboss-seam, mod_jk and database jdbc drivers |
lamp - Installs httpd, mysql, php and all components related to mysql |
lapp - Installs httpd, postgresql, php and all components related to postgresql |
docs - Installs documentation for various components |
When using the groupinstall directive, you can specify multiple groups at the same time (even if they share packages).
Analogous to groupinstall, you can use the "groupremove" directive to remove all the packages in a group. The groupremove directive will only remove packages in the group; not the dependencies that the package install may have brought in.
Restore your database:
For PostgreSQL:
Move (or remove) the database directory:
mv /var/lib/pgsql/data /var/lib/pgsql/data.backup
Initialize the database:
/sbin/service postgresql initdb
Start the new PostgreSQL service:
/sbin/service postgresql start
Restore your data from back-up
psql -U username < /tmp/pg.backup
Start the http daemon:
/sbin/service httpd start
For MySQL:
Start MySQL:
/sbin/service mysqld start
Update MySQL:
mysql_upgrade
Restore your data:
mysql -p < /tmp/mysqldumpfile.sql
Start the remaining daemons:
Start the http daemon:
/sbin/service httpd start
The installation is now complete.
JBoss Application Server can be started, stopped, and configured to start automatically at boot time either from the command line or using a graphical tool.
You can start and stop the jbossas service using the service command as root on a console window (as is typical of a network service):
service jbossas start ... service jbossas stop
The behavior at boot can be controlled with the chkconfig command, as any other Linux service (see chkconfig man page).
Alternatively, you can issue the command system-config-services to activate the graphical Red Hat Service Configuration Tool, which can also be activated from the main menu. Select:
System Settings > Server Settings > Services
For security purposes, beginning with Red Hat Application Stack V.1.1, authentication for the jmx-console, web-console, jmx-invoker and http-invoker is turned on. Additionally, no user accounts are active by default, so as to prevent default user / password based attacks.
Accounts for the jmx-console and the invokers can be set up by modifying:
$JBOSS_HOME/server/$CONFIG/conf/props/jmx-console-users.properties
Accounts for the web-console users can be set up by modifying:
$JBOSS_HOME/server/$CONFIG/deploy/management/console-mgr.sar /web-console.war/WEB-INF/classes/web-console-users.properties
Please note that the file name above has been split onto two lines for readability. It should be understood and entered as one continuous line.
Where $JBOSS_HOME is the install directory (/var/lib/jbossas) and $CONFIG is the server configuration you are using.
Please see http://kbase.redhat.com/faq/FAQ_107_9963.shtm for more information
JBoss Application Server is configured with its internal servlet engine to listen for HTTP traffic on port 8080. Once the jbossas service has been started, you can verify that it is running by pointing your web browser to:
http://localhost:8080/web-console
You can use the Web Console to administer JBoss Application Server.
The entire JBoss Application Server suite runs under a new jboss system user. It may be necessary to use the 'su -s /bin/bash jboss' system command to deposit .ear / .war / .jar files under the JBoss Application Server deployment directory, due to file system permissions. Alternatively, a developer can be listed in the jboss user group by the system administrator. The best approach is to use the Web Console (URL above) to deploy the application.
Depositing files for which the user jboss has no read access in the deployment directory will cause the server to fail to deploy.
To create additional JBoss Application Server configurations besides the provided 'default', 'minimal', 'all' and 'production', you must create a new directory for your configuration as follows (note the switches given to the cp command):
export 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 setting the JBOSSCONF variable in the file:
/etc/sysconfig/jbossas
Optionally, you can just set the JBOSSCONF variable in /etc/sysconfig/jbossas to a non-existent subdirectory (existing parent with write access by the jboss user) or an empty directory (with write access by jboss) and the init script will create a new configuration directory tree for you based on the current "production" configuration when the service is first started. You can then stop the service, adjust the configuration as desired, and start it again.
Please note that automated updating of configurations created using method above is not supported. If you create custom configurations, you will manually have to port files / changes from a new update to that configuration.
For development, you can activate the JBoss Application Server with the familiar run.sh command as usual. The jbossas RPM installs the JBOSS_HOME in
/var/lib/jbossas
So, you can cd to /var/lib/jbossas/bin and use run.sh from there.
If you wish to use a different JVM than the one that alternatives points to, you will need to set JAVA_HOME first.
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.
The entire JBoss Application Server 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 Creating copies of JBOSS_HOME below).
To create additional JBoss Application Server 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.
The analog of unzipping another copy of JBoss Application Server 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 Application Server documentation. Refer to Running multiple instances of JBoss Application Server for more information.
Please note that automated updating of copies created using methods above is not supported. If you create custom copies, you will manually have to port files / changes from a new update to that copy.
Most of the commands found in $JBOSS_HOME/bin have equivalents in /usr/bin with names like jbossas-, where commandcommand is the original JBoss Application Server command name. So, for instance, there is a jbossas-run command that is available from any directory.
To use these commands, however, you must set two environment variables:
export JBOSS_HOME=/var/lib/jbossas export JAVA_HOME=/usr/lib/jvm/java
where the value you give for JAVA_HOME is the location of your installed Java VM.
Please note that automated updating of instances created using methods below is not supported. If you create custom instances, you will manually have to port files / changes from a new update to that instance.
The description here is restricted to running multiple instances of the JBoss Application Server Linux service. Running multiple instances with run.sh is already described elsewhere in the JBoss Application Server documentation.
You can administer multiple SysV services that run JBoss Application Server by creating additional service scripts. The process basically consists of:
creating a link with the new service name to the original jbossas init script in /etc/init.d
copying the jbossas file in /etc/sysconfig to one with the new service name (the init script and the configuration file names must match)
making the desired configuration changes making sure:
port conflicts are avoided
a different log file is specified
The original init script log files are created under /var/log/jbossas in directories that correspond to the configuration used (like 'default') with the usual server.log name. For instance:
/var/log/jbossas/default/server.log
In general, each log file is created by the SysV script as
/var/log/
service-name/$JBOSSCONF/server.log
so no file conflicts shall exist.
For more flexibility in the configuration of the different servers, you may want to create full copies of JBOSS_HOME. This is described in Creating copies of JBOSS_HOME above -- make sure you use the cp command's p switch to preserve the jboss user and group ownership. Then, in /etc/sysconfig/, uncomment and update the value of the service-nameJBOSS_HOME variable.
Optionally, you can just uncomment and change the value of JBOSS_HOME as described above so as to specify an empty or non-existent directory and the script will automatically create a copy of the RPM-installed /var/lib/jbossas (original JBOSS_HOME) for you when the service is first started. The current "minimal", "production", "default" and "all" configurations will be copied. Make sure the parent directory, in case of a new directory, or the directory itself, if already existent, have write permissions for the user jboss.
Starting the server this first time may take a little longer due to the file copying.
There are 2 ways to run additional instances of JBoss Application Server and avoid port conflicts:
By using different sets of ports
By binding to different local IP addresses
Using different sets of ports
The BindingManager in JBoss Application Server can be used to dynamically override service configurations (e.g. port numbers). Jbossas has some pre-configured overrides, namely ports-01, ports-02 and ports-03. The configuration file can be found at /var/lib/jbossas/docs/examples/binding-manager/sample-bindings.xml. These sets of overrides can be used when multiple instances of JBoss Application Server must be started. Please follow these steps when multiple instance of JBoss Application Server need to be started:
Create a new file /etc/init.d/ which is a symlink to service-name/etc/init.d/jbossas, e.g:
ln -s /etc/init.d/jbossas /etc/init.d/jbossas-ports-01
Create a new config file for service-name, /etc/sysconfig/. The contents of this file should be similar to service-name/etc/sysconfig/jbossas, except with instance specific values uncommented and updated, e.g:
cp /etc/sysconfig/jbossas /etc/sysconfig/jbossas-ports-01. Uncomment and update JBOSSCONF to ports-01 in /etc/sysconfig/jbossas-ports-01.
Then add service-name for management by chkconfig, e.g:
chkconfig --add jbossas-ports-01
To start/stop the service, simply: service , e.g:
service-name start/stop
service jbossas-ports-01 start
Each JBoss Application Server instance is bound to a particular IP address.
Create a new file /etc/init.d/ which is a symlink to service-name/etc/init.d/jbossas, e.g:
ln -s /etc/init.d/jbossas /etc/init.d/jbossas-instance2
Create a new config file for service-name, /etc/sysconfig/ with instance specific values uncommented and updated , e.g:
service-name
cp /etc/sysconfig/jbossas /etc/sysconfig/jbossas-instance2. Uncomment and update JBOSSCONF to instance2. Create a new variable JBOSS_IP and set it to another IP address in /etc/sysconfig/jbossas-instance2
Then add service-name for management by chkconfig, e.g:
chkconfig --add jbossas-instance2
To start/stop the service, simply: service start/stop, e.g:
service-name
service jbossas-instance2 start
As required by U.S. law, you represent and warrant that you:
Understand that certain parts of the software are subject to export controls under the U.S. Commerce Departments Export Administration Regulations (EAR)
Are not located in a prohibited destination country under the EAR or U.S. sanctions regulations (currently Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria)
Will not export, re-export, or transfer the software to any prohibited destination, entity, or individual without the necessary export license(s) or authorizations(s) from the U.S. Government
Will not use or transfer the software for use in any sensitive nuclear, chemical or biological weapons, or missile technology end-uses unless authorized by the U.S. Government by regulation or specific license
Understand and agree that if you are in the United States and export or transfer the Software to eligible end users, you will, as required by EAR Section 740.17(e), submit semi-annual reports to the Commerce Department's Bureau of Industry & Security (BIS) that include the name and address (including country) of each transferee
Understand that countries other than the United States may restrict the import, use, or export of encryption products and that it shall be solely responsible for compliance with any such import, use, or export restrictions.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries.