Sunday Mar 02, 2008

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

This blog copyright 2008 by natarajan