demetrio812

03 October 2007

Install JBoss AS 4.2.1.GA on Debian

Hi,
I just got a new server and I installed Debian Linux. I wanted to install JBoss AS 4.2.1.GA and it's really simple: just download the file, unzip, copy in /usr/local, make jboss user, and chown the jboss directory and it's subdirectories (you can find a good explanation here).

After that I wanted to use the jboss_init_redhat.sh script to automatically starts the server as service, so I just had to modify a little bit the file:
  1. I wanted to bind the server to an ip address so before the JBOSS_BIND_ADDR I added the following line (XX.XX.XX.XX is the server address):
    JBOSS_HOST=${JBOSS_HOST:-"XX.XX.XX.XX"}

  2. Coz of an error running the script I had to modify the SUBIT variable adding the --preserve-environment option, so the line now look like that:
    SUBIT="su - $JBOSS_USER --preserve-environment -c "

  3. Because of a bug of JBoss I had to modify the stop script adding the bind address and the port of JNP server, so the JBOSS_CMD_STOP now look like this:
    JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown -s $JBOSS_HOST:1099"}

After that, to install the script as a service do that:
  1. Copy the jboss_init_redhat.sh script to /etc/init.d/ directory;
  2. Esecute the following command:
    update-rc.d jboss_init_redhat.sh defaults
The output of the last command is:

Adding system startup for /etc/init.d/jboss_init_redhat.sh ...
/etc/rc0.d/K20jboss_init_redhat.sh -> ../init.d/jboss_init_redhat.sh
/etc/rc1.d/K20jboss_init_redhat.sh -> ../init.d/jboss_init_redhat.sh
/etc/rc6.d/K20jboss_init_redhat.sh -> ../init.d/jboss_init_redhat.sh
/etc/rc2.d/S20jboss_init_redhat.sh -> ../init.d/jboss_init_redhat.sh
/etc/rc3.d/S20jboss_init_redhat.sh -> ../init.d/jboss_init_redhat.sh
/etc/rc4.d/S20jboss_init_redhat.sh -> ../init.d/jboss_init_redhat.sh
/etc/rc5.d/S20jboss_init_redhat.sh -> ../init.d/jboss_init_redhat.sh


It means that the command added the script as startup script for all the defaults runlevels.

You can find more informations about System V Init (Unix systems init) functionalities here and here.

Demetrio

Labels:

1 Comments:

  • Thank you, well for start.
    But maybe someone is interested in more elaborated tutorial.
    http://alexander.holbreich.org/2010/01/java-jboss-debian-linux/

    By Blogger shuron, At January 27, 2010 at 1:52 AM  

Post a Comment

Subscribe to Post Comments [Atom]



<< Home