LAMP+Glassfish server in openSUSE 11.4

After the openSUSE 11.4 release, I thought about deploying a home server, with web, database and application server (Glassfish in my case).

First of all, a standard text-based system installation has to be done, you can add the specific patterns during installation process, but I prefer to add specific repositories after installation, as I would like to program in Java and learn some other languages:

  • openSUSE 11.4 11.4-0 updates
  • BuildService de openSUSE – Databases
  • openSUSE BuildService – Java:packages
  • openSUSE BuildService – devel:languages:per
  • openSUSE BuildService- PHP
  • openSUSE BuildService – devel:languages:python
  • Main repository (Contrib)
  • openSUSE-11.4-11.4-0
  • Packman Repository
  • openSUSE-11.4-Debug
  • openSUSE-11.4-Update-Debug
  • openSUSE-11.4-Non-Oss
  • openSUSE-11.4-Oss
  • openSUSE-11.4-Source

After adding those repositories (from YaST, community repositories), a zypper dup operation was performed (so the system gets updated to the latest package versions, no matter in what repository are they stored)

Finally, some the command to finish the package installation: zypper in -t pattern lamp_server.

You have to open the ports the firewall ports in YaST (and configure apache server to start on system boot): yast2->net services -> http server -> enable http server+open firewall ports.

After the whole process is done, you should be able to see the “It works!” web page (default for an apache web server installation).

To install glassfish in the new server, you should type the following (as root):

# cd /opt/
# wget -c
# unzip
# rm

Now you have to create the init.d scripts:

# vi /etc/init.d/glassfish

And copy this into the script:

#! /bin/sh
case “$1” in
echo “starting glassfish from $GLASSFISHPATH”
$GLASSFISHPATH/asadmin start-domain domain1
$0 stop
$0 start
echo “stopping glassfish from $GLASSFISHPATH”
$GLASSFISHPATH/asadmin stop-domain domain1
echo “usage: $0 {start|stop|restart}”
exit 3

You need to add permissions to new file (thanks to David Blanco):
#chmod a+x /etc/init.d/glassfish

You can now start the server by typing :

# /etc/init.d/glassfish start

And finally, access the server in the host url+port 4848

Have fun!

4 thoughts on “LAMP+Glassfish server in openSUSE 11.4

  1. Usefull. Thanks!

    ‘# vi /etc.init.d/glassfish’ is ‘# vi /etc/init.d/glassfish’

    You need to add permissions to new file:
    #chmod a+x /etc/init.d/glassfish

    • Thank you!

      I think that typo occured while I was copying the command from the terminal (really strange, as I copy&paste from the terminal window trying to avoid modifying it)

      I’m glad that the article was useful to you!


    • You can achieve that just by adding the script to the appropiate runlevel (in YaST you can get to the option in System -> System Services (runlevels). Activate the script in the chosen runlevel and enjoy 😉

      Regards, David

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.