Sriram Natarajan's Weblog

pageicon 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> select 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

 



 

pageicon Wednesday Mar 26, 2008

Issues to consider while hosting multiple web sites within Web Server 7

Typically, businesses have always simply used multiple virtual servers within web servers like Apache or iPlanet / Sun Java System Web Server to host their web sites. However, within Sun Java System Web Server 7, you do have a choice of deciding as to

  • when to create multiple configurations and use one ore more virtual servers within each configuration OR
  • when to use one or more virtual servers within a single configuration and

 

If in case, you wonder as to what is a 'configuration' , check out our 'Understanding Web Server 7 ' link for basic overview on this subject. If in case, you are new to Web Server 7 , here is a thousand feet view on these Web Server 7 terminologies :

 

  • Configuration - Collection of configuration information to host your web site and are managed within Administration Server configuration repository. A 'configuration' can be deployed as an 'instance' to one or more host using Administration Server.  If you deploy this configuration to more than one host, you are asking Web Server 7 Administration Server to manage a cluster for you. These configurations can be edited either through Web Server 7 Administration CLI or GUI. Some of the information contained within a configuration are
    • Information related to site resource information like - number of server threads, I/O buffer size etc
    • Information related to site configuration(s) like - one or more Virtual Server configured within , SSL/non SSL port information etc
    • Information related to site content management like - Web Application(s), WebDAV , ACL, Reverse Proxy etc

 

  • Instance - A configuration when deployed to a host using Administration Server ends up as a physical directory (https-<config>) under your Web Server 7 installation location. This directory becomes the physical representation of your configuration and contain several sub directories ( like 'config' - which holds the actual configuration information for hosting your web site).  Web Server 7 can be started and stopped from this instance. An actual Web Server process (webservd) is associated with every instance.

 

  • Virtual Server - Each virtual server  configured within a configuration need to contain at the minimum a 'site name' and one or more 'port' (default is 80 for non SSL and 443 for SSL) . Sun Java System Web Server 7 requires at least one virtual server to be configured while setting up a web site and supports site content management like Java Web Application or WebDAV to be configured separately for every virtual server. This allows customers to use a single 'configuration' and still have separate 'virtual servers' for their different customers.  

                          For example, a typical hosting company wanting to host multiple web sites within Sun Java System Web Server 7 can simply create multiple virtual servers where in each virtual server is listening in its own IP/Port (both SSL/non SSL) combination and can handle requests from one ore more web sites. For more information , on how to create multiple virtual servers check out 'create-http-listener' and 'create-virtual-server' CLI command and corresponding Using Virtual Servers link within docs. Most of the site content management information (like Java Web Application, Web DAV) is also configurable for every virtual server. This is very straight forward and a very common deployment scenario.

 

Assuming, you now got a whim of these terminologies, here are few issues to consider while hosting multiple web sites within Web Server 7. 

  • Stability - As I mentioned earlier, a single Web Server process for every deployed configuration reads the configuration information and load all the virtual server(s) configured within. This does provide significant savings on your resource. However, if a rogue customer application running within a site (aka 'virtual server' ) can bring down other virtual server(s) as well. So, in that case, you might want to separating these rogue customer applications or web site(s) within their separate configuration. However, Web Server 7 can be configured in run in Multi Process / Multi Threaded mode (on UNIX platforms) and still provide you the stability along with resource savings.

 

  • Resource sharing - As you know by now, Web Server 7 includes an optimized web container for serving any Servlet and JSP based web applications configured within every virtual server. Accordingly, JVM is the heaviest resource within Web Server 7 . Fortunately, this resource is shared across all virtual server(s) configured thus providing a significant savings on your memory foot print . So, if your multiple web site(s) does include / support Java Web Applications (and JDBC resources) , you can share these multiple web site(s) within a single configuration.  On the contrary, if you are running a non Java application (say PHP) within Web Server 7, it might make sense to create a separate configuration and disable Java for this configuration to provide you with resource savings.

 

  • Performance -  Most of the performance optimization procedures mentioned in our Tuning Guide  applies to a configuration and hence applies to all virtual server(s) configured within. However, it is possible that some web site(s) have different load requirements. For example, if a web site does lot of heavy I/O traffic (say huge amount of POST data) and tuning requirement for this web site will be different compared to a typical J2EE shopping web site.  So, if all the web site(s) configured within a configuration share a typical load requirements then you can use multiple virtual server(s) or simply use multiple configuration(s) for sites that has different load requirements.

 

  • Administration - Web Server 7 Administration Server supports clustering out of the box for every configuration created within. So, based on your load, you can leverage the clustering support and scale horizontally. Here are couple of related links on this topic - Clustering in Web Server 7 and Server Farms and Clusters on this topic that you might find it useful. In order to support this feature, Administration Server does maintain its own internal repository of site configuration and content information for every configuration created. So, if you have hundred(s) of virtual server(s) configured thus making the size of "configuration" considerably huge. This might end up in slowing down the time it takes to deploy any configuration changes into one or more hosts. 

 

  • Security - Most of the security topics like Access Control Lists, Request Limiting , DoS Prevention , Authentication  does include support for sharing across entire configurations or few virtual server(s) within a configuration. However, if you have multiple configurations created, you will need to track or implement these security features individually for every configuration / virtual server within.

 

So, If you haven't already , do try out Sun Web Server 7 (free) for your hosting needs and let us know as to what you think. You can always talk to us on our forum (free) or Sun support for any issues or suggestions.

 

 

 

pageicon Sunday Mar 02, 2008

Roll back to previous configuration state with Web Server 7 Update 2

I am sure you are aware that Sun Java System Web Server 7 Update 2 released couple of months back with lot of new features besides regular bug fixes and performance optimizations. Out of these, the one feature that is least documented and the most useful in production environment is the ability to roll back to previous configuration state, if need to. 

If you are a site administrator , I am sure, you will appreciate the ability of an administration server to automatically remember the old configuration state and the ability to restore to an old state with the click of a button. If you wonder, what constitutes a web server configuration - here is a nice documentation. In nutshell, within Sun Java System Web Server 7, a configuration will include information like -

  • Server Host Name
  • Server runtime user name
  • Stores virtual server related information. Virtual Server allows site administrators to run multiple web sites within a single web server.
  • Within each virtual server, you can configure HTTP port(s) (like SSL/non SSL) that the web server must be listening to.
  • Regular site content management information like CGI/FastCGI related configurations, HTTP compression , file cache etc,
  • PHP, Java Web Applications (like Servlet, JSP, JSF and Web Services), if any, that needs to be hosted within each virtual server etc.

Here is how to get to this feature

  • Within Web Server 7 Administration Server CLI, you can use the 'list-backups' to get the list of backups available and use this information to call 'restore-config' with ''--from-backup' option to roll back to previous state.

    Listing the backups

    srirammn@htpasswd$ /sun/webserver7/bin/wadm list-backups --user=admin --config=pkg

    Please enter admin-user-password>
    20080229_183357
    20080229_182946


    Note: The above output that the site administrator (that is me in this case) has made 2 changes at the given time since the initial configuration is created.

    Since any change in the configuration is time stamped, site administrators , in production environment, can simply restore to the old configuration if  any recent change in web applications of any tuning is not giving the right behavior.

    Restoring to the old configuration

    srirammn@htpasswd$ /sun/webserver7/bin/wadm restore-config --user=admin --from-backup=20080229_182946 pkg

    Please enter admin-user-password>

    srirammn@htpasswd$ /sun/webserver7/bin/wadm deploy-config --user=admin pkg

    Please enter admin-user-password>

  • Within Web Server 7 Administration Server GUI - select Edit Configuration option and from there click on General tab and then Restore sub tab to get to this feature as shown below.

 

 Restore-configurations

 

 

Technorati Tags: ,,,
pageicon Tuesday Feb 19, 2008

How to install Apache, PHP and MySQL 5 within Indiana (Open Solaris Developer Preview)

