Thursday May 06, 2010

A Survey report on NOSQL Database for Cloud

During the last couple of months, myself and my colleague - Saneesh, besides our day job, started investigating on the current status of databases used by web applications that are deployed on the cloud. During this research, we stumbled onto some thing very interesting - a very interesting evolution known as NoSQL (Not Only SQL) - where in web applications and developers - can decide, based on the type of applications and its inherent data, as to how and where they want to store the data instead of always defaulting to one of the SQL based products. This is a huge revolutionary change for developers rather than having to simply use either MySQL or Oracle databases for their web applications. IMO, choice is always good.

Af course, as with any survey report - this involved a whole bunch of googling and even trying out some of these new stuffs. Found quite enlightening - to say the least. Thought of sharing this report with the rest of you. You can download the pdf version from here. Need to add that this report is no way complete and we are still gathering more and more data. So, please do not hesitate to correct us if you find anything incorrect or misleading.

During this research, we observed a whole lot of both positive and negative comments towards this evolution and we have captured most of these references towards the end of the report. Af course, all of these should also also available from the same googling that we did.

The most interesting conclusion - at least to me - is how much open source is vibrant and active around here and how it is helping in this new evolution.


Tuesday Feb 09, 2010

Check out latest development build of Web Stack

If you are using Cool Stack or Web Stack for your AMP (Apache, PHP and MySQL) stack needs on either Solaris 10 or Red Hat Enterprise Linux, then you might want to check out the latest development build update of Web Stack. This build delivers PHP 5.2.12 , Apache 2.2.14 etc. 

For more information on how to update to this build, please refer to my earlier blog on this topic. If you run into any issues, please use our forum for any trouble shooting tips.

Monday Oct 12, 2009

Interested in finding out what to do with DTrace inside PHP ?

I am proposing a talk in Zend Unconference'09 on the benefits of using DTrace within PHP. If you are attending ZendCon'09 or interested in hearing more on dynamic tracing within PHP, please vote for this talk by visiting here.  Thanks for your support. Here are some of my previous posts on this subject

 Hope to see you in ZendUnCon'09

Wednesday Sep 30, 2009

Web Stack 1.6 Development builds are available for testing

If you didn't know already, GlassFish Web Stack is an open source project within OpenSolaris and offers production support (also available as free download) for open source web tier components like Apache Web Server, PHPMySQL, Tomcat, Hudson etc on Solaris 10 Update 5 (or above) and on RedHat Enterprise Linux 5.2 (or above). Our latest release - Web Stack 1.5 is currently available for download and for more information on this product, kindly check out my earlier post.

Our next version Web Stack 1.6 is in active development and if you would like to follow up our development, you can do so as shown here. Web Stack 1.6 will include component version upgrade for components like PHP, Apache, MySQL, Ruby, Memcached.  With development build 1, PHP 5.2.11 Apache 2.2.13 have been integrated. 

Please note : This development builds are in active development and has not been through any testing. So, this development builds will most likely will have bugs and are meant only for testing purposes.

How to get Web Stack 1.6 Development build ?

GlassFish Web Stack 1.5 release is available either as

  • installation via native packages (SVR4 Packages for Solaris 10 and RPM for RHEL5.2). This is typically the preferred way in large enterprises. This installation will require root privileges and provides integration with Solaris 10 SMF etc.

  • installation via IPS (Image Packaging System) also known as 'Update Center'. This installation is typically preferred by developers and in enterprises where you have access to internet to download and install binaries from internet on your production machine !. This installation does not require 'root' privileges and all files (including web server document root and MySQL data directory) is configured under your installation directory. So, you might find it very intuitive to install, use , develop and even take it with you.

Currently, our development builds are available only through 'Update Center'. 

Installing Web Stack 1.6 (development builds) as IPS (Update Center)

IPS (Image Packaging System) is an open source technology built on Python and is the core underlying framework on how packages are delivered within OpenSolaris. This work was initially done for OpenSolaris.  Now, as with any open source projects, another open source project - Update Center has successfully ported this work for platforms like Solaris 10 and Linux.

Now, GlassFish Web Stack 1.5 release uses this Update Center open source project to deliver a minimal Python runtime and Update Center technology as part of initial download. Then you will need to fire up the Update tool GUI to download and install components that interests you.

Unlike OS native packages, Update Center technology does not verify or warn if you do not have installed any underlying dependent libraries that Web Stack 1.5 stack requires. So, we strongly recommend you to visit our System Package dependency link to ensure that you have these packages installed on your system.

Here is a quick walk through on how to get your AMP stack up and running with this: 

  • Visit our Sun Web Stack 1.5 download web page and download 'click on IPS based Packaging' link
  • Now, you will need to unzip the downloaded tar ball and fire up the update tool GUI. You will need to download some thing like

sriramn@sriramn:~$ unzip  webstack-image-1.5-b09-redhat-i586.zip

sriramn@sriramn:~$ cd webstack1.5

sriramn@sriramn:~/webstack1.5$ ./bin/updatetool 

(Note: You will need GUI configured or DISPLAY set properly to successfully run the above command.)

(Note: If you do not have GUI/X11 configured on your Solaris / Linux machine, then you can do some thing like below to install

from command line.)

sriramn@sriramn:~/webstack$ ./pkg/bin/pkg list  -> to list all the component available


Now, firing up the GUI, will welcome you with a nice GUI like this below

Now, you will need to click on 'Edit Properties'  button and then 'Add Repository' and add the Repository URL to 'http://pkg.sun.com/layered/collection/dev'. 

    And then you will need to select this new repository as the default


Now, click 'Ok' and then select 'Available Add-ons'  to see all the new binaries that are available in this development repository. Now, you should be able to search Apache or PHP or MySQL and download the latest version. 

Note: Here, you will also find other Sun development binaries like GlassFish v3 etc.  



Wednesday Aug 26, 2009

Using DTrace to analyze your web site

During recent OSCON'09 conference, Jack Adams met with me to discuss on the ways to troubleshoot the problems with his web site. Check out this video.

A Jack Adams conversation with Sriram Natarajan, at OSCON 2009.

References: 

Thursday Jul 30, 2009

WebStack@OSCON

 Thought, I would share some of my OSCON'09 , where I spent some of the last week representing Sun at our booth besides attending some very interesting sessions. Our team presented a session as well -  Web Stack - Next Generation Open Web Infrastructure. We had a nice presence at our booths . We talked about OpenSolaris, GlassFish Web Stack and even gave away couple of iPod as well (as you can see here -   Tim Bray graciously selected the winner for one of our iPod winner and  Kai Seidler stopped by to select the winner for our second iPod.)

Well, couple of very interesting things that I observed during my presence at our Sun booth - where I did have a chance to meet lot of OSCON attendees :

  • most common question put to me was  - do you know what is going to happen to you after Oracle acquisition ? Well, I guess, after a while I had these coming out of my lips even without realizing -  "Currently the acquisition hasn't completed yet. So, Sun and Oracle still continues to operate as a separate company etc and honestly I have no clue whatsoever."
  • When I talked about OpenSolaris 2009.06Web Stack project , Sun GlassFish Web StackWeb Stack Enterprise Manager and our latest Web Stack 1.5 release - the most common question I got was "Why do you GlassFish in your product name ? Is Sun GlassFish Web Stack Enterprise Manager same as GlassFish Enterprise Manager?" . Well, this is one of the other answers that I had to repeat myself hundreds of times (if not more) "Sun is currently selling support for our project (where we hope to make money) as part of GlassFish portfolio and I guess, hence our product's name got prefixed with such popular open source project like GlassFish .
  • Interestingly, lot of folks showed lot of interest in our Web Stack 1.5 release on Linux. Even some of them were wondering if our stack can run on Ubuntu. Honestly, I was quite surprised.

Besides, we had different Birds of Feather sessions too (and had some very good attendance for some of these BoF sessions...)

Some time, it was quite tiring but probably was well worth it.

Installing AMP stack within GlassFish Web Stack 1.5...

Now that  Sun GlassFish Web Stack 1.5 release is done, let me walk you through the steps involved in setting up your AMP (Apache 2.2, MySQL 5.1 and PHP 5.2) stack working together. One of the other cool features of Sun GlassFish Web Stack 1.5 release , besides Web Stack Enterprise Manager, is its ability to support

  • installation via native packages (SVR4 Packages for Solaris 10 and RPM for RHEL5.2). This is typically the preferred way in large enterprises. This installation will require root privileges and provides integration with Solaris 10 SMF etc.
  • installation via IPS (Image Packaging System). This installation is typically preferred by developers and in enterprises where you have access to internet to download and install binaries from internet on your production machine !. This installation does not require 'root' privileges and all files (including web server document root and MySQL data directory) is configured under your installation directory. So, you might find it very intuitive to install, use , develop and even take it with you.

 Installing Web Stack 1.5 as a native package / rpm

  • Visit our Sun Web Stack 1.5 download page and 'click on Native components (does not include java component)' link to download our native packages. If you wonder, what is "java components" in this above link . Well, we refer "java components" as components like Tomcat, Hudson, GlassFish 2.1. Since, this blog is about setting up a PHP/MySQL based web site, you can reduce your carbon foot print by avoiding those extra bulky downloads..
  • unzip the downloaded tar ball and install by running the following command (you will need root privileges)

sriramn@sriramn:~$ sudo ./install amp

Now, if you are running on Solaris 10 and don't want to install on all local zones, then you could even do some thing like

sriramn@sriramn:~#  ./install -XG amp


For more information with related to this installation, please check out our Installation Guide. Once you have completed this installation, you might want to refer to our Getting Started Guide as to how to survive with our stack. This guide should help you with basic information like where to find our configuration files, how to start/stop servers etc.

Installing Web Stack 1.5 as IPS (Update Center)

IPS (Image Packaging System) is an open source technology built on Python and is the core underlying framework on how packages are delivered within OpenSolaris. This work was initially done for OpenSolaris.  Now, as with any open source projects, another open source project - Update Center has successfully ported this work for platforms like Solaris 10 and Linux.

Now, GlassFish Web Stack 1.5 release uses this Update Center open source project to deliver a minimal Python runtime and Update Center technology as part of initial download. Then you will need to fire up the Update tool GUI to download and install components that interests you.

Unlike OS native packages, Update Center technology does not verify or warn if you do not have installed any underlying dependent libraries that Web Stack 1.5 stack requires. So, we strongly recommend you to visit our System Package dependency link to ensure that you have these packages installed on your system.

Here is a quick walk through on how to get your AMP stack up and running with this: 

  • Visit our Sun Web Stack 1.5 download web page and download 'click on IPS based Packaging' link
  • Now, you will need to unzip the downloaded tar ball and fire up the update tool GUI. You will need to download some thing like

