Sriram Natarajan's Weblog
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.
Posted at 06:47PM Mar 26, 2008 by natarajan in Web Server | Comments[0]
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.
Posted at 12:51AM Mar 02, 2008 by natarajan in Web Server | Comments[0]
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 |
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.
Posted at 03:23PM Feb 19, 2008 by natarajan in Web Server | Comments[2]
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 !
Posted at 05:49AM Jan 18, 2008 by natarajan in Web Server | Comments[0]
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 !
Posted at 02:47AM Nov 03, 2007 by natarajan in Web Server | Comments[0]
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 
Posted at 09:40PM Oct 27, 2007 by natarajan in Web Server | Comments[1]
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 .
Posted at 01:24AM Oct 24, 2007 by natarajan in Web Server | Comments[0]
Configuring multiple HTTP Listeners with Web Server
Some time back, I wrote a blog about how one can take advantage of Solaris 10 and make Sun Web Server 7 to run at port 80 as "non root" user. One customer, who probably read this blog, posted a follow up question on how to get multiple HTTP Listeners working with Web Server 7 and still run at port 80. So, here is a follow up post on the same topic to help this customer.
Here is a step by step instruction to get this done
1. Download Sun Java System Web Server 7 from here
2. It is better to decide on the runtime user of your Web Server before actually installing Web Server on your system. On Linux systems, user used to simply choose 'nobody' as the runtime user of the Web Server.
With Solaris 10 or OpenSolaris , 'webservd' is a default user created by Solaris - so that Web Servers like Apache or Sun Java System Web Server 7 can leverage this as 'non root' user. On Solaris 10 or above, you can run the following command to configure a non root user like 'webservd' to run as non root and still listen at port 80.
|
# /usr/sbin/usermod -K defaultpriv=basic,net_privaddr webservd |
3. Now, kick off Web Server 7 installation and at the time of installation, you will need to choose Web Server 7 runtime user as 'webservd' or whatever the user you chose in the above step.
4. Web Server 7 installer creates a default HTTP listener (most likely the default port number is 80) and a default configuration with the same name as your 'hostname' . This should allow your web site to run at port 80.
5. Now, if you would like to configure multiple HTTP listeners so that your web server can respond to requests like
http://<hostname> or http://<hostname>:8080 or https://<hostname> or http://<hostname>:82 etc
then all you need to do simply configure more HTTP listeners. If you are new to Web Server 7, check out Getting Started and Managing Configurations link to get you started.
6. For simplicity , let us use Web Server 7 CLI to get this job done
|
/sun/webserver7/bin/wadm create-http-listener --user=admin --server-name=<hostname> --listener-port=82 --default-virtual-server-name=<hostname> --config=<hostname> /sun/webserver7/bin/wadm deploy-config --user=admin <hostname>
|
Now, your Web Server can listen to HTTP requests comming in at both 80 as well as 82.
Posted at 01:22PM Oct 15, 2007 by natarajan in Web Server | Comments[7]
Quercus 3.1.2 with Web Server 7
Thanks to Caucho Technology's Quercus (a complete PHP runtime in Java), now In less than 5 minutes, one can get a PHP page deployed using Web Server 7. Check out this article to see how simple and easy it is with Web Server 7.
Posted at 12:26PM Oct 10, 2007 by natarajan in Web Server | Comments[0]
Cruising with Web Server 7 and Sun SPARC T5200
Today (9th Oct'07) morning - we got a Niagara 2 based server to our lab and with the help of our lab guys, we booted up this ultra cool Ultra SPARC T2 processor based Sun SPARC Enterprise T5220 server. Bringing up the server was totally a breeze - very much like Sun Fire T2000.
Like every one else, I was sure curious as to what we got here. So, once I logged in, I ran 'uname -a' and 'psrinfo' commands to find out the OS version and the processor information. Here is the sample output.- telling me that we have a 1 socket server with 64 virtual processors (translates to a 8-core with 8 thread / per core CPU) and Solaris 10 Update 4 comes pre-installed on this server.
| [root@accel]'~'>uname -a SunOS accel 5.10 Generic_120011-12 sun4v sparc SUNW,SPARC-Enterprise-T5220 [root@accel]'~'>/usr/sbin/psrinfo -pv The physical processor has 64 virtual processors (0-63) UltraSPARC-T2 (cpuid 0 clock 1417 MHz) |
Being a Web Server engineer, I couldn't stop myself installing the latest Web Server 7 release - Sun Java System Web Server 7 Update 1 on this beauty and run some quick and very basic performance runs just for the heck of it.
As you might already know, Solaris 10 bundles Apache HTTPd 2 server. I decided to use this simple but efficient performance benchmarking client - 'ab' and run a very simple performance test against Web Server 7.0. So, here we go - hitting the default home page that comes with Web Server 7 (a static 'index.html')
| [root@accel]'~'> /usr/apache2/bin/ab -c 20000 -k http://accel.red.iplanet.com/index.html This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking accel.red.iplanet.com (be patient).....done Server Software: Sun-Java-System-Web-Server/7.0 Server Hostname: accel.red.iplanet.com Server Port: 80 Document Path: /index.html Document Length: 12038 bytes Concurrency Level: 20000 Time taken for tests: 0.1712 seconds Complete requests: 1 Failed requests: 0 Write errors: 0 Keep-Alive requests: 1 Total transferred: 12297 bytes HTML transferred: 12038 bytes Requests per second: 584.11 [#/sec] (mean) Time per request: 34240.000 [ms] (mean) Time per request: 1.712 [ms] (mean, across all concurrent requests) Transfer rate: 7009.35 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 1 1 0.0 1 1 Waiting: 1 1 0.0 1 1 Total: 1 1 0.0 1 1 |
Not bad huh - supporting 20,000 simultaneous connections and delivering 584 requests per second (though for a very simple static HTML page). Unfortunately, the stress client that I was using - 'ab' , had some limitations and I had to restrict myself to 20,000 simultaneous connections. Some other day, I will try this again with Faban - open source next generation benchmark runtime and see how far I can juice this workhorse for such simple static HTML pages.
Looks like, if you got Ultra SPARC T2 processor based Sun SPARC Enterprise T5220 server and a highly scalable web server on the market like Sun Java System Web Server 7, you sure could be cruising and saving a lot of money in your data center.
Posted at 01:48AM Oct 10, 2007 by natarajan in Web Server | Comments[0]
Web Serving with Sun's Web Server 7 and Ultra SPARC T2
Today (9th Oct'07), Sun announced the ultra cool Ultra SPARC T2 processor and the availability of Sun SPARC Enterprise T5220 server running on this processor. Also, if you haven't heard already, you might be interested in knowing that Sun's Web Server - Sun Java System Web Server 7 - posted world record in SPECweb'2005 running on this eco friendly Sun SPARC Enterprise T5220 workhorse. You can get more information on this milestone from here and here. Interested in hearing more about this ultra cool Ultra SPARC T2 (internally called as Niagara 2) processor, checkout CMT Comes of Age
link.
Posted at 11:56PM Oct 09, 2007 by natarajan in Web Server | Comments[0]
Web Server 7.0U1 is available !
After more than 6 months of development and rigorous testing, our team is proud to release our first update Sun Java System Web Server 7.0U1 - highly stable and enterprise grade quality Web Server with latest JSP and Servlet implementation built-in. I have been wishing to share this for quite some time now - but just never got around to this till now - When I was representing Web Server 7 along with the rest of my team members in Java ONE'07, we met lot of customers who were visibly surprised that Web Server 7 core (for all its Java name in it) is mostly written in C/C++ and we are able to process a wide variety of dynamic content like Servlet / JSP, PHP and any other scripts using CGI. So, why the Java name in - Well, I can think couple of reasons1. We provide a highly optimized and integrated web container implementation. So that folks who want a native (C/C++) Web Server , for all its scalability and extensibility benefits, can also run Servlets , JSP and JSF without any performance loss. You don't have to burn midnight candle and figure out 'mod_jk' - Web Server 7.0 already does this for you in a more optimized way !
2. Web Server 7's Administration Server GUI and CLI uses extensive Java and its related technologies thus enabling us to run our administration server, with little engineering effort on multiple platforms. Java is definitely cool.
Well, coming back to our update release - To me, these are some of the near and dear list of features - besides ton of bug fixes , performance enhancement and security fixes
1. Customers using FastCGI within Web Server 7 (like our PHP Add-on) will now be able to manage the FastCGI plugin configurations through our WS7 administration GUI or CLI as well
2. Administration GUI and CLI now has support to add / configure regular expressions. Web Server 7 had rich regular expression support - which could be ideal for telling the Web Server as to what to be done when a particular URI is coming in. For example, Internet Service Providers who typically host multiple domains within a single server will find this very needy. Now with Web Server 7.0U1, our customers will be able to use our rich GUI to configure these highly powerful regular expressions !.
3. Web Server 7.0U1 is now compliant with Java EE 5 version of Servlet , JSP and JSF specifications . Developers using Netbeans 5 and 5.5.1 will now also be able to develop and deploy using Sun Java System Web Server 7.0 Update 1. Hmm.. I know - what about Netbean 6 ? We are not there yet. But, hopefully will be there pretty soon.
To top it off, Web Server 7.0U1 installer can quietly detect if you are upgrading on top of Web Server 7.0, and can upgrade without disturbing your configurations. So, yes - it is safe to upgrade on production servers as well :-).
So, go ahead - download , install and run on your production server for free. Now, if you need enterprise level support, you will need to come to us :-) (Hey, we got to make money some where.) . So, if you haven't deployed your web site on Sun Java System Web Server 7.0U1, now would be a good time to give it a try
If you are either a new customer or have been using our Web Server for quite some time now, please take time to write to us as to what you like , any suggestions you have for us to improve or any feature that you would like to see it implemented. Thanks to all your feedback and bug reports in Sun's Web Server forum, our engineers have been able to address the raised issues and make Web Server 7.0U1 a better product . Please keep them coming !.
Note: For all Web Server 7 customers running in JES5 stack, we will be very shortly releasing our patch on SunSolve that you can download and install on JES environment.
Looking forward to hear back your comments
Cheers
Sriram
Posted at 11:42PM Jun 20, 2007 by natarajan in Web Server | Comments[7]
Running PHP within Web Server 7 using Quercus PHP servlet
In my last post, I mentioned about how our recent PHP Add-on 1.0 release can vastly simplify the process of configuring and running PHP within Sun Sun Java System Web Server 7.0 (formerly known as iPlanet/Sun ONE Web Server). This is indeed a great way to use all the bells and whistles of Sun Java System Web Server 7.0 and also run PHP scripts natively in the same way that one would be using within Apache Web Server.
Now, if you are JSP or Servlet programmer, then you might be interested to know that one can also download and install the Quercus PHP Servlet war file (a pure Java web application based PHP implementation) and execute php scripts within your enterprise web application. Here is the recipe to get it working within Web Server 7
1. Download the Quercus PHP war file (currently in beta) from here
2. If you have not already, you can download and install Sun Java System Web Server 7 from here. If you need any help in installing this server on your machine, Web Server 7 documentation and this blog should be helpful as well.
3. For testing purposes, I will create a separate configuration (say 'quercus') . If you are new to creating a new configuration and deploying web applications within Web Server 7, you can use this demo as a good starting point.
In this blog, I have used our rich command line interface(CLI) to deploy Quercus war file within Web Server 7. If you prefer, you can use our administration server GUI and get the job done as well. Note here that I have configured my setup in such a way that I am not being asked for administration server password with every command. If you would like to do the same, please check my earlier posting from here.
|
cd C:\Program Files\Sun\WebServer7 (or wherever you have installed Web Server 7 on your machine)
C:\Program Files\Sun\WebServer7> admin-server\bin\startserv.bat
C:\Program Files\Sun\WebServer7> bin\wadm.bat create-config --user=admin --password-file=.password --http-port=8080 --server-name=sriramn quercus CLI201 Command 'create-config' ran successfully
CLI201 Command 'create-instance' ran successfully
|
At this point, you should see a directory entry by the name 'https-quercus' under your installation.
4. Now, let us deploy the Quercus PHP web application (war file) to our Web Server. You can either use administration GUI or CLI to deploy this war file. Me, being a command line person, I would do something like
|
C:\Program Files\Sun\WebServer7> bin\wadm.bat deploy-config --user=admin quercus
|
3. Now, if you try to start the server, you will run into error like this
|
|
What this error means that Web Server 7 is unable to successfully start the Quercus PHP servlet because of error while parsing the web.xml file that came with the Quercus war file. If I am not mistaken, as per XML specification standards, one is not supposed to have '--' characters within a comment in a XML document. Unfortunately, the web.xml shipped within this war file uses this format.
Now, to overcome this issue, you can either
a) simply save this sample web.xml file to your machine (you can do this by right clicking on the link and choose the Save As option) and copy this file to
<Web Server 7Install-root>/https-quercus/web-app/quercus/php/WEB-INF/web.xml.
or
b) edit the default shipped web.xml file and remove '--' characters within the comment block.
By default, a web.xml file will be under your instance's web application context root
<Web Server 7 Installation Directory>/https-quercus/web-app/quercus/php/ directory
In our case, this file web.xml will be at
C:\Program Files\Sun\WebServer7\https-quercus\web-app\quercus\php directory.
Now, if you are manually editing this web.xml file, please remember to not remove the line starting with '<!--' .
|
I would edit to look something like <!-- Specifies the encoding Quercus should use to read in PHP scripts.
|
4. That's all there is to do. Now, you can shutdown and restart the Web Server quercus server instance and you should be able to access the sample php (index.php) shipped within this web application. To access this, you will need to enter the following url into the browser and be able to see a nice welcome page like below
http://localhost:8080/php/index.php
If you are able to see the above page successfully then you have completed configuring Quercus web application within Web Server 7 and you are now ready to configure and run PHP scripts within Web Server 7.
On the closing note, one thing to remember here is that you need to create your PHP scripts within your web application's context root. In our case, it will be under
C:\Program Files\Sun\WebServer7\https-quercus\web-app\quercus\php
Considering Web Server 7 has built-in support for Servlet & JSP web applications for quite some time now and used to carry a world benchmark in SPECweb2005, I got naturally interested when I learnt about Quercus and wanted to try out as to how easy it is to configure and run this servlet based PHP implementation within Sun Java System Web Server 7. So far, I was very impressed with my limited testing. If you guys are as excited as I am about the opportunity of intermingling PHP scripts within JSP , please do try it out and let us know as to what you think
Special thanks to Caucho's Quercus team for making this implementation available as as war file so that folks like us can download and have fun with it. Also, please read their documentation for more information.
Posted at 06:14PM Apr 05, 2007 by natarajan in Web Server | Comments[1]
Simplest way to run 'PHP' with Sun Java System Web Server 7.0
HeyAre you one of the many millions of web developers developing web sites using PHP ? In that case, you might be interested in knowing that PHP Add-on 1.0 bundle (PHP 5.2.0 based binaries with FastCGI and NSAPI plugin support) for Sun Java System Web Server 7.0 comes up with a setup script that takes away all the pain in configuring PHP with Sun Java System Web Server 7.0 - Sun's latest Web Server release.
So, if you are interested in developing or deploying PHP on top of highly scalable Web Server that comes with clustering and monitoring supports, then this is what you can do
- Download Sun Java System Web Server 7.0, if you haven't already
- Install Web Server 7.0 in your machine.
- Download the Sun Java System Web Server 7.0 PHP Add-on 1.0 (PHP pack to work with Sun Java System Web Server)
- Now, cd to <Web Server Install Root>/plugins directory
- Let us 'unzip' the downloaded PHP Add-on zip bundle by doing
something like
Now, cd to <Web Server 7.0 Install Root/plugin/php> directory and run the 'setupPHP' with the instance name as the argument. This instance will be now configured to execute 'PHP' scripts.
Example:
setupPHP <https-foo> where foo will be the name of the instance that you want to execute PHP scripts.
Since this script (setupPHP) makes some changes to your instance's configuration files, Web Server 7.0 administration server will need to be told about it. The way to do this either through 'pull-config' CLI command or through GUI.
Features that I liked in this Add-on
- Includes 64-bit PHP binaries for Solaris platform where Web Server 7.0 also supports 64-bit . So, if you are interested, you can configure this Add-on as an NSAPI plugin and run Web Server + PHP in 64-bi
- If I am not mistaken these bits are not officially supported by Sun but still some amount of internal testing has been performed on these bits with Web Server 7.0. So, we can expect to not see whole bunch of crashes happening every where
- Last but not least - configuring PHP with Web Server 7.0 is
finally a breeze !
For example, this is what I did on my Windows laptop
Note: Please refer to my earlier blog on how to save the Web Server 7.0 Administration password within a file. You will need this to follow the below steps that I have given here. Without this, you will need to type the password for every command.
| Start
the 7.0 Administration Server: C:\Program Files\Sun\WebServer7> admin-server\bin\startserv.bat Create a new configuration and instance to execute all the PHP scripts under : C:\Program Files\Sun\WebServer7> bin\wadm.bat create-config --user=admin --password-file=.password --http-port=8082 --server-name=sriramn php CLI201 Command 'create-config' ran successfully C:\Program Files\Sun\WebServer7> bin\wadm.bat create-instance --user=admin --password-file=.password --config=php sriramn.red.iplanet.com CLI201 Command 'create-instance' ran successfully Unpack the download phppack for Web Server 7.0 under 'plugins' directory C:\Program Files\Sun\WebServer7> unzip c:\downloads\phppack-5_2_0-windows.zip Invoke the PHP Add-on installer : C:\Program Files\Sun\WebServer7> cd plugins\php C:\Program Files\Sun\WebServer7\plugins\php>setupPHP.bat -instancename=https-php |
- Now, let us verify if you are able to execute PHP scripts. So, let us write a quick one like
<?php
echo phpinfo();
?>
and save this one with the name under 'info.php' under your server's document root directory
- Start the instance (https-php\bin\startserv.bat) and try accessing the info.php web page
- If you are satisfied with what you see, then you can bring over these recent configuration changes into Administration Server's configuration repository by running the following command
C:\Program Files\Sun\WebServer7\plugins\php>cd ..\..\ C:\Program Files\Sun\WebServer7>bin\wadm.bat pull-config --user=admin --password-file=.password --config=php sriramn.red.iplanet.com CLI201 Command 'pull-config' ran successfully |
- Now, use your favorite browser to access 7.0 Administration Console (https://<HOSTNAME>:<PORT>

- At the top right, you will see something like 'Deployment Pending'. Click this button
- This should open a pop up window and provide you with 2 choices
- first one is when you want to bring over the configuration changes that already exists in the administration server's configuration repository but needs to brought down to an instance.
- second one is when you have made some changes to your local instance either by manually editing the configuration files or by running scripts like 'setupPHP' and you want administration server configuration repository to know about this.
- In this case, we will select the 2nd radio button as our choice, and click 'Deploy'.
- If you are thinking of going live with these bits, then you defintely want to configure a 'php.ini' under '<WebServer Install Root>/plugins/php' directory. The Add-on does come with the standard 'php.ini-dist' and 'php.ini-recommended' for reference purposes. Please take time to create a php.ini that suites your needs.
Please let us know as to what you think. As usual, you can post your experiences and pain points to our Forum
Posted at 02:56AM Feb 08, 2007 by natarajan in Web Server | Comments[0]
How do I save Web Server 7.0 Administration Server(wadm) password information ?
If you are planning to either setup a website or enhance your current website, you can give Sun's latest Web Server (formerly known as Sun ONE Web Server or iPlanet Web Server) - Sun Java System Web Server 7.0 a try. If you haven't downloaded it, here is the link to download and use it for free ! and here is the What'z New in the release.
These days, I do most of my regular Web Server 7.0 administration tasks using its rich command line interface(CLI). Hey, I know Web Server 7.0 has a nice GUI as well. It is just that I am not a big GUI person. So, I thought I should write a quick blog on how I use it. Hopefully, some one finds this useful.
The way to kick of the Web Server 7.0 Administration Server is by running the following command
| cd
<Web Server 7.0 installation root> bin/wadm --user=<administration login username> --password= <administration login password> |
If you hate typing the above line frequently, then on UNIX / Linux platforms, you can set <Web Server 7.0 installation root/bin> to your PATH For example, you would do something like
export PATH=$PATH:/sun/webserver7/bin (in sh or bash shell)
On Windows, you will need to do update the 'Path' environment variable with the location of Web Server 7.0\bin directory. How to Manage Environment Variables in XP link can provide you with insight on how to update the 'Path' variable. You will need to append the 'Path' environment variable to look something like Path=%Path%;"c:\Program Files\Sun\WebServer7\bin"
where
and
Normally, I very much want to reduce my typing in the keyboard and would like to get my job done with as little typing as possible. So, for guys like me, Web Server 7.0 Administration Server allows to save the commonly used command line parameters like 'user name', 'password', 'configuration name' and 'nodename' so that we don't have to type these things frequently.
This is how you can save this information to save you from typing these things repeatedly when you login to the administration server
-> Use your favorite editor and create a file a '.wadmrc' under your home directory. For windows users, this file will need to be created under %HOMEPATH% . Typically, %HOMEPATH% will expand to 'C:\Document and Settings\
-> Add the following lines to this newly created file
| set
wadm_user
<Your administrator login user name Example: admin> set wadm_password <Your administrator login password Example: adminadmin> |
-> Now save this file and ensure that only 'you' have access to read this file.
On UNIX / Linux platforms, you can do something like chmod 400 $HOME/.wadmrc
The above step is a very important thing to do. You don't want to have other prying eyes to get control of your site's administrator server, do you ?
Though, Web Server 7.0 administration server has been designed from the ground up to manage multiple Web Server instances in a cluster like environment to handle loads like the one you get in web sites like MLB , it can very well manage my single configuration / instance running on Windows XP as well. Well, if you are a typical customer who is using Sun Java System Web Server 7.0 with a single configuration deployed to a single machine, then you can add the following 2 lines as well to the '.wadmrc' file
| set
wadm_nodehost <Your current hostname.domainname For Example
natarajan.sun.com>
set wadm_config <Your Web Server 7.0's configuration name or whatever the configuration that you frequently work with> |
Posted at 10:10AM Jan 31, 2007 by natarajan in Web Server | Comments[0]
Wednesday Mar 26, 2008
