Sun Java Sytem Web Server 7.0 blogs Amit's Weblog

Wednesday Jul 30, 2008

After running drupal on Web Server 7.0 in a matter of few minutes, I was very excited to run other PHP applications as well. I picked up mediawiki this time and downloaded the tar ball from mediawiki.org. Since I have already configured PHP with Web Server 7.0, I simply extracted the mediawiki tar ball into the Web Server instance document root and set index.php as a welcome file using the administration GUI. That is all it takes to run mediawiki on Web Server 7.0

In case you want to use CLI instead of administration GUI, you could invoke the following wadm commands after extracting the mediawiki tar ball into the Web Server instance document root-

wadm> get-index-files --config <config-name> --vs <vs-name>
index-files=index.html,home.html,index.jsp

wadm> set-index-files --config <config-name> --vs <vs-name> index.html,home.html,index.jsp,index.php
CLI201 Command 'set-index-files' ran successfully

wadm> deploy-config <config-name>
CLI201 Command 'deploy-config' ran successfully

wadm> start-instance --config <config-name>
CLI204 Successfully started the server instance

Now access the mediawiki by typing in the URL - http://<host>:<port>/<name_of_the_extracted_mediawiki_directory> in the browser and complete the mediawiki installation by following the instructions in the INSTALL file which can be located directly under the extracted mediawiki directory.

You can see how easy it is to run mediawiki on Web Server 7.0 in the following screen cast. This demonstration assumes that you have already configured PHP with Web Server 7.0 (Watch the "Using PHP with Sun Java System Web Server 7.0" screen cast if you haven't configured PHP with Web Server 7.0 as yet)

Thursday Jul 24, 2008

The other day I was trying to use Web Server 7.0 to set up a reverse proxy. As usual, I googled it and found this nice blog - "Configuring Reverse Proxy in Sun Java System Web Server 7.0". This blog talks about using the CLI to configure a reverse proxy but I wanted to see if I could do the same using the Administration GUI.

As expected, I could manage to configure the reverse proxy with few clicks on the Administration GUI. You can see that in action in the following screen cast:

Friday Jul 18, 2008

One of the most common tasks in any web server is to restrict the access to a URI to say some specific users in a corporate LDAP database. This task can be easily done using Access Control in Web Server 7.0. You can find more information about Access Control in the "Access Control In Sun Java System Web Server 7.0" blog.

Setting up an Access Control List for a URI using Web Server 7.0 administration console is a matter of few clicks. You can see that in action in the following screen cast.

Thursday Jul 17, 2008

I have successfully configured PHP with Web Server 7.0 couple of days ago and thus I wanted to try if I could get some cool PHP applications to work with Web Server 7.0. I picked up Drupal which is a content management PHP application and started exploring the ways to get this application working with Web Server 7.0.

The good news is that it actually doesn't take much time to run Drupal on Web Server 7.0. I have captured this experiment of mine in the following screen cast. This screen cast assumes that you have already configured PHP with Web Server 7.0 using PHP Add-On. (Refer of my previous blog if you haven't configured PHP with Web Server 7.0 as yet). PHP Add-On has a in built support for MySQL which is required by Drupal as well (Refer to "Mysql with PHP on Sun Java System Web Server 7.0" blog to find more about it)

Friday Jul 11, 2008

I have never tried running a PHP application so far being a java guy but I always wanted to know how easy or difficult it would be. I decided to try configuring PHP with Sun Java System Web Server 7.0 and when I googled for PHP and web server 7.0, I found this useful blog. While this blog talks about configuring PHP with Web Server 7.0 on Windows, I wanted to try the same on my Solaris 10 desktop and guess what, it didn't take me more than a few minutes to figure out what needs to be done.

I used the administration GUI to configure PHP with Web Server 7.0 but you could use wadm commands as well. You can refer to the Using CLI section of "Using PHP on Sun Java System Web Server 7.0" blog to find more out the wadm commands.

You can see how I got PHP working with Web Server 7.0 using Administraiton GUI in the following screen cast. Few points to note to understand this screen cast better:
- I have downloaded the PHP Add-On 1.0 pack from sun.com
- I have installed Web Server 7.0 Update 3 on Solaris 10

Thursday Jul 03, 2008

With the release of Web Server 7.0 Update 3, you can now configure the administration server to use LDAP authentication. The administration server is configured to use keyfile authentication by default and it can be switched to use LDAP authentication quite easily using either the administration GUI or CLI.

Let us use wadm CLI and see what it takes to switch to LDAP authentication against Sun Java System Directory Server.

wadm> enable-admin-ldap-auth --ldap-url=ldap://test.sunds.com:389/o=TestCentral --allow-group=testGroup
CLI213 The administration server needs to be restarted for the changes to take effect.

wadm> get-admin-ldap-auth-prop
enabled=true
ldap-url="ldap://test.sunds.com:389/o=TestCentral"
search-filter=uid
group-search-filter=uniquemember
group-search-attr=CN
timeout=10
allow-group=testGroup

Note that you have to restart the administration server for the changes to take effect.

You can switch back to the default keyfile authentication by executing the following command:

wadm> disable-admin-ldap-auth
CLI213 The administration server needs to be restarted for the changes to take effect.

You can see the same tasks being performed using the administration GUI in the following screen cast:

Tuesday Jul 01, 2008

One of the neat developer friendly features added in Web Server 7.0 Update 3 release is auto-deployment of web applications. This feature will allow developers to deploy a web application by simply copying a war file into the auto-deploy sub-directory of the server instance. If the instance is already running, then run the <instance-root>/https-<config>/bin/reconfig script to tell the server to pick up the auto-deployed web-app. Note that the web-app will get deployed into all the virtual servers within the configuration. To undeploy the web application, simply remove it from the auto-deploy directory and run reconfig again if the server is running.

In case you want the server instance to automatically deploy or undeploy web-application each time a war file is added or removed from the auto-deploy directory, configure dynamic-reload-interval property of the servlet container using the Administration GUI/CLI. The server will keep checking for added/removed web applications after every dynamic-reload-interval number of seconds. Lets try setting this property using the wadm CLI:

wadm> set-servlet-container-prop --config <config-name> dynamic-reload-interval=30
CLI201 Command 'set-servlet-container-prop' ran successfully
wadm> deploy-config <config-name>
CLI201 Command 'deploy-config' ran successfully

You can see auto-deployment in action in the following screen cast: