Wednesday Jun 23, 2010

Deploying PHP with FastCGI and OCI8 extension for iPlanet Web Server 7

Well, some one recently asked in our forums to how to get PHP working with Oracle iPlanet Web Server and Oracle Database. So, here is a quick write up on how I got this done:

First, let us download Oracle Instant Client package - Basic and Oracle Instant Client package - SDK Client for your respective platform from here . I am assuming here that I have downloaded and unzipped this file in my home directory.

    [sriramn@sriramn:~:$] unzip instantclient-basic-linux32-11.2.0.1.zip

    [sriramn@sriramn:~:$] unzip instantclient-sdk-linux32-11.2.0.1.zip

When I uncompressed this client library, I noticed that Oracle Client library is missing a symbolic link. Not sure, if this is a deliberate or a simple overlook from our Oracle Instant Client team. In any case, we will need create a missing symbolic link so that PHP is able to build with this Instant Client library.

    [sriramn@sriramn:~:$] cd instantclient_11_2

    [sriramn@sriramn:~/instantclient_11_2:$] ln -sf libclntsh.so.11.1 libclntsh.soNow, let us download PHP from php.net and try to compile with PHP/FastCGI support as shown below:

Now that we have got Oracle Instant Client downloaded and set up nicely let us go ahead and download PHP from here. Here, I am trying to download and use PHP 5.2. However, if you wanted to use PHP 5.3, you could do the same as well :

    [sriramn@sriramn:~:$] tar jxvfp php-5.2.13.tar.bz2

    [sriramn@sriramn:php-5.2.13:$] cd php-5.2.13

    [sriramn@sriramn:php-5.2.13:$] ./configure --prefix=~/php-52 --enable-fastcgi --enable-force-cgi-redirect --with-oci8=instantclient,~/instantclient_11_2 && gmake && gmake install

    Finally, to configure Oracle iPlanet Web Server 7 with PHP, you will need to download Oracle iPlanet Web Server 7 from hereand install . Please refer to this screencast, if you need help in installation. Once the installation is completed, let us run the following commands to successfully configure and run PHP scripts within Oracle iPlanet Web Server 7.

    [sriramn@sriramn:~:$] cd ~/sun/webserver7

    Ensure that Oracle iPlanet Web Server's Administration Server is running :

    [sriramn@sriramn:webserver7:$]./admin-server/bin/startserv

    Now, let us create a new configuration within Web Server 7. For more understanding on what is a configuration, please refer to our documentation in here.  

    You will need to provide the appropriate hostname of your machine for --server-name= argument

    [sriramn@sriramn:webserver7:$] ./bin/wadm create-config --user=admin --http-port=80 --server-name=sriramn php

    Considering that I plan to only use to PHP within this configuration, I have disabled the bundled Web Container . It is up to you to decide what will be your requirements.  

    [sriramn@sriramn:webserver7:$] ./bin/wadm disable-java --user=admin --config=php

    Now, let us configure PHP as FastCGI . Here, you will need to change appropriately to reflect your PHP location. This setup is expecting your php.ini to reside under your PHP installation directory/lib/php directory. 

    [sriramn@sriramn:webserver7:$] ./bin/wadm create-mime-type --user=admin --config=php-cgi --extensions=php,php4,php5 --vs=php-cgi magnus-internal/php

    [sriramn@sriramn:webserver7:$] ./bin/wadm create-fastcgi-handler --user=admin --config=php-cgi --vs=php-cgi --mime-type=magnus-internal/php --role=responder --app-path="/home/sriramn/php-52/bin/php-cgi" --app-env="PHPRC=/home/sriramn/php-52/lib/php" --app-env="LD_LIBRARY_PATH=/home/sriramn/php-52/lib/php"

    # Finally, deploy this configuration to create an instance and followed by starting it. 

    [sriramn@sriramn:webserver7:$] ./bin/wadm create-instance --config=php sriramn

    [sriramn@sriramn:webserver7:$] ./bin/wadm start-instance --config=php sriramn

Now you will need to edit your PHP.ini to provide your Oracle Database connectivity information to connect to Oracle Database from PHP running as FastCGI within Oracle iPlanet Web Server.

Saturday Jun 19, 2010

Sun Java System Web Server has yet another name..

Since I joined Sun Web Server engineering team, this product has gone through couple of name changes - mostly to be in sync with company's business directions. Here is a quick snapshot of the different forms that it took over the years..

