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]
Wednesday Mar 26, 2008
