Glass Fish Web Stack installation - example

Download Glass Fish Web Stack from Sun

And unzip it.
gunzip -c webstack-all-1.4-b06-solaris-sparc.tar.gz | tar xvf -

Package contains (example from WebStack version 1.4):

- Apache HTTP Server 2.2.9
- GlassFish v2 UR2
- lighttpd 1.4.19
- memcached 1.2.5
- mod_jk 1.2.25
- mod_perl 2.0.2
- MySQL 5.0.67
- PHP 5.2.6
- Python 2.5.2
- Ruby 1.8.6 p287
- Squid 2.6.STABLE17
- Tomcat 5.5.27
Let's install only AMP (Apache, MySQL and PHP) stack .

Check do you have required dependencies (note: these are most important packages, you may need to install some additional ones).

WebStack installer (this will install other stuff and this script was written in python) requires: SUNWPython
Apache requires: SUNWlexpt, SUNWpr, SUNWtls, SUNWlibsasl, SUNWcry, SUNWpostgr-82-libs
MySQl requires: SUNWperl584core, SUNWopenssl-libraries
PHP requires: SUNWpostgr-82-libs, SUNWopenssl-libraries

/tmp> foreach i ( SUNWPython SUNWlexpt SUNWpr SUNWtls SUNWlibsasl SUNWcry SUNWpostgr-82-libs SUNWperl584core SUNWopenssl-libraries ) 
foreach? echo 
foreach? echo --- check ${i} ---- 
foreach? pkginfo ${i} 
foreach? echo 
foreach? echo ---- done with ${i} --- 
foreach? end 
So I found I need to install SUNWPython and SUNWpostgr-82-libs. SUNWPython requires SUNWPython-share, SUNWTk and SUNWTcl.

Once this is done I can see installer options.
# ./install -h 
Usage: install -?|--help  
or: install [amp | apache | lighttpd | memcached | mysql | php | python | ruby | squid | tomcat] 
Install only AMP.
# ./install amp 
WS012 The following dependencies were not resolved, 
sun-wsbase.pkg [SUNWjpg,SUNWfontconfig,SUNWpng,SUNWfreetype2] 
sun-php52.pkg [SUNWjpg,SUNWpng] 
Okay, let's install these 4 dependences (it will be more once you start installation) :-(

And installing sun-php52.pkg will ask for sun-apache22.pkg and sun-mysql50.pkg, so basically this is NOT automatic installation of whole AMP, since I have to do all these dependences manually.

Install sun-mysql50.pkg first (since installation of sun-apache22.pkg will requires this).

And finally this is what happened:
#   ./install amp 
sun-apache22-dtrace.pkg...
sun-php52.pkg...
sun-apache22-fcgid.pkg...
sun-apache22-perl.pkg...
sun-php52-xdebug.pkg...
sun-php52-suhosin.pkg...
sun-php52-apc.pkg...
sun-php52-idn.pkg...
sun-php52-dtrace.pkg...
sun-php52-memcache.pkg...
sun-php52-tcpwrap.pkg...
WS104 A browser could not be invoked to display the Product Registration page. 
You may register the product by opening the following URL in a browser:
file:///var/tmp/webstack_register.root.html
Installation was successful.
Product registration allows you next: And stuff has been installed in /opt/webstack directory
/opt/webstack> ls
total 30
drwxr-xr-x  10 root     bin          512 Jul 23 13:00 .
drwxr-xr-x   4 root     sys          512 Jul 23 12:53 ..
drwxr-xr-x   3 root     bin          512 Jul 23 12:59 apache2
drwxr-xr-x   3 root     bin          512 Jul 23 13:00 bin
drwxr-xr-x   2 root     root         512 Jul 23 12:53 legal
drwxr-xr-x   4 root     bin          512 Jul 23 12:58 lib
drwxr-xr-x   3 root     bin          512 Jul 23 12:58 mysql
drwxr-xr-x   3 root     bin          512 Jul 23 13:00 php
-r--r--r--   1 root     bin         4230 Dec 10  2008 README
drwxr-xr-x   3 root     bin          512 Jul 23 12:59 share
drwxr-xr-x   6 root     bin          512 Jul 23 12:53 wslibs

Set Web server environment

Apache is disabled after installation. Start it with:

/opt> svcadm -v enable -r sun-apache22

Apache config file httpd.conf is placed in /etc/opt/webstack/apache2/2.2.
Apache is running under user webservd.
The location of site files are in /var/opt/webstack/apache2/2.2/htdocs
List view of server files is disabled by placing IndexIgnore * in < Directory "/var/opt/webstack/apache2/2.2/htdocs">

Setup MySQL database

MySQL database is installed in /opt/webstack/mysql/5.0
Enable MySQl service

# svcadm -v enable -r sun-mysql50

Root's default password for MySQL is blank, change it with:

/opt/webstack/mysql/5.0/bin> ./mysqladmin -u root password your_password

The installation creates default configuration file my.cnf in /etc/opt/webstack/mysql/5.0. In same directory there are other examples for different deployments.

PHP Environment

PHP configuration and runtime files are located in:
PHP modules are available as extensions. Each module has respective INI file in /etc/opt/webstack/php/5.2/conf.d directory. Some extensions are not enabled and to enable them just edit corresponding INI file, see example for "suhosin" extension.

/etc/opt/webstack/php/5.2/conf.d> cat suhosin.ini
;Uncomment next line to enable suhosin extension in php
;extension=suhosin.so

The php.ini file (placed in /etc/opt/webstack/php/5.2) controls PHP's behavior.