6.2. Install JBoss Enterprise Application Platform as a Service in Red Hat Enterprise Linux
Summary
Use the following procedure to install JBoss Enterprise Application Platform 6 as a service on Red Hat Enterprise Linux.
Prerequisites
You need administrator access to complete this task.
Procedure 6.1. Task
Copy the start-up script to the
/etc/init.d/
directoryThe start-up script and an associated configuration file are located in theEAP_HOME/bin/init.d/
directory. Copy each of these files to the/etc/init.d/
directory.[user@host init.d]$
sudo cp jboss-as-standalone.sh jboss-as.conf /etc/init.d
Add the start-up script as a service.
Add the newjboss-as-standalone.sh
service to list of automatically started services, using thechkconfig
service management command.[user@host init.d]$
sudo chkconfig --add jboss-as-standalone.sh
Edit the script options.
If desired, edit thejboss-as.conf
file to customize start-up options for JBoss Enterprise Application Platform and the JVM. Use the comments in the file as guidance. It is recommended to set theJBOSS_HOME
variable in this file, to point to the directory where you extracted JBoss Enterprise Application Platform 6. Do not add a trailing slash (/) at the end of the directory name.Edit the script itself.
You may need to edit the start-up script itself. It makes certain assumptions about the name of your start-up file and the location of your JBoss Enterprise Application Platform instance. Customize the script, paying special attention to the following variables, which you will need to customize to start JBoss Enterprise Application Platform 6 as a managed domain.JBOSS_HOME
- the location where JBoss Enterprise Application Platform 6 is extractedJBOSS_USER
- the user with the ability to run JBoss Enterprise Application Platform. This should be a non-privileged user, as no superuser privileges as required.JBOSS_CONFIG
- the name of the configuration file used to start JBoss Enterprise Application Platform 6, such asdomain.xml
orstandalone.xml
JBOSS_SCRIPT
- the script used to start JBoss Enterprise Application Platform 6, such asdomain.sh
orstandalone.sh
Start the service.
If desired, start the new service using the standard syntax for starting Red Hat Enterprise Linux services.[user@host bin]$
sudo service jboss-as-standalone.sh start
Result
JBoss Enterprise Application Platform 6 starts automatically when the Red Hat Enterprise Linux reaches its default run-level, and stops automatically when the operating system goes through its shutdown routine.