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

Check out Web Stack Enterprise Manager within Web Stack 1.5

Now that GlassFish Web Stack 1.5 release is finally available for download, check out the highlight of this release - Enterprise Manager


Web Stack Enterprise Manager within Web Stack 1.5 offers the following benefits :
  •  Ability to start / stop / restart open source web tier components within Web Stack like Apache HTTP Server, Tomcat, MySQL 5.0/5.1, Squid, Lighttpd.
  • Ability to lay out monitoring statistics of all these components in graph form. You also move back in time within these graphs allowing you to understand the patten of your load etc.
Web Stack Enterprise Manager, unlike the rest of the Sun GlassFish Web Stack 1.5 release , comes with a 30 day evaluation license. You will need to call Sun and buy support for using it post evaluation period. Hey , gotta make money some where..

However, rest of the GlassFish Web Stack 1.5 release is free to download and use (even for your production needs). We hope, you will consider Sun for your production support requirements.  If you have any issues with using Web Stack, please post your issues to our Forum - where some of the developers lurk and will be happy to guide you.

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.

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..


Monday Feb 09, 2009

Alternate ways of getting pecl extensions to work in OpenSolaris

Earlier, I wrote this blog on how to use PECL extensions within OpenSolaris. Now, there will be some scenario where in a simple pecl install <extension name> might not work because of how the script might have been written or what external dependencies like it depends etc.

For example, if you wanted to get mailparse PECL extension working within opensolaris, you would obviously try the following command first

pfexec /usr/php/bin/pecl install mailparse


and would probably be scratching your head when you run into the below error ...

bash-3.2# /usr/php/bin/pecl install mailparse
downloading mailparse-2.1.4.tar ...                                                                                                                                                                                                         
Starting to download mailparse-2.1.4.tar (Unknown size)
........................................done: 188,416 bytes                                                                                                                                                                                 
9 source files, building
running: phpize                                                                                                                                                                                                                             
Configuring for:
PHP Api Version:         20041225                                                                                                                                                                                                           
Zend Module Api No:      20060613
Zend Extension Api No:   220060519                                                                                                                                                                                                          
building in /var/tmp/pear-build-defaultuser/mailparse-2.1.4
...

checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. 

What the above error means that while PECL framework trying to build the mailparse extension , it is looking for a tool known as 're2c' (which is internally used by PHP). Unfortunately, this tool has not yet made its ways into OpenSolaris yet. I am pretty sure, this tool will soon make its way into OpenSolaris repository as well..

Okay, in these scenario, here is another quickie to get things going for you...

  • Within your OpenSolaris machine, manually download mailparse extension from PECL repository
  • run /usr/php/bin/phpize , followed by configure and build command.

[sriramn@sriramn]'~'>gunzip -c mailparse-1.1.4.tar.gz | tar xvfp -
[sriramn@sriramn]'~'> cd mailparse-1.1.4
[sriramn@sriramn]'~'>/usr/php/bin/phpize
[sriramn@sriramn]'~'>./configure --with-php-config=/usr/php/bin/php-config && gmake && gmake install


Now, mailparse extension should be available under /var/php/5.2/modules directory. If you would like to include any mailparse specific extension, you will need to define them within /etc/php/5.2/php.ini

Af course, for Apache/PHP module to load these new extensions, you will need to restart Apache/PHP server by doing some thing like.. I am sure, you know this already :-)

svcadm restart http:apache22

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

Tuesday Jan 13, 2009

Sun Java System Web Server is now available as Open Web Server !

As I mentioned earlier in this blog, Sun followed up on its earlier announcement and  released the core kernel  of Sun Java System Web Server  as Open Web Server under BSD license !. Open Web Server has found its new home under OpenSolaris Web Stack project  where in we intend to continue developing this beast.  

If you wonder, what is available within Open Web Server, check out this feature comparison chart between Sun Java System Web Server and Open Web Server .

Now, if you would like to build and try out this beast - check out Open Web Server Build Instructions which currently provides instructions on what it takes to build this beast on platforms like Fedora, Debian, openSuSE, Ubuntu and OpenSolaris.

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

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... 

Monday May 05, 2008