Couple of days back, Open Solaris Developer Preview 2, was released to the general public. I am told that this preview (aka beta) release is based on the same milestone build (Nevada build 79b) that Open Solaris Developer Express 01/08 was released with. So, naturally I got curious and tried it out on my laptop and here is my feedback

  • On the positive side - Installation experience is very smooth. Also, fonts look sharp and even wireless on my laptop works out of the box as well.
  • On the not so positive side -  Web Stack components like Apache, PHP and MySQL are not installed as part of default install.  So, one will need to manually download and install / configure these components.  Now, the tricky part is knowing the exact name of these packages to download as the current Indiana 'pkg' command is unable to search  by common names like 'apache' or 'php' etc.

After some poking around, I found the list of additional packages available at Indiana repository and from then, it was a breeze to find the right instructions to download and configure these components.  Thought, I would share my experience here.  So, here in this blog, I will go through the list of steps needed to configure a Web Stack (Apache , PHP and MySQL) stack on my Solaris Developer Preview (aka Indiana).

- Using a 'terminal' window, download and install Web Stack components like Apache , PHP and MySQL as shown below.  Note, You will need to have a  high speed internet connection to download and install these packages.

If you are curious as to what we what are we doing here - here is a brief explanation

sriramn@sriram-laptop2:~$  pfexec pkg  install SUNWapch22 SUNWphp524core SUNWphp524usr SUNWmysql5 SUNWapch22m-php5 SUNWphp524-mysql

pfexec - a command that integrates with Solaris RBAC and allows us to run a privileged command provided we have the authorization to do so.  For example, installing a software is a privileged operation and a default user in Open Solaris Developer Preview is provided with this authorization.

pkg - new package command that can download and install specified packages from Indiana package repository.

SUNWapch22 - Apache 2.2

SUNWphp524core SUNWphp524usr -> PHP 5.2.4 core runtime and its dependent header files.

SUNWmysql5  - MySQL 5.0 database core runtime files.

SUNWapch22m-php5 - Glue to bond PHP 5.2.4 runtime within Apache

SUNWphp524-mysql  - Glue to bond PHP 5.2.4 runtime with MySQL database.

For Developer Preview 2 (aka beta) release,  I guess, we need to provide these correct package names to the 'pkg' command. Hopefully, going forward , with subsequent releases, we should be able to get the following command working

pfexec pkg install apache php mysql

Configuring MySQL for Indiana

Though, the above command successfully installed the MySQL database, there are still some some post installation steps necessary. Unlike Solaris Developer Express, where these below steps are automatically done for us, within Solaris Developer Preview 2, we will need to perform the following manual configuration to successfully configure MySQL database within Indiana.  Again, I am hoping that with Developer Preview 3, these steps should no longer be needed.

  • Create MySQL user and group and allocate MySQL data directory '/var/mysql' to this user for security purposes

 

sriramn@sriram-laptop2:~$  pfexec groupadd -g mysql

sriramn@sriram-laptop2:~$  pfexec useradd -d /var/mysql -m -g mysql mysql

sriramn@sriram-laptop2:~$  pfexec chown mysql:mysql /var/mysql

sriramn@sriram-laptop2:~$  pfexec chmod 750 /var/mysql /var/mysql/data

  • Now, let us initialize MySQL database and try to start the server. 

 

sriramn@sriram-laptop2:~$  pfexec su - mysql

sriramn@sriram-laptop2:~$  pfexec /usr/mysql/5.0/bin/mysql_install_db --user=mysql

sriramn@sriram-laptop2:~$  pfexec /usr/mysql/5.0/bin/mysqld_safe &

sriramn@sriram-laptop2:~$  pfexec /usr/mysql/5.0/bin/mysqladmin -u root  password '<provide a password to protect the MySQL database for the 'administrator account'>

 

Yup - this is all should be required to run Apache , MySQL and PHP within Indiana. With this pre configuration, you should be now ready to deploy either a wiki site like Media Wiki  on Indiana or a content management site like Drupal on Indiana  just as you would with SXDE 01/08.

Technorati Tags: ,,

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: , , ,
pageicon 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: ,,,
pageicon 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

pageicon Thursday Feb 07, 2008

So many ways to get Open Solaris...

If you are new to Open Solaris community, you might want to check out the different distributions available here.  Out of these different distributions, Open Solaris Community Express, Open Solaris Developer Express and Open Solaris Developer Preview  is released from Open Solaris community while the rest of the distributions seems to be developed by third party or volunteers. Here is quick 2 minute run down on these different distributions as I understand it -

 

Open Solaris Developer Preview  - Internal code name for this project is 'Indiana' .  It is still in 'beta'  and its goal seems to be to simplify the Open Solaris installation experience and provide a LiveCD of the OS as well.  The promising feature in this distribution is that it touts a new 'packaging' system known as 'Image Packaging System' that allows users like us to get updates and new packages on regular basis. Af course, in Linux world, folks has been using 'Yum' or 'apt-get' for quite some time now. However, for Open Solaris community , this is probably one of the most wanted features for quite some time now.

 

Open Solaris Community Express -  Unsupported binary release of Open Solaris source code. This release happens almost biweekly.  With every release, the milestone's build number is increased. If you would like to get the latest and greatest Open Solaris snapshot, then this is the way to go. Here is a quick link of the different features that have been integrated with every milestone build. Typically, if I like to try out a feature then I download the appropriate milestone build.

 

Open Solaris Developer Express - Well tested and stable snap shot of the Open Solaris Community Express translates into a Open Solaris Developer Express release. This release happens once in every 3-4 months. You can download and use it for free. Also, if you would like to run it on your production system, you can buy support for this release from Sun 

 

Unless you are seasoned veteran within Open Solaris world, Open Solaris Developer Express  is the best way to get your hands on it.

 

 

 

 

Technorati Tags:

 

pageicon Tuesday Feb 05, 2008

Deploying MediaWiki on OpenSolaris (Developer Express)

As I mentioned earlier, Apache 2.2, MySQL and PHP has now been integrated within Open Solaris. If you haven't already, check out Solaris Developer Express 01/08 and let us know with your comments.

Here is a step by step instruction on how to deploy a Web 2.0 site like MediaWiki on Open Solaris using Apache 2.2, MySQL 5.0 and PHP 5.2.4 . Probably, for the first time in Solaris history, we can now deploy a Web 2.0 site in such a short time. 

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 has 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 to use MySQL 5.0 based client library. Note: Going forward, PHP build process has been modified to look for MySQL 5.0 based client libraries as well.

  • Open a terminal and become root from your Open Solaris box
  • 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

Now, you will need to download MediaWiki tar ball from here and unpack the downloaded tar ball to Apache 2.2 document root location. Now, let us follow the instructions on how to configure MediaWiki as mentioned under 'Installation Instructions' within MediaWiki web site.

  • 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 media wiki tar ball to a valid name

    root> ln -sf mediawiki-1.11.1 mediawiki

     

    Finally, proceed to configuring MediaWiki and complete the rest of the MediaWiki configuration by visiting http://localhost/medawiki as mentioned under 'Further Configuration' section within MediaWiki web site. 

    Technorati Tags: webstack,opensolaris,mysql,php,mediawiki

    P in SAMP stack is now part of Open Solaris

    In addition to my day time job with  Sun Web Server 7 development,  I have recently got myself involved with Web Stack project that is responsible for integrating / improving the open source web tier technologies like PHP for Open Solaris.  As part of this project, we have now successfully integrated  PHP(version 5.2.4) with Open Solaris (Nevada) build 79b - aka known as Solaris Developer Express 01/08.  Finally, with SXDE 01/08, I believe that we are now one step closer to facilitate our customers choose SAMP stack for their development and production requirements.

    So, what is cool with this integration ? -

    • Includes tighter and built-in support for Apache 2 pre-fork MPM
      • Simply enabling Apache 2 SMF service is all is now required for developing PHP applications with your Web Server
      • For example
        • svcadm enable network/http:apache22
    • tighter integration with PHP NetBeans IDE and also includes popular 3rd party PHP extensions like APC, XDebug and DTrace
    • Includes out of the box support for commonly used PHP extensions like LDAP, SSL, SOAP, JSON, MySQL, PostgreSQL, PDO, XML, Zlib
    • PHP is compiled with Sun Studio compiler and includes necessary compiler optimizations to derive the best performance on Solaris.

     

    And what is not so cool ...

    • With the current integration, popular PHP extensions like IMAP, MCrypt are still missing. We are very hopeful of  integrating the currently missing PHP extensions integrations , in the order of user popularity, in the next coming months.
    • We all know that Open Solaris Developer Express 01/08 includes MySQL 5.0 database as well. However, due to a build issue, PHP is still looking for MySQL 4.0 client libraries instead of the default MySQL 5.0 client libraries. This issue is now resolved with Nevada build 83.  So, for now, here is a temporary work around to work around this issue
      • Open a terminal and become root from your Open Solaris box
      • Run the following command
      • ln -sf  /usr/mysql/5.0/lib/mysql/libmysqlclient.so.15.0.0 /usr/mysql/5.0/lib/mysql/libmysqlclient.so.12

     

    We very much want to hear your thoughts on what we did right and how we can improve. So, please consider joining Web Stack discussion forum.

    If this interests you, do give Solaris Developer Express 01/08 a spin and let us know. Instead of a stable build, if you would prefer to try out the latest and greatest, you can also check out - Open Solaris Community Express - (recent milestone build) . 

    Technorati Tags: ,,

    pageicon Friday Jan 18, 2008

    Web Server 7 Update 2 64-bit for Linux

    Recently released - Web Server 7 Update 2, includes a bunch of  fixes cum new features besides support for 64-bit Linux platform. Unlike Solaris, Linux has the convention to release 64-bit platform as a separate distribution. So, we have kept up with the tradition and released Web Server 7 64-bit for Linux as a separate distribution. Do remember to select the appropriate platform at the time of download and send us your feedback.

    If in case, you didn't hear already - the major theme for Web Server 7 Update 2 is performance enhancement . Accordingly, features like Asynchronous Accelerator Cache Support and optimizations within our Web Container have been integrated in this release. These features were used for  publishing SPECweb2005 world record on Performance and Efficiency using Sun SPARC Enterprise T5220 server.

    All these performance enhancements can be benefited on other platforms like Linux and Windows as well. However, on Linux - default file descriptor size per process is too low and because of this, you might run into 'Too Few Threads' issue when the server is under load. This issue is mentioned as 6639402 under Known Issues section. To address this issue, please use 'perfdump' to monitor the server and appropriately increase the web server request processing threads value.

    Do check out our latest release and as always , if you run into any issue, ping us at our Web Server forum for free !

    pageicon Saturday Nov 03, 2007

    Deploying PHP (from Cool Stack 1.2) with Sun Web Server 7


    I am sure, some of you already used Cool Stack for  deploying your web application on Solaris. . If you haven't , then you might be very interested in knowing that Sun's Cool Stack highly optimizes various open source components like Apache 2, PHP5, Ruby, Light HTTPd so that these components can perform optimally on Solaris 10 or greater. Cool Stack engineering team has just released their latest release - Cool Stack 1.2 . If you would like to leverage the benefits of Solaris 10 and deploy your web applications (AMP stack) on Solaris, then kindly check out  Cool Stack 1.2 release from their web site.

    I personally like PHP5 runtime bundled with Cool Stack 1.2 as it now includes FastCGI support besides having the ability to work with whole lot of databases like Oracle, MySQL, PostgreSQL etc.  Now, having FastCGI support within PHP5 runtime allows PHP applications to be deployed on top of web servers like Sun Java System Web Server 7 or with Apache 2 worker MPM.

    Because of my involvment with Sun's Web Server 7 engineering , naturally I am very interested in finding out how to help our customers deploy their PHP application on top of Web Server 7 using Cool Stack's PHP runtime.  This way, customers can enjoy the performance benefit of using the highly scalable Web Server 7 with optimized Cool Stack PHP5 for their PHP based applications.


    Here is a quick run through on the steps involved in deploying the Cool Stack's PHP runtime within Sun Java System Web Server 7

    Installing and Configuring Web Server 7


    -  If you haven't already, you can download and deploy Web Server 7 for free from here. You might also be interested in checking out the 'What's new in this release' to find out more about how this high performing and enterprise ready Web Server . Here is a useful  Screencast (if you would like to) and Getting Started guide.

    - Now, me being a command line person, I am leveraging Web Server 7 Administration server's command line interface here. If command line is not your cup of tea, you can also use the administration GUI  (browser based) to do these steps.

    Note: This below step is very much optional. Web Server 7 installation provides you with a default configuration. You can choose to use the already existing configuration, if you prefer so.

    Let us start the Administration Server and create a new configuration cum instance here. For testing purposes, in this example, I am creating a new configuration to run this server at port 8080 on my local machine(sriramn)

    /sun/webserver7> admin-server/bin/startserv

    /sun/webserver7> bin/wadm create-config --user=admin  --http-port=8080 --server-name=sriramn.red.iplanet.com coolstack

    /sun/webserver7> bin/wadm create-instance --user=admin  --config=coolstack sriramn.red.iplanet.com


    Installing Cool Stack 1.2


    - You will need to visit either Sun's Cool Stack web page or download the Cool Stack 1.2 release from here. (You will need to login Sun's Online Account to successfully download Cool Stack 1.2 release).

    - In their downloads web page, you will need to select and download "Core Libraries (CSKruntime package)" and "Apache / PHP5 (CSKamp)" components.

    Note: To successfully install Apache/PHP5 package on your system , you will need to download and install "Core Libraries(CSKruntime)" component as well. (Unfortunately, the downloads web page does not mention this information before hand. )

    - Unzip the downloaded packages by doing some thing like

    bunzip2 -f CSKruntime_1.2_sparc.pkg.gz
    bunzip2 -f CSKamp_1.2_sparc.pkg.gz

    Note: If you are using Solaris on Intel / AMD hardware, then you will need to download the "x86" version of these packages and accordingly the downloaded files will be 'CSKruntime_1.2_x86.pkg.bz2' and 'CSKamp_1.2_x86.pkg.bz2'

    - You will need to become 'root' and install these packages by doing something like

    For Solaris SPARC hardware

    pkgadd  -d CSKruntime_1.2_sparc.pkg
    pkgadd -d CSKamp_1.2_sparc.pkg

    For Solaris x86 hardware:

    pkgadd  -d CSKruntime_1.2_x86.pkg ( if you are using SolarisCSKruntime_1.2_x86.pkg if you are on Solaris x86)
    pkgadd -d CSKamp_1.2_x86.pkg

    Configuring Cool Stack 1.2 PHP with Web Server 7


    - Once the package installs successfully, you could change your current directory and go to Cool Stack PHP5 installation location by doing some thing like 'cd /opt/coolstack/php5' on the command line.

    - Within the Cool Stack 1.2 PHP5 installation location '/opt/coolstack/php5' , you should find a script with the name 'setup-ws7-php.sh'.   Now, run this script by doing some thing like
    ./setup-ws7-php.sh

    and you should see a message box like this


    Usage:

    This script will configure Coolstack PHP with Sun Java System Web Server 7
    Here, you will need to provide the top level location of your Web Server 7
    installation and your Web Server 7 instance_name name to which this script
    should configure to run PHP scripts.

    Enter your Web Server installation location(/sun/webserver7) :


    - Follow the setup by providing the appropriate Web Server 7 installation location on your system. Obviously, this needs to refer to the location where you installed Web Server 7.

    - Later, this script will require you to provide you with an Web Server instance name .Web Server instance name translates to a directory under your installation location containing all the necessary configuration file necessary for running your web site. If you are using Java Enterprise System 5 based Web Server, then your instances will be under /var/opt/SUNWwbsvr7. 

    - In our example, we will use the instance name 'https-coolstack' that was created using Web Server 7 Administration CLI at the beginning. If in case, you want to PHP enable a different instance, you can choose to provide another valid instance name here. The instance name that you provided to this script is now PHP enabled and now you can use Cool Stack 1.2 PHP within Web Server 7.

    - Now, you should be able to start the Web Server 7 by doing some thing like

    /sun/webserver7/https-coolstack/bin/startserv

    - In our case, we are now ready to create sample php files under /sun/webserver7/https-coolstack/docs


    Kindly give it a spin and let us know what you think and how we can improve and thanks a bunch for reading !

    pageicon Saturday Oct 27, 2007

    Web Server 7's world record results finally shows up SPECweb'2005 web site

    It has been almost a month since Sun announced a world record on SPECweb'2005 benchmark using Sun SPARC T5200 hardware server and Sun Java System Web Server 7 Update 2. Since then , I have been wishing to compare our results with HP's ProLiant DL 580 server. Well, the results have finally shown up in SPEC's web site. Boy, am I not glad to see these results. You can checkout the results for yourselves and draw your own conclusions :-)

    pageicon Wednesday Oct 24, 2007

    How to setup FCKeditor web application within Web Server 7

    Some one asked a question in our forum today as how to configure FCKeditor within Web Server. Now, if  you are wondering as to what is FCKeditor - FCKeditor is an open source WYSIWYG text editor that can be used within web pages and you can check out a demo from FCKeditor's web site.

    Here, I will show how to leverage the JSP integration plugin that comes with FCKeditor and deploy it as a Java web application so that web programmers can simply invoke this nice WYSIWYG text editor within their JSP / JSTL pages without the complexity of using a Java scriptlets or the JavaScript API.

    Okay, here we go -

    - If you haven't already, you can download and install Sun Web Server 7 from here

    - Now, me being a command line person, I am leveraging Web Server 7 Administration server's command line interface here. If command line is not your cup of tea, you can also use the administration GUI  (browser based) to do these steps.

    Note: This below step is very much optional. Web Server 7 installation provides you with a default configuration. You can choose to use the already existing configuration, if you prefer so.

    Let us start the Administration Server and create a new configuration cum instance here. For testing purposes, in this example, I am creating a new configuration to run this server at port 80 on my local machine(sriramn)

    C:\Program Files\Sun\WebServer7> admin-server\bin\startserv.bat

    C:\Program Files\Sun\WebServer7> bin\wadm create-config --user=admin  --http-port=80 --server-name=sriramn.red.iplanet.com fckeditor

    C:\Program Files\Sun\WebServer7> bin\wadm create-instance --user=admin  --config=fckeditor sriramn.red.iplanet.com

    - Download the latest version of FCKeditor JSP Integration Pack from following this URL:
    http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=129511

    - Now, create and change to a new directory 'FCKeditor' in your system (say C:\FCKeditor in my case) and use an appropriate tool to unzip the downloaded JSP Integration Pack from the following URL:

    mkdir C:\FCKeditor

    cd  C:\FCKeditor

    unzip c:\downloads\FCKeditor-2.3.zip

    Moving on - FCKeditor JSP Integration Pack that we just unzipped in C:\FCKeditor, doesn't include the core of the editor. So, we will need to download the core FCKeditor (written using JavaScript) from the following URL:
    http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=75845

     So, download and unpack the content of the FCKeditor core files from the above URL inside "FCKeditor\web" folder.

    cd  C:\FCKeditor\web

    unzip C:\downloads\FCKeditor_2.5b.zip 

    The FCKeditor core zip file that we just unpacked under C:\FCKeditor\web creates another FCKeditor directory underneath containing the core files within 'editor' subdirectory. Since, we are interested only in this 'editor' subdirectory from this FCKeditor core zip file, let us move this 'editor' sub directory to JSP Integration Pack location (C:\FCKeditor\web in my case).

    cd C:\FCKeditor\web\FCKeditor

    move editor C:\FCKeditor\web

    Now, we will have to simply use Web Server 7 Administration Server to deploy this C:\FCKeditor\web as as web application within Web Server 7 with context root as 'FCKeditor' . Finally, start this server instance 'https-fckeditor' and point your browser to http://hostname/FCKeditor/_samples/index.jsp for the list of the samples.   

    C:\Program Files\Sun\WebServer7>bin\wadm add-webapp --user=admin --uri=/FCKeditor --vs=fckeditor --file-on-server --config=fckeditor --directory=c:/FCKeditor/web c:\FCKeditor\web

    C:\Program Files\Sun\WebServer7>bin\wadm deploy-config --user=admin fckeditor

    C:\Program Files\Sun\WebServer7>bin\wadm start-instance --config=fckeditor sriramn.red.iplanet.com

    Now, if you are a web programmer wondering for some tips on how to use this rich HTML text editor within your web page, please check out the FCKeditor's Developer Guide.

    Please try it out and tell us what you think .


    « May 2008
    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
    31
           
    Today

    Feeds

    Search this blog

    Links

    Weblog menu

    Today's referrers

    Today's Page Hits: 285