Netscape Enterprise Server (3.6, 4.0, 4.1)

    -> iPlanet Enterprise Web Server (6.0) ->

       -> Sun ONE Web Server 6.1

         -> Sun Java System Web Server 6.1, 7.0

            -> Sun GlassFish Enterprise Web Server 7

Now, Oracle after its acquisition of Sun, has decided to complete the product naming circle one more time and call us now as "Oracle iPlanet Web Server". So, let us hope this name will stick a little longer than all its predecessors.

Tuesday Feb 02, 2010

Web Server 7 Update 8 addresses critical Security Issues

Recently, Sun published Sun Alert for recently discovered security vulnerability within Sun Web Server and immediately released updates to Web Server 7 and Web Server 6.1 release train to address these discovered vulnerabilities. 

If you are running Sun Java System / iPlanet / Sun ONE Web Server, we strongly urge to upgrade to this latest update. 

Thursday Dec 17, 2009

Web Server 7 Update 7 is available now..

As a nice farewell for 2009, Web Server 7 engineering team announced the availability of Sun Web Server 7 Update 7 today. Web Server 7 Update 7 provides the following features / updates besides regular bug fixes.. For more information on this release, check out Release Notes . Here are some key features of this update:

  • Web Server 7.0 Update 7 introduces Kerberos/SPNEGO support.
  • Web Server 7.0 Update 7 supports Windows 2008 SP2 32 bit (x86) Enterprise Edition.
  • Web Server 7.0 Update 7 is integrated with NSS 3.12.5 which provides relief for the SSL/TLS renegotiation vulnerability (CVE-2009-3555) . Please refer to Jyri's blog on Web Server 7 and TLS vulnerability to learn more on this. 
  • Web Server 7 Update 7 now bundles Sun JDK 7 Update 17 on Solaris, Linux and Windows.

Saturday Aug 22, 2009

Sun Web Server: The Essential Guide

If you are one of those geeky folks using Sun Web Server (also known as Sun Java System Web Server , Sun ONE Web Server, iPlanet Web Server, Netscape Enterprise Server - Hmm... lot of incarnations) in your enterprise server with multiple cluster deployment or simply running a secure web server from your garage, you should be pleased to know that Amazon is now carrying this title  Sun Web Server: The Essential Guide . Ah, you know, what is more cool - Amazon Kindle carries this title as well. If you are one of those lucky few having a Kindle, you can get this instantly (ok, not that instant - probably in under 2 minutes) from here .

We love to hear what you think of this book. Please feel free to write to us at our Forum

Wednesday Aug 05, 2009

A simple way to get PHP working within Sun Web Server 7 on Solaris / RHEL

Some time back, I wrote this blog on how to leverage the PHP runtime integrated within OpenSolaris and use it to run PHP applications within Sun Java System Web Server 7. Well, if you are currently using Sun Web Server 7 on Solaris 10 or RedHat / CentOS Linux and wondering if there is a more simplified way to get PHP working within Sun Web Server 7, then my today's topic might be of more use to you.

Installing Sun Web Server

Now, if you are new to Sun Web Server 7 and wonder why you need this beast, please do check out some of these  performance benchmark blogs within our wiki. You can download and install the latest version of Sun Java System Web Server from here .

If you are adventurous, you can also build the open sourced version of this beast (available under BSD license) by following the instructions provided here

If you would like a little hand holding in installing our product, check out this nice demo . Hope, you are able to successfully install Sun Web Server 7 with the help of this demo. If not, you can always post your questions in our forums - where we developers will be happy to help you out !.

Installing Sun GlassFish Web Stack PHP

If you haven't yet heard of Sun Web Stack or more confusingly known as Sun GlassFish Web Stack - is an open source project within OpenSolaris - known as  Web Stack project - offers free download and production support (as part of Sun GlassFish Portfolio) for open source web tier components like Apache Web Server, PHPMySQL, Tomcat, Hudson etc on Solaris 10 Update 5 (or above) and RedHat Enterprise Linux 5.2 (or above).

Here is a quick way to get Web Stack PHP installed on your Solaris 10 or RHEL 5. If you prefer a little hand holding, please refer to my earlier blog on the different ways to install Sun Web Stack (along with some screenshots to guide you along the way).

Here is a quick walk through on how to get your PHP runtime installed

  • Visit our Sun Web Stack 1.5 download web page and download 'click on IPS based Packaging' link for your respective OS.
  • Now, you will need to unzip the downloaded tar ball and either fire up the update tool GUI for installing PHP runtime (as shown in this blog) or simply install it in the command line as shown below:

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