Famous 5 minute installation of Wordpress with OpenSolaris 2008.05

So, if I had to setup a blogging web site, where would I go other than the favorite - WordPress. I followed their famous 5 minute installation steps within OpenSolaris 2008.05 and here we go.

\* OpenSolaris 2008.05 is a LiveCD based distribution . So, if you need a AMP stack, you can get this on demand by  running the following command

[sriramn@sriram-laptop]: pfexec pkg install amp

 

\* Now, you can initialize and configure Apache and MySQL service by doing  something like

[sriramn@sriram-laptop]: pfexec /usr/sbin/svccfg import /var/svc/manifest/application/database/mysql.xml

[sriramn@sriram-laptop]: pfexec /usr/sbin/svccfg import /var/svc/manifest/network/http-apache22.xml 

[sriramn@sriram-laptop]: pfexec /usr/sbin/svcadm enable network/http:apache22

[sriramn@sriram-laptop]: pfexec /usr/sbin/svcadm enable database/mysql:version_50

 

\* Now, let us configure a Wordpress database within MySQL database. So, let us do something like

[sriramn@sriram-laptop]: pfexec /usr/mysql/bin/mysql -u root
 

here is a sample output that you would expect to see...

 

[sriramn@sriram-laptop]: pfexec /usr/mysql/bin/mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \\g.
Your MySQL connection id is 1
Server version: 5.0.45 Source distribution

Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.

mysql>

Now , let us create a new database and assign a user to this.


  mysql> create database wordpress;

  mysql> grant all privileges on wordpress.\* to wp@localhost identified by 'wp';

  mysql> flush privileges;

  mysql> quit;

 

 

\* At this point, we have created a new database 'wordpress' with a user 'wp' and with password  'wp' assigned to manage this database. Well, not a whole lot secure but a good starting point though.

 

\* Now, you can download WordPress 2.5.1 from here unpack it to /var/apache2/2.2/htdocs - default apache document root directory.

\* Now, copy /var/apache2/2.2/htdocs/wordpress/wp-config-sample.php to /var/apache2/2.2/htdocs/wodpresswp-config.php and edit the first four lines of the file to reflect the just now configured database name , user name and password.

[sriramn@sriram-laptop]: cd /tmp

[sriramn@sriram-laptop]: wget http://wordpress.org/latest.zip 

[sriramn@sriram-laptop]: cd /var/apache2/2.2/htdocs/w 

[sriramn@sriram-laptop]: pfexec  unzip /tmp/wordpress-2.5.1.zip

[sriramn@sriram-laptop]: pfexec cp wordpress/wp-config-sample.php wordpress/wp-config.php

pfexec vi wordpress/wp-config.php and edit this file - first four lines and provide your database name, user name and password . In my case, wordpress/wp-config.php file looks something like 

 
<?php
// \*\* MySQL settings \*\* //
define('DB_NAME', 'wordpress');    // The name of the database
define('DB_USER', 'wp');     // Your MySQL username
define('DB_PASSWORD', 'wp'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
 

\* That's it . you are now ready to host your blog site . You should be able to reach your blog site by accessing http://localhost/wordpress

Simple, huh . Ah , one last thing - If you would like to take this site into production, you might want to enable to APC cache - which is integrated within OpenSolaris Web(AMP) Stack but not enabled as default. You could do this by editing /etc/php5/5.2.4/conf.d/apc.ini and for more APC related settings , please refer here. 

 

Note: Once you enable APC, please remember to  restart Apache service for this change to take into effect

[sriramn@sriram-laptop]: pfexec /usr/sbin/svcadm restart network/http:apache22


Hope, you find this useful. Feel free to ping me back if you have any suggestions or issues. Alternatively, you could visit OpenSolaris forum

Getting Ruby or AMP (Apache, MySQL and PHP) on OpenSolaris 2008.05

Today, Sun officially released a distribution - OpenSolaris 2008.05 based on a 3 year long open source effort happening with Solaris at  Open Solaris web site. You can catch more on this release from here.

Now, if you are web developer interested in figuring out how it is useful to you, here is what you might like

\* Ruby binaries can be downloaded and installed with the single command

   Open a command line terminal window and run the following command

    pfexec pkg install ruby

   Now, you can Ruby specific components by doing some thing like

    pfexec /usr/ruby/1.8/bin/gem install <component name>
 

\* MySQL or PHP developers can get their binaries (again from a command line window) by doing some thing like

    pfexec pkg install amp

    The Apache, PHP and MySQL binaries are available under /usr/apache2 , /usr/php5 and /usr/mysql directories respectively.  The corresponding configuration files are found under /etc/apache2 , /etc/mysql and /etc/php5 directories respectively.

\* Once you have successfully install MySQL or Apache , you will need to initialize the SMF service.  The following command does the initialization job for you. 

    pfexec /usr/sbin/svccfg import /var/svc/manifest/network/http-apache22.xml

    pfexec /usr/sbin/svccfg import /var/svc/manifest/application/database/mysql.xml

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. 

\* Now, you can start these Apache and MySQL services by doing something like

    pfexec /usr/sbin/svcadm enable network/http:apache22

    pfexec /usr/sbin/svcadm enable database/mysql:version_50 

 

Similarly, the way to stop these services, if you need to , you would do 

pfexec /usr/sbin/svcadm disable network/http:apache22

pfexec /usr/sbin/svcadm disable database/mysql:version_50 

 

 \* PHP runtime is configured by default within default Apache Service. So, you should be able to deploy PHP applications by simply writing a PHP application within Web Server document root directory - /var/apache2/2.2/htdocs.

That is all you need to do to get your web site up and running. If you want to do Joomla or MediaWiki, you can simply unpack these tar ball within the web server document root directory (/var/apache2/2.2/htdocs) and hit their index page . This is all you need to get them up and running.

Does this sound simple enough for you to try it out ?

Now, if you need to read more information on this , please check out the Getting Starting Guide from here . Kindly, give OpenSolaris 2008.05 a spin and let us as to what you think and how we can improve it

 



 

Monday Feb 18, 2008

Drupal on Open Solaris

In my previous blog, I mentioned the availability of components like Apache, PHP and MySQL/PostgreSQL within Open Solaris and also how to setup a wiki site like Media Wiki on Open Solaris . So, here is a very much related one - setting up a content management site like Drupal on Open Solaris.

Installing / Configuring Web Stack within Open Solaris

If you haven't already, you might want to download and install Open Solaris Developer Express 01/08

To simplify the initialization and configuration steps required for Apache and MySQL within Open Solaris, engineers within Web Stack project like Ludovic Champenois have done an amazing job of creating a a 'initialize' script so as to successfully setup the Web Stack Environment within couple of minutes. Here is a screen snap shot of the Web Stack Initialize 'script' posted in Ludovic Champenois's Blog

Once the Web Stack 'initialize' script completes successfully, you are now ready to start Web Stack Apache 2 and MySQL service as shown here . This is pretty much all is needed to host your web site and start developing and deploying PHP scripts.

However, to use PHP 5.2.4 database shipped within Open Solaris, we will need this below temporary work around to force PHP runtime to use MySQL 5.0 based client library.

        Open a terminal and become root from your Open Solaris box and run the following command (as a temporary work around)

 

root> ln -sf /usr/mysql/5.0/lib/mysql/libmysqlclient.so.15.0.0  /usr/mysql/5.0/lib/mysql/libmysqlclient.so.12


Note: The above mentioned work around is needed only for Open Solaris Developer Express and Open Solaris Developer Preview 2. This issue has been resolved in recent builds of Open Solaris and this temporary work around is not needed if you are using Nevada build 83 or above.

Installing Drupal

Now, you might want to download the latest version of Drupal from their web site and unpack the downloaded tar ball to Apache 2.2 document root location.

These below commands show how to unpack and set up under Apache 2.2's document root.

root> cd /var/apache2/2.2/htdocs

root> /usr/sfw/bin/gtar zxvf  <location of the downloaded tar ball>

Let us go ahead and create a symbolic link of the unzipped drupal tar ball to a valid name

root> ln -sf drupal-6.0 drupal


Configuring Apache for Drupal

Drupal actively uses '.htaccess' file within its installation. However, default apache configuration file, as part of security measure, has disabled the '.htaccess' file support. So, let us go ahead and create a drupal specific configuration.
   
    Note: We will need to create a drupal specific apache configuration file at '/etc/apache2/2.2/conf.d/drupal.conf' so that Apache can load Drupal specific configuration after system restart as well. So, using a command line terminal window become root so as to save the below contents into /etc/apache2/2.2/conf.d/drupal.conf' as shown here.



root> cat > /etc/apache2/2.2/conf.d/drupal.conf

<Directory /var/apache2/2.2/htdocs/drupal>
   AllowOverride All
   RewriteEngine on
   RewriteBase /drupal
</Directory>

<After pasting the above lines into your terminal window, press CTRL-D to save the above contents into drupal.conf>


Configuring PHP for Drupal

Drupal requires PHP configuration to have support to include the current directory in the include path. So, let us edit the default /etc/php5/5.2.4/php.ini and make the following change

    Open a command line terminal window and edit /etc/php5/5.2.4/php.ini file. Note: You will need to either edit this file as 'root' or use 'pfexec' command to ensure that you have the privilege to edit this file

     Now search for 'include_path = ' in this file and edit this line to reflect like below.  Note: This should be the line that doesn't have ';' in the front.

                include_path = "./:/usr/php5/5.2.4/include/php" 

Finally, restart Apache Service from the command line. This ensures that PHP runtime, loaded within Apache, is now aware of the changes that we just did within the 'php.ini' and 'drupal.conf' file.

 

root> /usr/apache2/2.2/bin/apachectl restart

Configuring MySQL for Drupal

Drupal requires a separate database to be created and available for its use. For more information on how to configure this database, please check out the INSTALL.mysql.txt file found under <drupal installation location> (For example, in our case, the file is under /var/apache2/2.2/htdocs/drupal-6.0/INSTALL.mysql.txt). 

Please note that within Open Solaris, MySQL 5 is located under /usr/mysql/5.0/bin/ directory. You will need to be either as root as login as 'mysql' user to successfully create this database.

Configuring Drupal 

Finally, proceed to configuring Drupal and complete the rest of the Drupal configuration by visiting http://localhost/drupal . For more information on this configuration, also refer to 'INSTALL.txt' file found under /var/apache2/2.2/htdocs/drupal directory. 



Technorati Tags: , , ,

Friday Feb 15, 2008

Hardening PHP applications within Open Solaris

  I thought, you might be interested in knowing that PHP binaries included within Open Solaris, also includes Suhosin , a useful php extension. Hmm... So, if you wonder as to what is Suhosin - please check out from their web site on Why Suhosin and its features.  Note: Currently, PHP runtime / core integrated within Open Solaris is not patched with any patch like Hardening-PHP patch . We are still investigating on the various aspects of this patch. So, if you have any thoughts on the pros and cons of this patch, please write to us.

 

How to enable Suhosin extension within Open Solaris - 

Un-comment the following line within /etc/php5/5.2.4/conf.d/suhosin.ini

;extension=suhosin.so

 

Please note that default configuration should be good enough for most of the customers. If in case, you would like to fine tune or customize your security settings, please visit Suhosin configuration page for more configuration options. You can edit '/var/php5/5.2.4/conf.d/suhosin.ini'  to customize your suhosin setup.

 

Finally, you will need to restart Apache Web Server for this change to take into effect by doing some thing like

svcadm restart network/http:apache22

 

Technorati Tags: ,,,

Sunday Feb 10, 2008

Web Stack File layout

If you are new to Open Solaris and trying to deploy webtier technologies like Apache2, PHP/Ruby with PostgreSQL/MySQL then you might find the file layout of these components to be very different from what you would find on Linux or Windows. So, do check out File Layout section within 'Getting Started Guide' to get a quick walk through of the current file layout of these components.

Now, if you wonder as to why we included the version number of these components and not simply bundle these binaries under /usr/bin as is the case on Linux then here is the motivation - Most of the open source web tier technologies are in active development and these components provide no guaranteed compatibility from one release over the other. Hence, you will notice that the file layout include the version number of these components so as to allow co-existence of multiple versions, if deemed necessary.

Technorati Tags: opensolaris webstack

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