sriramn@sriramn:~$ unzip  webstack-image-1.5-b09-redhat-i586.zip

sriramn@sriramn:~$ cd webstack1.5

sriramn@sriramn:~/webstack1.5$ ./bin/updatetool 

(Note: You will need GUI configured or DISPLAY set properly to successfully run the above command.)

(Note: If you do not have GUI/X11 configured on your Solaris / Linux machine, then you can do some thing like below to install

from command line.)

sriramn@sriramn:~/webstack$ ./pkg/bin/pkg list  -> to list all the component available


Now, firing up the GUI, will welcome you with a nice GUI like this below

Now, you will need to click on 'Available Add-ons' to see all the Web Stack components listed (as shown below).

Note: If your company requires HTTP Proxy to be configured to access the internet, you will need to click on 'Preferences' windows and appropriately configure proxy information before proceeding any further.

Now, select Apache HTTP Server, PHP , PHP MySQL Connector, PHP APC and MySQL Community Server(5.1.30 version) components from this above list  and click on Install . You should see a confirmation window like below and if you see all the components that you need, click on 'Install' again. 

If you do not have GUI / X11 configured on your Solaris / Linux machine, then you could very well do some thing like below to install AMP stack from command line. 

sriramn@sriramn:~/webstack1.5$ ./pkg/bin/pkg list -a  -> to list all the component available

sriramn@sriramn:~/webstack1.5$ ./pkg/bin/pkg install sun-apache22 sun-php52 sun-php52-apc sun-mysql51 sun-php52-mysql -> to install and configure Apache, PHP and MySQL within your home directory.

sriramn@sriramn:~/webstack1.5$ ./bin/setup-webstack

At the end of this installation, you should have a fully configured Apache , PHP and MySQL runtime within your home directory/webstack1.5 directory.

You can now start the Apache and MySQL server by running the following command from your command line:

  sriramn@sriramn:~/webstack1.5$ ./bin/sun-apache22 start -> by default Apache should now run at port 10080

  sriramn@sriramn:~/webstack1.5$ ./bin/sun-mysql51 start -> by default MySQL server should now run at port 13306


Now, you should be able to install applications like Joomla, Drupal, MediaWiki by simply unzipping these applications under Apache document root (~/webstack1.5/var/apache2/2.2/htdocs) directory

 For example, installing applications like Joomla / Drupal or MediaWiki should simply involve going to Apache document root and unzipping the application and following through the installation process within your browser (http://localhost:10080/joomla etc)

  sriramn@sriramn:~/webstack1.5$ cd var/apache2/2.2/htdocs

  sriramn@sriramn:~/webstack1.5/var/apache2/2.2/htdocs$tar zxvf ~/tmp/joomla\*.gz


Most of the open source components are designed to be built and installed on the same machine. So, building a stack and making it run on different machine takes a bit of work but getting the same stack to be installed at multiple locations takes lots and lots of work. Well, we are doing this release for the first time and would love to hear your feedback and this took us lots and lots of effort to get it right.

You will find all our start/stop scripts under ~/webstack1.5/bin/sun-\* (or wherever you installed /bin). Similarly, you will find all the configuration files under ~/webstack1.5/etc/\* (or wherever you installed /etc). 

Hope you like what you see . If you run into issues, we encourage you to write back to us at our Forum.

Wednesday Jul 29, 2009

GlassFish Web Stack 1.5 is available now ..

If you didn't know already, GlassFish Web Stack is an open source project within OpenSolaris and offers production support (also available as free download) for open source web tier components like Apache Web Server, PHPMySQL, Tomcat, Hudson etc on Solaris 10 Update 5 (or above) and on RedHat Enterprise Linux 5.2 (or above). 

GlassFish Web Stack 1.5 , the latest update in this series, is available as of today and includes updated version components along with Enterprise Administration / Monitoring capability. Please refer to our Getting Started Guide for more information on how to get  your site quickly up and running using GlassFish Web Stack .

Some of the highlights of this release are :

You can try out GlassFish Web Stack 1.5 from here. GlassFish Web Stack 1.5 component runtime  is available as a free download for Solaris and Redhat Enterprise Linux and we hope you will choose Sun for your production support requirements.

Thursday Jul 16, 2009

Running PHP as CGI in OpenSolaris 2009.06

As part of Web Stack project, we deliver an integrated AMP stack within OpenSolaris where Apache 2.2.x, PHP 5.2.x and MySQL 5.1 is integrated together to work seamlessly. In this environment,
  • Apache is configured to run in pre-fork model
  • PHP is loaded as a module (mod_php5) within Apache (pre-fork) MPM.
  • Apache (worker) MPM model is not supported with PHP.

This particular scenario will work great for majority of users.

However, if you are one of those minority folks, who is interested in running PHP as CGI say with Apache 2.2 (worker) MPM, then here is what you need to do :

Configure Apache Server to start in worker (MPM) mode. This should provide you with better performance. This is how you can run Apache 2.2 in worker mode within OpenSolaris.

sriramn@opensolaris:~$ svcadm disable -s http:apache22

sriramn@opensolaris:~$ svccfg -s setprop http:apache22 httpd/server_type=worker

sriramn@opensolaris:~$ svcadm refresh http:apache22

sriramn@opensolaris:~$ svcadm enable -s http:apache22

Af course, to actually see any performance improvement, you will need to copy mpm.conf from samples directory(/etc/apache2/2.2/samples-conf.d/mpm.conf) to  /etc/apache2/2.2/conf.d/mpm.conf  and then tune this file accordingly.

Now that we have got Apache 2.2 worker MPM configured, if you try to run any PHP script within your document root directory, you will notice that they don't work. This is because, PHP module is not loaded if Apache is configured to run in worker MPM. (Remember, PHP modules and different extensions are not completely thread safe.) .

Now to get PHP scripts working again, here is what I did :

Copy PHP CGI script to the Apache's cgi-bin directory

sriramn@opensolaris:~$ pfexec cp /usr/php/bin/php-cgi  /var/apache2/2.2/cgi-bin/

sriramn@opensolaris:~$ pfexec chown webservd:webservd /var/apache2/2.2/cgi-bin/php-cgi

Now, you might want to create a file under /etc/apache2/2.2/conf.d/php-cgi.conf with the below content

#Create a alias for every location where you want to keep your PHP script.
ScriptAlias /contents/ "/var/www/contents/"
ScriptAlias /drupal/  "/var/www/drupal/"
AddHandler  php-cgi  .php
Action          php-cgi  /cgi-bin/php-cgi
<Directory /var/www/contents/>    
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/drupal/>
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>

(updated above content to reflect the feedback received from Jeff's comments to my earlier blog. Thanks a lot, Jeff.)

Here's a better example:

# Create the Alias for every php application that you want to deploy

Alias /phpapp /var/www/contents/

Alias /drupal /var/www/drupal/

ScriptAlias /php-cgi /usr/php/5.2/bin/php-cgi

<⁞Directory /usr/php/5.2/bin/>
 Order allow,deny
 Allow from all
</Directory>

<Location "/phpapp">
 Order allow,deny
 Allow from all
 AddHandler php-cgi .php
 Action php-cgi /php-cgi
</Location>

<Location "/drupal">
 Order allow,deny
 Allow from all
 AddHandler php-cgi .php
 Action php-cgi /php-cgi
</Location>

Finally, you will need to restart the server to allow this above configuration to be loaded. Now, server should be ready to process any php files as 'cgi' script under /var/www/contents directory

Hope you find this useful.

Friday May 29, 2009

Web Stack@CommunityOne West (1st June'2009 - 2nd June'2009)

CommunityOne'2009 is a free event for developers and deployers using Open Source software technologies and tools. If you haven't registered yet, please register for your free pass and plan on spending June 01'2009(Monday) with us to learn how open source tools and technologies can simplify your business.

Web Stack team , responsible for integrating an optimized open source web tier components like Apache, PHP, MySQL, Memcached, Lighttpd, Ruby within Open Solaris and Solaris10 is delivering the following talks at CommunityOne'2009 (Moscone Centre, San Francisco).


View Larger Map

1. Lightning Talk 2 (Monday, June 01'2009 - 10:50 AM - 11:40 AM Hall E 135)

Ease of Use with Sun GlassFish Web Stack by Jeff Trawick

Sun GlassFish™ Web Stack Enterprise Manager: A Simple Yet Powerful Tool for Monitoring AMP Deployments - Praveen Chandrasekharan

2. Observing Applications with DTrace - - Angelo Rajadurai (Monday  June 01 2:40 - 3:30 PM Esplanade 305) 

This session provides a quick introduction to DTrace and demonstrates the use of DTrace to observe the entire web application on the AMP (Apache, MySQL 5.1 PHP 5.2.9) stack and JavaScript technology stack on Open Solaris. The session, which includes a lot of demos, is meant to help the attendees use DTrace in their work.

3. Lightning Talk 5 (Monday, June 01'2009 - 4:00 - 4:50 PM Esplanade 303)

OpenSolaris™ Operating System Web Stack : Introduce the integrated Web Stack within Open Solaris -  Murthy Chintalapati, Jeff Trawick and Jyri Virkki

PHP Web Application Development Made Easy with the OpenSolaris™ Web Stack and the NetBeans™ IDE - I plan to talk on how Netbeans IDE can simplify Web Application development - Sriram Natarajan

4. Web Stack Deep Dive (Wednesday, June 03'2009 - 1 - 5 PM Intercontinental Hotel, near Moscone West, San Francisco)

- Prepare to spend 3 hours to understand what we have been doing within Web Stack and what we plan to do going forward..


Sunday Apr 05, 2009

New DTrace probes within PHP in OpenSolaris 2009.06

Wez Furlong wrote a PECL extension to provide a DTrace probe within PHP more than 4 years back. As part of Web Stack project within OpenSolaris, this extension has been made available within Solaris 10 as well as in OpenSolaris distribution in the last year or so. 

Now, with the upcoming release of OpenSolaris 2009.06 (more specifically with Indiana build 110 or above), PHP runtime has been updated to the latest 5.2.9 release. See my earlier blog on this topic. Besides PHP version update, David Soria Parra - contributor within open source projects like Mercurial, PHP Web Stack has made  this (experimental) patch available to provide the following additional DTrace probes within PHP for this release :

\* compile-file-entry / compile-file-return -> This proble wil fire whenever Zend engine need to compile a given PHP script and can provide information as to which PHP script is currently going through PHP compilation process along with start and end line number. Note: PHP engine within OpenSolaris includes APC PECL extension - which caches the compiled PHP script when requested again and hence this probe will not fire in that circumstance.

\* function-entry / function-return -> This probe will fire whenever Zend engine is executing a PHP function and can provide information as to which PHP function along with its file name and line number is currently being executed by PHP Zend engine.

\* execute-entry / execute-return -> This probe will fire while executing PHP script and can provide information as to which file, line number is currently being executed by PHP Zend engine.

\* exception-thrown / exception-catched -> This probe gets fired whenever PHP runtime encounters an exception and can the classname when an exception is thrown.

\* error -> This probe gets fired whenever PHP runtime throws an error and can provide information like the error message, file name in which the error happened and the corresponding line number.

\* request-startup / request-shutdown  -> This probe gets fired at the start and end of processing a given PHP script and can provide the filename of the script , request URI . This should allow a given DTrace script to track the start and end of PHP script. 

Note:  this patch is under active development and will be further refined to add additional DTrace probes as well as to address any user reported issues. 

Considering that DTrace support is available for Mac as well as FreeBSD, I am sure, PHP community will be interested into looking into this patch as well.

Okay, so now, if you are interested in trying out OpenSolaris 2009.06 (preview build) and the updated AMP stack, check out my earlier  blog for detailed steps on this.

Here is a sample DTrace script that you can use as a reference point.

Friday Mar 27, 2009

PHP 5.2.9 is now available within OpenSolaris 2009.06

With upcoming release of OpenSolaris 2009.06 (more specifically with Indiana build 110 or above), PHP runtime has been updated to the latest 5.2.9 release. If you would like to try out the latest runtime, feel free to check out the OpenSolaris 2009.06 preview build 110 or above.

Installing OpenSolaris 2009.06 (preview build)

If you haven't tried OpenSolaris distribution yet, you can pick up the latest OpenSolaris 2009.06 (preview build) ISO image from here.

Upgrdaing OpenSolaris 2008.11 to OpenSolaris 2009.06 (preview build)

If you already use OpenSolaris 2008.11, then you can upgrade to the latest development builds of OpenSolaris 2009.06 by following these instructions :

Open a command line window by selecting Applications->Accessories->Terminal icon.

pfexec pkg set-authority -P -O http://pkg.opensolaris.org/dev opensolaris.org

pfexec pkg image-update

pfexec init 6 (this will restart the system)

Assuming you have successfully installed or upgraded OpenSolaris 2009.06 (preview build) - either on bare metal or using one of the virtualization solutions like VirtualBox , now you will need to download PHP runtime from the OpenSolaris repository. As usual, let us do this using the command line window.

Note: OpenSolaris distribution does have a nice GUI to download packages - known as PackageManager - available within System->Administration->PackageManager - from the repository.  Hey - I am command line person.So, I prefer doing this one liner rather than going through some buttons in GUI. Now, if you are a GUI person, you are reading the wrong blog !

Okay, here is the one line that you will need to run from your command line window

[sriramn@sriramn]:sriramn> pfexec pkg install amp

Stay tuned for the list of features added within AMP stack (Apache, PHP and MySQL) for the upcoming OpenSolaris 2009.06 distribution.

Monday Feb 09, 2009

Using PEAR/PECL extensions within OpenSolaris

I ran into couple of questions by OpenSolaris users (unfortunately posted at various different places) wondering as to how to use PHP extensions either PEAR or PECL based extensions within OpenSolaris. In OpenSolaris, say to download and install - say any PECL extension, one would do some thing like

 

sriramn@sriramn:$ pfexec /usr/php/bin/pecl install <extension name>

The downloaded and installed extensions will be available at /var/php/5.2/modules location. 

Note: If any PECL extension depends on any third party library to be available on the system, please make sure that those libraries first exist on OpenSolaris by searching OpenSolaris pkg database

Similarly, if you would like to the most popular XML Parser PEAR extension within your application, you could simply run the following command..

sriramn@sriramn:$ pfexec /usr/php/bin/pear install XML_Parser

Monday Jan 12, 2009

What's new with AMP stack in OpenSolaris 2008.11

If you are new to OpenSolaris, please check out this blog on how to get the AMP stack for this platform. 

Since the initial release of OpenSolaris 2008.05 - in the last 4-5 months -  our Web Stack project team has been busy revving up AMP (Apache, MySQL and PHP) stack specific bugs for OpenSolaris 2008.11 as well as porting this stack on Solaris 10 and RedHat Enterprise Linux 5 platforms as part of Sun Web Stack 1.4 release. For more information on this Sun Web Stack 1.4 release, check out this blog from my colleague - Jyri Virkki.

Now, in this blog, I thought I will write some of the important technical issues that has been addressed within AMP stack  for OpenSolaris 2008.11 release.

  1. General version update of AMP components like Apache = 2.2.9, PHP = 5.2.6 and MySQL = 5.0.67.
  2. Apache and PHP configuration files have been updated to provide better performance out of the box.
  3. Apache 2.2.9 now includes additional modules like Perl, FastCGI, DTrace etc
  4. Apache now provides various sample configurations like SSL configuration within /etc/apache2/2.2/samples-conf.d directory. 
  5. MySQL 5.0 server (64-bit) is also now available . However, MySQL server defaults to 32-bit by default. If you would like to run MySQL server as 64-bit, please refer to Administering MySQL server documentation within our wiki.
  6. Experimental MySQL 5.1 server is now available within webstack repository. However, to use MySQL 5.1 within OpenSolaris 2008.11, you will need to explicitly point to Web Stack repository to download and install this server. I guess, more on this in a separate blog !
  7. PHP file layout has been modified to be more in synchronization with the rest of the components. New PHP 5.2.6 file layout within OpenSolaris 2008.11 is /usr/php/5.2 - for all standard binaries, /etc/php/5.2 - for all configuration and /var/php/5.2 - for all data, pecl / pear modules and session specific contents. Also, at the time of startup , PHP engine will look and load all the INI files found under /etc/php/5.2/conf.d directory.
  8. PHP extensions like APC, DTrace is now enabled by default. Also, PECL extensions like XDebug, Memcache, Suhosin, idn and tcpwrap is bundled within OpenSolaris 2008.11. However, they are disabled by default. These extensions are bundled as individual ini files within /etc/php/5.2/conf.d directory.
  9. Individual PHP extensions can be either enabled or disabled by editing their corresponding ini files within /etc/php/5.2/conf.d directory and then restarting Apache SMF service. For more information on restarting Apache SMF service, please visit our Administering Apache Server documentation within our Web Stack Wiki.
  10. PHP extension now includes PEAR / PECL support as well. So, now it should be easy for developers to now download and install their favorite extensions. So, if you wonder as to how to use PEAR or PECL within OpenSolaris, you could do some thing like below
    1. /usr/php/bin/pear install XML_Parser
    2. /usr/php/bin/pecl install inclued

Now, if you install these PECL extensions as shown above, please remember to enable them by editing the php.ini found within /etc/php/5.2/php.ini  location.

You can load any of these PECL php extensions by editing php.ini and adding the following line at the end of the file

extension = [extension name].so

Note: Please note that unlike Linux or other platforms, Solaris engineering folks would like to avoid writing any user data (like data not provided by OS) within /usr location. So, we don't write any dynamic data into /usr. So, what this means is - PEAR or PECL will now install modules under /var/php/5.2/modules directory. However, PHP engine has been patched to look for modules both under /usr/php/5.2/modules as well as /var/php/5.2/modules directory

Hopefully, this acts as a good starting point on what to expect with AMP stack in OpenSolaris 2008.11. For more comprehensive information, please visit our Getting Started Guide or please visit your feedback within our OpenSolaris Web Stack forum .

Setting up AMP Stack within OpenSolaris

With the first release of OpenSolaris - OpenSolaris 2008.05 -  I wrote this and this and this blog on how to use AMP stack for this platform. Well, these blogs very much holds true for the latest release of OpenSolaris - OpenSolaris 2008.11 .

However, OpenSolaris 2008.11 includes a nice GUI application known as Package Manager  is available which further simplifies the process of downloading and configuring software applications that are available within its software repository.  

Let us use this application in this blog to see how easy it is to get an AMP (Apache, PHP and MySQL) stack going on your OpenSolaris 2008.11.

Assuming you have successfully installed opensolaris , let us start Package Manager as shown here

Now, you will need to choose whether you need either 

  • amp -  only the Apache 2.2.8 2.2.9, PHP 5.2.6 and MySQL 5.0.65 5.0.67 runtime
  • amp-dev  -  complete development environment and its tools like cvs, subversion, netbeans along with amp runtime

 and any other software packages that you are interested and click on Install / Update. 

Before Package Manager actually installs the packages on your system, you will get another chance to review your selection like below.

Now, click on Next should start the installation process. That should all be required to complete the installation of AMP runtime stack for OpenSolaris.  

Finally, if you are a GUI person and would prefer a GUI way to start/stop Apache and MySQL services as well as to edit your Apache configuration files then you might want to initialize the Web Stack environment as shown below

 and will need to enter your 'root' password for the initialization to complete. 

Now, if you are a command line person - like myself, you can manage your Apache and MySQL SMF service as below

  • For starting Apache and MySQL service, open a command line window and run the following command

    pfexec /usr/sbin/svcadm enable http:apache22

    pfexec /usr/sbin/svcadm enable mysql:version_50

  • Similarly, for stopping these services, run the following command:

    pfexec /usr/sbin/svcadm disable http:apache22

    pfexec /usr/sbin/svcadm disable mysql:version_50

If in case, you wonder what is SMF - you might wanna check out Service Management Facility project page for more information on how this is useful to you.  

Finally, if you run into any issues, you can check out our  Getting Started Guide or our Web Stack wiki or  feel free to post your issues at our  Web Stack forum page. 


Tuesday Sep 02, 2008

OpenSolaris Web Stack images are now available on Amazon EC2

If you want to quickly host a website running on Joomla or Drupal - or even a wiki based on MediaWiki  - on enterprise quality OS like OpenSolaris- that too without any initial overhead investment (sounds too good to be true ?) - check out our recently uploaded 32-bit OpenSolaris 2008.05 based images for Amazon Elastic Cloud Computing (EC2) environment. Some time back , I mentioned here on the different ways to try out OpenSolaris . Now, these AMI's  allows you to try out cool features within OpenSolaris like ZFS, DTrace, IPS even without a Live CD...

If you are already an Amazon EC2 customer or familiar with Amazon's cloud offering - you can skip these introductions and head out to the list of OpenSolaris based Amazon machine images(AMI).Read on for a quick intro on Amazon EC2 and how to get started..

How to get started with Amazon EC2:

  • Visit Amazon Elastic Compute Cloud (EC2) web site for information on pricing as well as to open Amazon Web Services account and to sign up for Amazon EC2 web service.
  • Check out Amazon EC2 Getting Started Guide for detailed setup instructions. You might also want to check out 'Introduction and FAQ' forum posting on Amazon Web Services developer forums
  • Now, you will need to register with Sun to get access to 32-bit OpenSolaris images by filling this form.
  • Finally, you can use Amazon EC2 tools as described within Getting Started Guide to launch these 32-bit OpenSolaris AMI's.

 


 


Tuesday Jul 01, 2008

How to build sfwnv consolidation within OpenSolaris 2008.05

  Today, we will tackle the tricky thing on how to compile or build  SFW within OpenSolaris 2008.05 . Now, if you wonder as to what is SFW - SFW stands for  Sun Freeware components - mother of all third party open source components like Apache, PHP, MySQL, PostgreSQL currently available in OpenSolaris.

So, you might wonder as to why I need build the whole load rather than just building what I want like the way we used to do in Linux. Well, the way developers build open source components in Linux is

  • download the specific source rpm of the components that we are interested in
  • build them using 'rpm -b' .

Unfortunately, OpenSolaris build system has not been updated to do this yet. Hence, we are still struck with building a whole lot even if users just wanted to compile MySQL say - with a debug build. On the positive note, engineers working within OpenSolaris does seem to recognize the importance of this and hopefully a change can be seen very shortly.

Till then, hope, you would like my quick write up - that I had to on my system -  to get SFW build going. Building SFW components on OpenSolaris 2008.05 distribution - in my opinion - is a 2 step process

  • Download and install the necessary dependent components
  • Setup and configure your system so that SFW build can complete successfully.

Download / Install dependent components:

  • If you haven't already, you might want to download and install OpenSolaris 2008.05 from LiveCD
  • Next, download and install the necessary  gcc and java packages from OpenSolaris pkg repository by doing something like
    •  pfexec pkg refresh --full
    • pfexec pkg install  pkg:/SUNWipkg-AT-0.5.11-0-DOT-91  -> this command is optional and will download the latest pkg - (something equivalent like apt-get or yum on Linux) updates from OpenSolaris repository. At the time of writing, build 91 is the latest. If you are already running on latest update , you can safely ignore this command.
    • Now, let us install the missing but necessary development tools like GCC, Java , bison, flex etc
    • pfexec pkg install  gcc-dev  amp-dev  java-dev
    • pfexec pkg install SUNWscp SUNWgnu-idn   SUNWlibevent  SUNWugenu
    • pfexec pkg install SUNWbison  SUNWflexruntime   SUNWflexlex  SUNWtoo 
    • pfexec pkg install SUNWgmake  SUNWaconf   SUNWlibtool
    • pfexec pkg install SUNWgm4  SUNWgnu-automake-110  
    • pfexec pkg install SUNWsqlite3 SUNWpysqlite
    • pfexec pkg install  SUNWlibopenusb
    • pfexec pkg install SUNWgnome-base-libs-java  SUNWgnome-common-devel 
    • pfexec pkg install SUNWxorg-headers SUNWGlib  SUNWxwinc 
  • Once, we have successfully downloaded all these binaries, we will need to install this manual hack (hopefully for time being)
    • pfexec ln -sf /usr/bin/automake-1.10 /usr/bin/automake
    • pfexec ln -sf /usr/jdk/instances/jdk1.6.0 /usr/jdk/instances/jdk1.5.0

  • SFW build process still requires Sun Studio 11. To simplify , we will simply download the  pre-install image of Sun Studio compiler rather than following another installation. the Note: You will need to provide a Sun developer user account to download this tar ball. Let us assume that you have downloaded to /tmp directory. Unpack the downloaded archive into the /opt directory as shown with the below commands:
    • cd /opt
    • bzcat /tmp/sunstudio11-ii-DATE-PLATFORM.tar.bz2 | pfexec /bin/tar -xf -
  • Now, we will need to download SUNWonbld package. Let us unpack this download ON specific build tool to /tmp and install as shown below
    • cd /tmp
    • bunzip2 -c SUNWonbld.i386.tar.bz2 | tar xf -
    • pfexec /usr/sbin/pkgadd -d onbld
  • Finally, let us download SFW source from here  and unpack into your home directory as shown below
    • mkdir -p ~/sfwnv
    • cd ~/sfwnv ; bunzip2 -c /tmp/<downloaded-sfw-source-tar-ball> | tar xf -
  • Now, you can setup your environment so that a build process can happen successfully.

Setup your system environment

  • Assuming that you have unpacked SFW source tar ball to your ´<home directory>/sfwnv´ , then you will need to do the following to set up your build environment
    • Copy sfwnv-opensolaris.sh setup script to your home directory
      • cp  ~/sfwnv/usr/src/tools/env/sfwnv-opensolaris.sh ~/
    • Edit ~/sfwnv-opensolaris.sh , using your favorite editor,to make the following changes and save the file.
      • GATE should point to the top of your SFW work space. If you have unpacked the SFW source tar ball to ´sfwnv´ directory, then you can leave this variable as such
      • CODEMGR_WS should provide an absolute path to your top build workspace (Example: CODEMGR_WS=/export/home/sriramn/sfwnv)
      • STAFFER  change this variable to reflect your current user name
      • MAILTO (Optional: valid email Id if you would like to receive an email once the build is completed or failed)
    • Setup your PATH , JAVA_ROOT and JDK_ROOT variable as shown below. For example, on bash (default shell in OpenSolaris 2008.05), you will do something like . Af course, if you have customized your OpenSolaris 2008.05 distribution to use other shells like csh then you will need to setup to export accordingly.
      • export PATH=/usr/bin:/usr/ccs/bin:/usr/sfw/bin:/opt/SUNWspro/bin:/opt/onbld/bin
      • export JDK_ROOT=/usr/jdk/latest
      • export JAVA_ROOT=/usr/jdk/latest
    • That is all there is to do. Now, you can trigger a full SFW build with all bundled open source components by running the following command:

      • /usr/bin/ksh93 /opt/onbld/bin/nightly -n ~/sfw-opensolaris.sh &

    • This above command takes a long (and very long time) to finish. So, you might better find something else to work on for a few hours. You can monitor the build's progress using ptree(1). nightly(1) will send mail (to $MAILTO variable in sfw-opensolaris.sh) when it is finished.

Note: If you are going to be developing or building / modifying SFW components using OpenSolaris 2008.05 distribution, I personally would encourage to first  image-update the system to latest Nevada build.  Check out opensolaris-announce to find out the latest update available and update your system accordingly to use the latest nevada build before building SFW. At the time of writing this blog, Nevada build 91 has been released for OpenSolaris 2008.05 distribution and you can update to this image as shown in this blog

Sunday Jun 29, 2008

Check out this PHP programming book..

I was looking around for a good web site to refresh my PHP skills and I ran into this nice Practical PHP programming book . Found to be quite useful especially for some one who already is familiar with other programming languages. If you happen to know any other good PHP programming book - for experienced programmers , I would appreciate if you can share it with me..

Wednesday Jun 25, 2008

Catch us at #opensolaris-web IRC channel

Thanks to Nick Kew , engineers involved within  Web Stack and Cool Stack projects are now hanging out  in #opensolaris-web  IRC channel on freenode.net . Feel free to drop by and participate ...

Now, if you wonder what the heck is this IRC - you are probably better of checking out this great Wikipedia link (where else would you go!).

To connect to #opensolaris-web , you can either

  • choose your favorite IRC client which will run on your machine. 
  • Use  Pidgin - an IRC-capable instant messaging client included within OpenSolaris distributions;
  • Use  Chatzilla add-on to Firefox, the above channel links should work just fine.

and check out this Using the network and How to participate in IRC communication to get you started.

Do drop a note, if you would appreciate a blog on how to get Pidgin (that is what I use) to connect to this channel.

See ya... 

Thursday May 22, 2008

Setting up phpMyAdmin in OpenSolaris

Recently, some one posted a question in a mailing list as to how to get phpMyAdmin working within OpenSolaris. So, here is a quick write up on how to get this done. Hope, you find this useful

Install and configure AMP stack within OpenSolaris

  • Install  OpenSolaris from LiveCD. You can download your copy from here
  • Install Web Stack components from OpenSolaris repository by doing something like
    • Open a command line terminal window and enter the below command . This will download components like Apache 2.2, MySQL 5.0 and PHP 5.2 from the repository.
      • pfexec pkg install amp
  • Let us register these downloaded packages with Solaris Service Management Framework (SMF) by doing something like
    • (from a command line terminal window)
      • pfexec /usr/sbin/svccfg -s /var/svc/manifest/network/http-apache22.xml
      • pfexec /usr/sbin/svccfg -s /var/svc/manifest/application/database/mysql.xml
      • pfexec /usr/sbin/svccfg -s /var/svc/manifest/application/database/memcached.xml
  • Finally, let us start Apache and MySQL services by doing something like
    • (from a command line terminal window)
      • pfexec /usr/sbin/svcadm enable http:apache22
      • pfexec /usr/sbin/svcadm enable mysql:version_50

 With this, you should have successfully configured an AMP stack for OpenSolaris. If you would like to try out some sample php pages, you could very well write these php pages under default apache document root directory ( /var/apache2/2.2/htdocs )

Note that within OpenSolaris the Apache document root directory - location in your hard disk where apache web server looks to serve incoming requests from your browser - needs special privilege to write to. Now, within OpenSolaris, you can get this privilege by prefixing with 'pfexec' command ahead.

For example, if I had to write a sample hello world php within OpenSolaris, I would do something like

pfexec vi /var/apache2/2.2/htdocs/hello.php

and save the following contents. Now, you should be able to access this page from http://localhost/hello.php

  <?php

   echo "Hello World";

  #Now, let us get the php server information

  echo phpinfo();

   ?>

Configuring phpMyAdmin within OpenSolaris 

Now, let us go ahead and download phpMyAdmin from here and unpack the downloaded tar ball to say /var/www. Again, from a command line terminal window, this is easily done - as shown below :

  •  Download phpMyAdmin to a local directory which is not accessible by every one to say /var/www
    • pfexec wget  phpmyadmin-2.11.6
    • pfexec mkdir -p /var/www
    • cd /var/www & pfexec gtar jxvfp ~/phpmyadmin-2.11\*
    • pfexec mv /var/www/phpmyadmin-2.11\* /var/www/phpmyadmin
  • Now, you might want to download this phpmyadmin.conf to Apache 2.2 configuration location and restart Apache Web Server. This configuration snippet instructs apache to to load phpMyAdmin from /var/www
    • wget phpmyadmin.conf
    • pfexec cp phpmyadmin.conf /etc/apache2/2.2/conf.d
    • pfexec /usr/sbin/svcadm restart http:apache22
  • Finally, you should be able to access phpMyAdmin from your browser by doing something like
    • http://localhost/myadmin


 

About

Sharing what little I know

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today