sriramn@sriramn:~$ cd webstack1.5

sriramn@sriramn:~/webstack1.5$ ./pkg/bin/pkg install sun-php52 sun-php52-apc

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

Note: If you are interested in other PHP optional packages like PHP MySQL connector or MySQL community package etc, you could get the list of packages available either from GUI or CLI. From CLI, you could do some thing like as shown below

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


Note:  Unlike OS native packages, IPS based installation (that you just did here) 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.

How to get Web Stack PHP working within Sun Web Server 7 ?

Ok, Assuming you have successfully installed Web Server 7 and Sun Web Stack PHP on your system, here is a simple one liner configuration script that you can run to successfully configure Web Server 7 to execute PHP scripts .


sriramn@sriramn:~/webstack1.5$ ./php/5.2/samples/scripts/configure-sun-webserver --installroot=/home/sriramn/ws7 --instancename=https-<hostname>


Note: On Linux, because of a bug with the above script, please download this script and overwrite it over the default.

cp /tmp/configure-sun-webserver ~/webstack1.5/php/5.2/samples/scripts/

That is all there to it.

Now, you should be able to run php scripts under your web server's document root directory (which is typically <ws7-install-root>/https-<hostname>/docs/).

Note: In the above example, I have assumed that you will be installing both Web Server 7 and Web Stack PHP as the same user and you wanted to configure PHP runtime with the default instance (https-<hostname>) created by Web Server 7 installer. If in case, you would like to configure a separate instance for Web Server 7 then you could do the same either using Web Server 7 Administration CLI /GUI.  Here is a simple example of how to do so with CLI :



sriramn@sriramn:~/webserver7$ ./bin/wadm create-config --user=admin --http-port=80 --server-name=<ń•ostname> php

sriramn@sriramn:~/webserver7$ ./bin/wadm disable-java --user=admin --config=php

sriramn@sriramn:~/webserver7$ ./bin/wadm create-instance --config=php <hostname.domainname>

sriramn@sriramn:~/webserver7$ ~/webstack1.5/php/5.2/samples/scripts/configure-sun-webserver --installroot=~/webserver7 --instancename=https-php

Friday Mar 27, 2009

Configuring Sun Web Server 7 with PHP runtime in OpenSolaris

With upcoming release of OpenSolaris 2009.06 (more specifically with Indiana build 110 or above), PHP runtime has been updated to the latest 5.2.9 release. Also, we have integrated a configuration script to simplify the steps required to configure PHP runtime with Sun Java System Web Server 7 (formerly known as Sun ONE/iPlanet Enterprise Server). Thought, I would you walk through the steps involved here

Installing PHP 5.2.9 in OpenSolaris 2009.06 (preview build)

Check out my earlier blog on how to get PHP 5.2.9 runtime within OpenSolaris 2009.06 on your system.

Installing Sun Web Server 7

Now, if you are new to Sun Web Server 7 and wonder why you need this beast, please do check out our performance benchmarks. You can download and install the latest version of Sun Java System Web Server from here .

If you are adventurous, you can also build the open sourced version of this beast (available under BSD license) by following the instructions provided here

If you would like a little hand holding in installing our product, check out this nice demo . Hope, you are able to successfully install Sun Web Server 7 with the help of this demo. If not, you can always post your questions in our forums - where we developers will be happy to help you out !.

Note1: You will need to install Java development environment within your OpenSolaris before proceeding to install Sun Web Server 7 on OpenSolaris . You could do this by running the following command from the command line window

sriramn@sriramn:~> pfexec pkg install java-dev

Note2:  You will need to perform Web Server installation as 'root' (or use pfexec ./setup)  and choose Web Server runtime user as 'webservd'. Please check out this  blog   for more information on installing Web Server 7 on OpenSolaris.

Finally, let us hook up PHP runtime within Sun Web Server 7. To do this, run the following script (which is newly available from OpenSolaris 2009.06 preview build 110 or above)

sriramn@sriramn:~> pfexec /usr/php/5.2/samples/scripts/configure-sun-webserver --installroot=/sun/webserver7 --instancename=https-sriramn

  \* where /sun/webserver7 is the location of the Web Server 7 top level installation location. Provide the appropriate location as in your case.

  \* and https-sriramn -> is the instance created under this installation. The instance name is typically the name of your hostname. You need to provide the appropriate value here.

Now, you will need to restart the Web Server 7 instance by running these below commands so that the newly modified changes can be loaded.

