Virtual Guru's Blog – Home of Virtualization Workshops

May 15, 2008

Inst&Conf: Liferay 5.0 on Glassfish bundle DEMO

Filed under: amazon_aws, cloud, glassfish, opensolaris, Virtualization — natiku @ 9:05 am

Installation of Liferay Glassfish bundle DEMO is easy and is identical to install of empty Glassfish.

This entry is part of ‘OpenSolaris on Amazon EC2’ Workshop

Liferay JaveOne 2008

Blogs Sun/Liferay initative

liferay – Enterprise portal home

Note: Installation of bundle need 700MB of free disk space on “/” partitions, install will have need around 500MB.

1) Get Portal 5.0.1 RC Liferay + Glassfish Solaris x86 bundle

Liferay on Glassfish bundle with embedded Java Database and preloaded sample portal.

cd /opt
curl  -O

2) Unpack and install

java -Xmx512m -jar liferay-portal-glassfish-sunos_x86-5.0.1.jar -console
Accept license
cd ./glassfish
ant -f setup

3) Start Glassfish

/opt/glassfish/bin/asadmin start-domain domain1

Note: This will auto deploy Lafieray portal application , be patient

4) Check Glassfish logs


5) Test installed applications

Liferay login is on left top corner, mose over to vWlcome to see Sign-in option.

Liferay test User: Pass: test



Glassfish Admin User: admin Pass: adminadmin


First login to Glassfish administration will pop up registration, even when it is 100% optional we suggest you to register and get benefits.

5) Optional: Tune Glassfish JVM memory

Sun Java System Application Server 9.1 Performance Tuning Guide >> 4. Tuning the Java Runtime System

Tune JVM HEAP memory in /opt/glassfish/domains/domain1/config/domain.xml,
Amazon AWS m1.small which have 1700MB RAM, so for Solaris for JeOS we can put there 1024MB:

Updating it to:

6) Restart your Glassfish instance

/opt/glassfish/bin/asadmin stop-domain domain1
/opt/glassfish/bin/asadmin start-domain domain1

Note: Start can take time, due to Liferay pages compilation

7) Create minimal Glassfish SMF script for automatic start / stop

cat /opt/glassfish/glassfish.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='glassfish:domain1'>
<service name='glassfish/domain1' type='service' version='1'>
<create_default_instance enabled='true' />
<single_instance />
<dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local' />
<dependency name='network-service' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/network/service' />
<exec_method type='method' name='start' exec='/opt/glassfish/bin/asadmin start-domain domain1' timeout_seconds='300' />
<exec_method type='method' name='stop' exec='/opt/glassfish/bin/asadmin stop-domain domain1' timeout_seconds='150' />
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='transient' />
<stability value='Unstable' />
<loctext xml:lang='C'>Glassfish V2</loctext>

Load SMF this XML definition

/usr/sbin/svccfg validate /opt/glassfish/glassfish.xml
/usr/sbin/svccfg import /opt/glassfish/glassfish.xml
/usr/sbin/svcadm enable svc:/glassfish/domain1:default

Check then SMF service working OK

svcs -a | grep glassfish
online         21:46:04 svc:/glassfish/domain1:default
svcs -l svc:/glassfish/domain1:default
fmri         svc:/glassfish/domain1:default
name         Glassfish V2
enabled      true
state        online
next_state   none
state_time   Tue Apr 29 21:46:04 2008
logfile      /var/svc/log/glassfish-domain1:default.log
restarter    svc:/system/svc/restarter:default
dependency   require_all/none svc:/system/filesystem/local (online)
dependency   require_all/none svc:/network/service (online)
cat /var/svc/log/glassfish-domain1:default.log
Domain [domain1] is running [Sun Java System Application Server 9.1_01 (build b09d-fcs)]
with its configuration and logs at:   [/opt/glassfish/domains].
Admin Console is available at [http://localhost:4848].
Use the same port [4848] for "asadmin" commands.
User web applications are available at these URLs:
[http://localhost:8080 https://localhost:8181 ].
Following web-contexts are available:
[/web1  /__wstx-services tunnel-web / liferay-jedi-theme ].
Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
[service:jmx:rmi:///jndi/rmi://domU-12-31-39-00-69-D8.compute-1.internal:8686/jmxrmi] for domain management purposes.
Domain listens on at least following ports for connections:
[8080 8181 4848 3700 3820 3920 8686 ].
Domain does not support application server clusters and other standalone instances.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: