03 October 2007

Install JBoss AS 4.2.1.GA on Debian

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 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):

  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 script to /etc/init.d/ directory;
  2. Esecute the following command:
    update-rc.d defaults
The output of the last command is:

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

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.




  • Thank you, well for start.
    But maybe someone is interested in more elaborated tutorial.

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

Post a Comment

Subscribe to Post Comments [Atom]

<< Home