sriramn@sriramn:~> /sun/webserver7/https-sriramn/bin/stopserv
sriramn@sriramn:~> /sun/webserver7/https-sriramn/bin/startserv

Sun Web Server 7 is now ready to serve any PHP pages within its document root. For example, to deploy Joomla or Drupal, all you need to do is unpack these application tar balls under  /sun/webserver7/https-sriramn/docs/ and point your browser to http://localhost/joomla etc.

Now, you could write few PHP script within Web Server document root directory (<install-root>/<instance-name>/docs) and test our your configurations. If you are satisfied then we now need to move to the final step.  Web Server 7 Administration server need to be told of what we just did. This is accomplished easily by running these following CLI commands

sriramn@sriramn:~> pfexec chown webservd:webservd /sun/webserver7/https-\*/config/\*obj.conf

sriramn@sriramn:~> /sun/webserver7/bin/wadm pull-config --user=admin --config=sriramn sriramn.sun.com

where --config=<sriramn> will typically be the hostname of your machine or whatever configuration name that you chose

and

sriramn.sun.com is the fully qualified hostname (hostname.domainname) of your machine. Provide your corresponding hostname here.

Note: Web Server 7 integrates a Java web container within its default server instance. Having an integrated web container will  allow you to deploy Java Web Applications like JSP, Servlet etc. Hence, Sun Web Server has to load Java runtime as part of server startup - eating your previous CPU and memory resource. Now, if you plan on using only PHP runtme, you can easily disable Java Web Container by running he following commands :

sriramn@sriramn:~> /sun/webserver7/bin/wadm disable-java --user=admin --config=sriramn sriramn.sun.com

sriramn@sriramn:~> /sun/webserver7/bin/wadm deploy-config --user=admin  sriramn.sun.com

again where --config=<sriramn> will typically be the hostname of your machine or whatever configuration name that you chose

and

sriramn.sun.com is the fully qualified hostname (hostname.domainname) of your machine. Provide your corresponding hostname here.

Hope you will like our simplified integration and let us know with your feedback at our forum.

Wednesday Feb 04, 2009

NetBeans 6.5 includes plugin for Sun Java System Web Server 7

NetBeans 6.5 is an awesome release. Since then, I have been eagerly awaiting for Web Server 7 plugin within NetBeans 6.5 so that I can directly deploy my web applications on to  Sun Java System Web Server 7 through NetBeans IDE itself.  Today, I was pleasantly surprised to see an email from my colleague confirming that NetBeans plugin for Sun Java System Web Server 7 has been updated to support NetBeans 6.5 !!!.  Cool. 

If you use NetBeans and Web Server 7 for your web application development then you can download this plugin by selecting Tools -> Plugins and then clicking on Available Plugins tab. 

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.

Wednesday Jul 23, 2008

Sun announces open sourcing of its premier Web Server product line...

I am excited to share the good news that Sun today announced its decision to open source the core kernel of Sun Java System Web Server under BSD license

If you wonder as to  why are we doing this  , here are the top reasons that come to my mind.

  • Sun's new found open source love !!!  The recently open sourced products from Sun like OpenJDK, OpenSolaris, Netbeans, GlassFish to name a few, have all been adopted very well within the open source community.
  • I guess, Sun understands that there is still lot more innovation to happen within the 'Web Server' land and wants to be a part of this by sharing its innovation / IP within the rest of  the open source community. This step should trigger cross pollination within other popular open source web servers like Apache HTTP server and LightHTTPd. Note that Sun wants to partner with these open source communities and not compete with them !.

If you have never head of Sun Java System Web Server ever before (it is sad but definitely possible) then you might be wondering as to what the heck is this Sun Web Server product. So, here is a brief history of the product line :

  • Introduced to the world as Netscape Enterprise Web Server from Netscape Communications Inc in early 1997
  • Sun partnered with Netscape Communications in late 1990's and early 2000's and released iPlanet Enterprise Server 6.x release
  • Since Netscape went away, Sun has continuously invested in enhancing the scalability side of its product line and released Sun Java System (for a brief time also known as Sun ONE) Web Server 6.1
  • Over the last 2 years, Sun used its Sun Java System Web Server 6.1 , 7.0 Update 3 and Solaris 10 products to demonstrate the scalability, performance/watt of its Sun Fire T2000/T5120 servers by repeatedly holding SpecWeb'2005 world record. You can get more information about these world records from here, here and here
  • Since fall of 2006, Sun has made its Web Server free to use - both in development as well as in production. Af course, paid customers have enjoyed production support, urgent bug fixes and indemnification. Now, this will continue to be the same even after today's decision.

Now that the great decision has been made, we - engineers - can go back to our kennel and work on the actual job of putting together a build system so that every one can build and play with it. Hopefully, you guys will be able to download the source and use it before fall'08.

Meanwhile, you are more than welcome to download Sun Java System Web Server and use it for free from here.

Thursday Jul 03, 2008

How to deploy Struts sample applications within Web Server 7 Update 3 (using auto-deploy)

With recently released  auto-deploy feature within Sun Web Server 7 Update 3 , deploying Java Web Applications has become a lot easier than ever. Now, you can do so by simply copying the war  files to auto-deploy directory within a server instance. I wanted to verify this with the latest version of Struts (2.0.11.2) and Web Server 7 Update 3 to see if it actually works and it did work seamlessly !!!.

Here is what I did :

- Install Sun Web Server 7 Update 3 (for free)

- Download the latest version of Struts from here  to your temporary location (say /tmp) .

- Copy the Struts sample war files to <install-root>/https-<hostname>/auto-deploy directory .You can try out by copying a sample war file  like struts2-showcase-2.0.11.2.war from your <download directory>/struts\*/apps directory into <web server 7 install root>/https-<hostname>/auto-deploy directory as shown below


- Finally, start the Web Server 7 by doing some thing like <install-root>/https-<hostname>/bin/startserv

- Now, you can access your web application  by accessing http://<hostname>/struts2-showcase-2.0.11.2  in your browser


Monday Jun 30, 2008

Installing Web Server 7 in enterprise data centers...

Large center deployments require the ability to simply layout the product binaries through automated data center tools like Sun N1 Service Provisioning System or  HP (formerly known as Opsware) Server Automation software . This allows server administrators managing large data center to replicate or provision new servers on need basis with very little overhead. 

Sun Java System Web Server 7 has always provided the ability to automate its installation through our silent state file mode. In this mode, web server 7 can non interactively layout the binaries as well as configure the installation in a single step. Sun N1 Service Provisioning System uses Web Server 7 silent state file based installation to provision servers in data centers.

However, some enterprise customers wanted the ability to simply layout Web Server 7 binaries and without actually configuring them. With  Web Server 7 Update 3, we have now provided the ability to simply layout our binaries - a typical requirement in data center based deployments using Opsware Server Automation center.  For this mode, a new state variable known as CONFIGURE_LATER  has been introduced. Now, once this variable is defined within the Web Server 7 state file , Web Server 7 installer will simply layout the binaries without configuring Web Server 7 administration server or an actual server instance. Customers will then need to run 'configureServer' to actually configure a server instance and administration server or node.

Here is a quick write up on how to do this.

  • Download Web Server 7 Update 3 from here and unpack the zip into a temporary location (say /tmp)
  • Now, you will need to create a state file as shown in our docs
  • Within this state file, also include another variable as 'CONFIGURE_LATER' and set it to True
  • Using this state file , you can now install to a given location without actually configuring an administration server or a server instance as shown below :
    • run ./setup -silent <statefile>  command from the command line
  • Once the installation is completed successfully, you can now non-interactively configure Web Server 7 with an administration node or server and a server instance. If you are confused as to what is this administration server or node, please check out this Understanding Web Server 7 guide for some back ground. 
  • Getting back to the topic on completing configuration for Web Server 7 , you can either choose to edit 'configureServer.properties' file found under under <install-root>/setup directory as shown in Configure Later  section. (Please remember to set WS_IS_JES to False ) . A sample configuration file is already created for you with all values filled within <install-root>/setup/configureServer.properties. You can feel free to customize this as well.
  • Finally, you can run the <install-root>/lib/configureServer script to complete the configuration as shown below
    • <install-root>/lib/configureServer -inputfile <config-file>
    • For example, if you installed non interactively under /sun/webserver7, then you would do something like below
      • /sun/webserver7/lib/configureServer -inputfile /sun/webserver7/setup/configureServer.properties -verbose -logfile /sun/webserver7/setup/configure.log

Note:  Please find attached a sample script for UNIX/Linux platforms to non interactively layout and configure the binaries . Feel free to download , read through and customize this script to suite your needs.

Thursday Jun 26, 2008

Web Server 7 Update 3 released with another SPECweb'2005 world record in its belt..

