12 April 2011

Solaris 11 Express Glassfish 3.1 setup [command-line]

I haven't found any good guides on installing and running glassfish 3.1 on unix-like (command-line) so I'll try to do something to get it running and I'll put down all my trail, here. So if you're reading this, I've probably succeeded or at least achieved something worth reading.

Firs of all there are two types of installation. Self-extracting bundle that requires GUI so we can't use it, and multi-platform zip-package. The last one is basically a ready-made server, that you just put somewhere on your server and just fire it up.

You can probably find the latest version on glassfish site: glassfish.java.net/public/downloadsindex.html

First of all you need to download it. I will download it into /opt
wget http://download.java.net/glassfish/3.1/release/glassfish-3.1.zip
Why /opt? You can read about purpose of different unix directories on the Filesystem Hierarchy Standard, as for /opt it says:
/opt is reserved for the installation of add-on application software packages.
A package to be installed in /opt must locate its static files in a separate /opt/<package> directory tree, where <package> is a name that describes the software package.
so I guess it's ok.

Now we'll extract the data from the archive
unzip glassfish-3.1.zip
and it seems it's all that you need. Now you should have /opt/glassfish3 directory and you must be able to start glassfish server with
/opt/glassfish3/bin/asadmin start-domain
now you can acces the web administration tool on 4848 port of your server. Give it a try.

You have a running glassfish 3.1 server on your unix box, you can access administration console, and you can even shut it down with
/opt/glassfish3/bin/asadmin stop-domain
but how to make it to start-on-boot and maybe run under another user?

I couldn't imagine that glass fish is so user-friendly. You just execute:
/opt/glassfish3/bin/asadmin create-service
and it creates service for a system you are running it on, and solaris smf is supported too. Moreover it tells you what to do next, how to use it ext.

As for another user... maybe later :)

No comments:

Post a Comment