BIGtheme.net http://bigtheme.net/ecommerce/opencart OpenCart Templates
Home / Oracle / Apex / How to Run GlassFish V4.1 as a Service on Linux Ubuntu/Debian

How to Run GlassFish V4.1 as a Service on Linux Ubuntu/Debian

source:

 

We already support running GlassFish V3 as a service on Solaris 10 and Windows platforms (see my blog).  I have been investigating how to provide support for automatically starting GlassFish V3 as a service on Linux.  Of course before I can hope to do that — I must be able to set it up manually.  In this blog I will take you through the manual steps needed to run GlassFish V3 as a service on Linux.

This procedure was worked out on my Linux system which happens to be Ubuntu.  Other flavors of Linux may have slightly different procedures.

One decision you need to make right up front is what Linux user should “own” GlassFish V3.  Typically root is used as the owner.  If you choose root as the user you get the advantage that you can use ports < 1024 without complex configuration changes to the system.  For this blog I used root.

Here are the steps  — the file named “glassfish” in step 4 is the simple init script which appears at the end of this blog.

  1. Install JDK 6 if needed
  2. Have root install GlassFish like so:
    1. cd /opt
    2. wget  http://download.java.net/glassfish/v3/release/glassfish-v3.zip
    3. unzip glassfish-v3.zip
    4. rm glassfish-v3.zip
  3. cd /etc/init.d
  4. cp glassfish .
  5. update-rc.d glassfish defaults
  6. OPTIONAL /etc/init.d/glassfish start
  7. OPTIONAL Make sure GlassFish is running OK
  8. reboot — you are done!

To start, stop, restart GlassFish simply run these commands:

If all goes well you can set the init script up for automatic startup and shutdown:

Have fun …

About Amr

Check Also

Oracle APEX | How to add a new row into tabular form by using Hot-Key [JS]

Dear, Now i share sample to using Hot-Keys [JS] to add a new row into ...

Oracle APEX | How to Create Hot-Keys by JavaScript ?

Dear, Now we doing Hot-Keys by JavaScript, Its so sample 🙂 [crayon-59c528613550c429914383/] Now Watching & ...