We just released another update within our Sun Java System Web Server 7 product train. Keeping up with our past release history, this release includes new features, more performance enhancements and as usual bug fixes - Ah, needless to say all these without loosing the focus on the reliability and scalability that customers have come to expect from us...

Here are few things to be proud of this release

  • Web Server 7 Update 3 implements the ability to auto deploy java web applications. If you want to quickly try out a given Web Application (war file) within Web Server 7, now you can simply drop the war file within autodeploy directory under a given web server 7 instance. This feature has been very frequently requested by lot of our customers and we are glad to be able to get this done in this update.
  • Sun Microsystems chose Web Server 7 Update 3 to demonstrate the ability of its Sun SPARC Enterprise T5220 Server hardware.and achieved another top spot SPECweb'2005 benchmark. Check out this link for a detailed coverage on this topic.
  • Web Server 7 Update 3 is now available on AIX 5.3 as well as on AIX 6.1. With this addition, we now support the following platforms - Solaris and Linux (both 32 as well as 64-bit) , Windows, AIX and HP-UX.


As usual, all these at no additional cost. Feel free to download Web Server 7 Update 3 (did I say for free !) from here and check out our Release Notes for a detailed information on this release and get back to us at our forum with your thoughts and questions .

All you wanted to know about Web Server 7 Patches for Java Enterprise System

Every few weeks, we keep getting questions like how to upgrade to install updates from Web Server 7 in Java ES 5 environment. Seems like, not lot of people probably know that Sun Java System Web Server 7 is available as OS native packages (SVR4 packages for Solaris, RPM for Linux) etc within Java Enterprise System 5 release.  Accordingly, with every update release, you can download and install patches from Sun Solve - place to download latest patches for Sun products.  So, check out our FAQ Wiki web page to find out the patch information for your respective OS.


Hope this helps




Wednesday Jun 11, 2008

Installing Web Server 7 in OpenSolaris 2008.05

OpenSolaris 2008.05 has formally adopted Java 6 SE out of the box . That is a great news for most of us. Unfortunately, Sun Java System Web Server 7, is still bundling with Java 5 SE . So, if you tried to install this highly scalable Sun Web Server on OpenSolaris , you would see the following error

Now, what this error means that OpenSolaris 2008.05 does not have necessary compatible libraries bundled out of the box to support Java 5. Hmm.. why would they when Java SE 5 is way out of support life . It is time to move on to Java SE 6.

Anyway,  Web Server 7 installer does provide a way to use Java SE 6 runtime available within OpenSolaris. So, in this blog , I will walk you through the list of steps involved in getting Web Server 7 working within OpenSolaris 2008.05

 Note: Web Server 7 officially supports Java SE 6 as well as Java SE 5.

- Assuming, you have a valid internet connection, let us go ahead and install Java 6 SE development packages from OpenSolaris repository. Open a command line terminal window and download / install the development binaries by running the following command.

    pfexec pkg install java-dev


- If you haven't already, please visit Sun Java System Web Server 7 web page and download the binaries from here and unpack the downloaded tar ball to say /tmp

gunzip -c  <download file name> | tar xvf -

- Now, let us fire up Web Server 7 installer by pointing to the Java 6 SE runtime available within your OpenSolaris

        ./setup --javahome /usr/jdk/latest

- Follow through the installation screens like 'accepting the license, choosing an installation location etc.' . Now, when you got to choose between 'express' and 'custom' installation mode, you might want to choose the 'custom' installation mode as shown in the below image.  

Choosing 'Custom' installation mode, allows you to tell Web Server 7 installer to use Java SE 6 runtime bundled within OpenSolaris. The attached sample installation screen shot of this next window showing how to tell  Web Server 7 installer to use Java SE 6


Now, follow through the rest of the installation screens by choosing an administration password and completing the installation. That is about it. You are now ready to use Web Server 7 with Java SE 6


Note: Very shortly, we will also follow up with an IPS package of Sun Web Server 7 within OpenSolaris pkg repository making it lot more simpler to get Web Server 7 on your OpenSolaris .


As always, if run into any issues  , please feel free to visit our forum where product engineers and other smart minds lurk.

Hope this helps

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.

 

 

 

Saturday Mar 01, 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: ,,,

Tuesday Feb 19, 2008

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

Now with the release of OpenSolaris distribution, Please refer to Setting up AMP Stack for OpenSolaris for steps in configuring Apache, MySQL and PHP runtime in OpenSolaris. 

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

Thursday Jan 17, 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 !

Friday Nov 02, 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 !

About

Sharing what little I know

Search

Categories
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