Back to the main page

Sun WebStack or SAMP (Solaris, Apache, MySQL and PHP)

Sun is trying to create good open source platform and to integrate products like: 

Mysql - for database 
TomCat - for web container 
GlassFish - for java container 
LifeRay - for portal 
Ruby, Perl, Python, PHP - for programming langages 
OpenESB - for Enterprise Service Bus 

So it comes Sun GlassFish portfolio containing: 

 Glassfish Web Stack - integrated AMP stack 
 GlassFish Web Space Server 
 GlassFish ESb 
 GlassFish Enterprise Server 

For now I am only interested in GlassFish Web Stack (current version 1.4) that includes:

- 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	

Web Stack is using several network ports for regular operations: 

	80 - apache and lighttpd	
	3306 - mysql	
	3128 - squid	
	8080 - tomcat	
	11211 - memcashed 	

Download  webstack-all-1.4-b06-solaris-i586.tar.gz  and guzip/extract it to get data streams of included packages. 

gunzip -c webstack-all-1.4-b06-solaris-i586.tar.gz | tar xvf -
I'll go only with AMP (Apache, MySQL and PHP) stack installation for now. 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. I do installation with pkgadd. 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]
As said before, let's 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: - Notification of new versions, patches, and updates - Special offers on Sun developer products, services, and training - Access to early releases and documentation 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.
/opt> svcs -a |grep apache
disabled       12:59:49 svc:/network/http:sun-apache22
Start it with recursively enabling its dependencies.
/opt>  svcadm -v enable -r sun-apache22 
svc:/network/http:sun-apache22 enabled.
svc:/milestone/network:default enabled.
svc:/network/loopback enabled.
svc:/network/physical enabled.
svc:/system/filesystem/local:default enabled.
svc:/milestone/single-user enabled.
svc:/system/identity:node enabled.
svc:/system/filesystem/minimal enabled.
svc:/system/filesystem/usr enabled.
svc:/system/boot-archive enabled.
svc:/system/filesystem/root enabled.
svc:/system/device/local enabled.
svc:/milestone/devices enabled.
svc:/system/device/fc-fabric enabled.
svc:/system/sysevent enabled.
svc:/system/manifest-import enabled.
Apache server is installed in /opt/webstack/apache2/2.2/ Setup MySQL database MySQL database is installed in /opt/webstack/mysql/5.0 Enable MySQl service
#  svcadm -v enable -r sun-mysql50 
svc:/application/database/sun-mysql50:default enabled.
svc:/milestone/network:default enabled.
svc:/network/loopback enabled.
svc:/network/physical enabled.
svc:/system/filesystem/local:default enabled.
svc:/milestone/single-user enabled.
svc:/system/identity:node enabled.
svc:/system/filesystem/minimal enabled.
svc:/system/filesystem/usr enabled.
svc:/system/boot-archive enabled.
svc:/system/filesystem/root enabled.
svc:/system/device/local enabled.
svc:/milestone/devices enabled.
svc:/system/device/fc-fabric enabled.
svc:/system/sysevent enabled.
svc:/system/manifest-import enabled.
Root's default password is blank as you can see:
/opt/webstack/mysql/5.0/bin> ./mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.67 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
You don't want this, so change it with:
/opt/webstack/mysql/5.0/bin> ./mysqladmin -u root password qwerty
NOTE: qwerty is just example, please use strong one. Test do you have access with new password.
/opt/webstack/mysql/5.0/bin>  ./mysql -u root -p 
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.0.67 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
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.
/etc/opt/webstack/mysql/5.0> ls
total 88
drwxr-xr-x   2 root     bin          512 Jul 23 12:58 .
drwxr-xr-x   3 root     bin          512 Jul 23 12:58 ..
-r--r--r--   1 root     bin         5068 Dec 10  2008 my-huge.cnf
-r--r--r--   1 root     bin        21011 Dec 10  2008 my-innodb-heavy-4G.cnf
-r--r--r--   1 root     bin         5043 Dec 10  2008 my-large.cnf
-r--r--r--   1 root     bin         5050 Dec 10  2008 my-medium.cnf
-r--r--r--   1 root     bin         2620 Dec 10  2008 my-small.cnf
-rw-r--r--   1 root     bin         2620 Dec 10  2008 my.cnf
PHP Environment PHP configuration and runtime files are located in: 1. Installation location: /opt/webstack/php/5.2 2. Runtime files: /var/opt/webstack/php/5.2 3. Configuration files: /etc/opt/webstack/php/5.2 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 the 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
And what now? Well, you can go ahead and install popular web applications, like Drupal and many many others.
Back to the main page