4.9.2. Configure JBoss EAP 6 as a Service in Red Hat Enterprise Linux (Zip, Installer)
- Install JBoss EAP 6 using the Zip installation, Graphical Installer, or Text-based Installer:
- Administrator privileges on the server are required.
Use the following procedure to install JBoss EAP 6 as a service on Red Hat Enterprise Linux when the installation has been done with either the zip, text, or graphical methods. This process does not apply when the installation has been done using the RHN (RPM) method.
Procedure 4.17. Set Up the Service
Locate the start-up script and configuration fileThe start-up script and an associated configuration file are located in the
EAP_HOME/bin/init.d/directory. Open the configuration file
jboss-as.confto edit it.
Customize the start-up options in the
jboss-as.conffileThere are several options within the
jboss-as.conffile. At the minimum, specify the correct values for
JBOSS_USERvariables. If these variables are absent, add them.
Copy files into system directories
- Copy the modified configuration file to the
sudo mkdir /etc/jboss-as
sudo cp jboss-as.conf /etc/jboss-as/
- Copy the start-up script to the
sudo cp jboss-as-standalone.sh /etc/init.d
Add the start-up script as a service.Add the new
jboss-as-standalone.shservice to list of automatically started services, using the
chkconfigservice management command.
sudo chkconfig --add jboss-as-standalone.sh
Start the service.Test that the service has been installed correctly by using one of the following commands for Red Hat Enterprise Linux.
If everything has gone correctly, you should get a green [OK]. If you get an error, check the error logs and make sure your paths are correct in the configuration file.
- For Red Hat Enterprise Linux 5 and 6:
sudo service jboss-as-standalone.sh start
- For Red Hat Enterprise Linux 7:
sudo service jboss-as-standalone start
NoteThe green [OK] does not appear for Red Hat Enterprise Linux 7.
Make the service start automatically when you restart your server.To add the service to the list of services which start automatically when your server restarts, issue the following command.
sudo chkconfig jboss-as-standalone.sh on
JBoss EAP 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.
Procedure 4.18. Uninstall the JBoss EAP 6 service from Red Hat Enterprise Linux
- If the service is running, first open a terminal and stop the service by executing the
stopcommand with the name of the service:
sudo service jboss-as-standalone.sh stop
- Remove JBoss EAP from the list of services:
sudo chkconfig --del jboss-as-standalone.sh
- Remove the system directory files.
- Remove the service start-up script:
sudo rm /etc/init.d/jboss-as-standalone.sh
- Remove the service configuration file:
sudo rm /etc/jboss-as/jboss-as.conf
/etc/jboss-asis not a standard system directory. Only if there are no other files being used there, also remove the directory itself:
sudo rm -rf /etc/jboss-as/
JBoss EAP 6 service is uninstalled from the server.