2.7.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 2.2. Task

  1. Copy the start-up script to the /etc/init.d/ directory

    The start-up script and an associated configuration file are located in the EAP_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
  2. Add the start-up script as a service.

    Add the new jboss-as-standalone.sh service to list of automatically started services, using the chkconfig service management command.
    [user@host init.d]$ sudo chkconfig --add jboss-as-standalone.sh
  3. Edit the script options.

    If desired, edit the jboss-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 the JBOSS_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.
  4. 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 extracted
    • JBOSS_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 as domain.xml or standalone.xml
    • JBOSS_SCRIPT - the script used to start JBoss Enterprise Application Platform 6, such as domain.sh or standalone.sh
  5. 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.