User Tools

Site Tools


glassfish

Using Glassfish on OpenSolaris

These instructions are for running Glassfish on OpenSolaris VPS 2009.06 build. Installation requires root access. Glassfish will be run as the gf user once the install is complete.

root@fans:/# pkg install glassfishv2
...
root@fans:/# groupadd gf
root@fans:/# useradd -g gf -s /bin/bash -m gf

Create a new Glassfish domain using ports 80 and 443.

root@fans:/# asadmin create-domain --adminport 4848 --instanceport 80 --domainproperties http.ssl.port=443 --domaindir /home/gf domain1
...
root@fans:/#

Create password file, this is used with the SMF service management. Use the password that was generated in the create-domain command above.

root@fans:/# cat > /home/gf/domain1/config/passfile
AS_ADMIN_USER=admin
AS_ADMIN_PASSWORD=adminadmin
AS_ADMIN_MASTERPASSWORD=changeit
^D
root@fans:/#
root@fans:/# chmod 400 /home/gf/domain1/config/passfile
root@fans:/# chown -R gf:gf /home/gf/domain1
root@fans:/# asadmin create-service --passwordfile /home/gf/domain1/config/passfile /home/gf/domain1
...

Now, we provide the necessary privileges for the gf so it can run and manage Glassfish.

root@fans:/# svccfg -s domain1 addpropvalue general/value_authorization astring: solaris.smf.value.domain1
root@fans:/# svccfg -s domain1 addpropvalue general/action_authorization astring: solaris.smf.manage.domain1
root@fans:/# svccfg -s domain1 setprop start/user = astring: gf
root@fans:/# svccfg -s domain1 setprop start/group = astring: gf
root@fans:/# svccfg -s domain1 setprop start/privileges = astring: basic,net_privaddr
root@fans:/# svcadm refresh domain1

The following should be added to /etc/security/auth_attr. This will allow management of Glassfish SMF service from the gf user:

root@fans:/# grep domain1 /etc/security/auth_attr
solaris.smf.manage.domain1:::Manage GF domain1 service states::
solaris.smf.value.domain1:::Change GF domain1 value properties::
root@fans:/# 

root@fans:/# usermod -A solaris.smf.value.domain1,solaris.smf.manage.domain1 gf

Done! Now start Glassfish as the gf user. If all went well, you'll be able to connect to the console over on port 4848 in the browser.

gf@fans:~$ cp /etc/skel/.profile ~; . .profile
gf@fans:~$ svcadm enable domain1
glassfish.txt · Last modified: 2010/05/30 04:51 by admin