Saturday, October 11, 2008

Webserver Integration with Websphere

Why should there be a webserver when the Application Server has an inbuilt Web-container? WAS (Websphere Application Server) has a web container that can respond to http requests. It can serve the same purpose of a webserver. It can deliver static content; it can deliver the servlets and JSPs.

Why do we need a webserver in between the client and the application server? The benefits are listed below and they are listed not as per the importance. The importance can vary based on the potential uses.

1. Load Balancing is easier with Webservers in place. All the requests from the client can be redirected to various Webservers available and the webserver can redirect it to the necessary application servers depending on the load on the application servers.
2. Static content like html, images can be served by the webserver itself. This will increase the performance of the application as a round trip to the application server is not required to display the static content.
3. Application server security is preserved as all direct access to the application servers can be blocked. If the list of Webservers and their ports are known which will request data from the application server, only those servers can be enabled to redirect the request to application server. For e.g.: If the virtual host aliases mention that it will accept request from server1 and port 8090, only the request coming from server1 will be accepted by the application server. Other requests will not be rejected by the application server.
4. It’s easy to configure the authentication mechanisms in the webserver and safer to do so. If the user is invalid, the application server, where the business components reside is not approached and hence more secure.

In the remaining document, the steps required to configure IBM HTTP Server to work with WAS is detailed. The steps that need to be followed are outlined below.

1. Install the Websphere Application server (Base/Express/ND).
2. Install IBM HTTP Server. Only few Webservers are supported by WAS in webserver-application server communication. For e.g. Apache Webserver, IBM HTTP Server, Sun One Webserver. Refer to IBM documentation to do this.
3. Download and install the plug-in for Websphere-Webserver communication. The detailed steps are described below, assuming that the WAS and the Webserver are installed on the same machine. For remote setup, the scripts need to be copied over to the application server and it should be executed separately.
1. Run the install.exe in the machine where the Webserver is installed.
2. Select the license terms and then select what type of Webserver will be used. Only the webserver type selected will be configured but the plug-in for all supported Webservers will be installed.
3. Select if the Webserver follows a Local or Remote Topology. If the Webserver and the Application server exist on different machine, select Remote otherwise select Local.
4. Local Setup
5. Select the path where the plug-in should be installed. It will be typically “C:\Program Files\IBM\HTTPServer\Plugins”. You can select any other directory but preferably within the Webserver installation path.
6. Select the Application Server Root. e.g: “D:\Program Files\IBM\WebSphere\AppServer”
7. Select the configuration file for the WebServer. For IBM HTTP Server, it will be “C:\Program Files\IBM\HTTPServer\conf\httpd.conf”. Select the Webserver port. This would have been set by you during the Webserver installation. (If you don’t remember, read the conf file of the Webserver file and search for the word “Listen”. The port number will be placed adjacent to it.)
8. Select a Webserver profile name; it just needs to be unique. This name will be shown in the Administrative console of WAS.
9. The program will display the plug-in file name for the Webserver. This ends the selection process and the next button will install the plugins.
10. The plug-in will be installed for the default profile of the application server.
11. A script will be created in the “?webserver path?/plugins/bin” folder with the name “configure?Webserver Profile name selected in Step h?.bat
12. Copy the bat file to the “?was_install_root?/bin” folder and preserve it. This script can be used to create the webserver profile in the application server if required.
13. In the Administrative Console, you can find a Webserver profile created by the name given in Step h.
14. Remote Setup
15. For remote setup, execute the bat file as mentioned in Step l.
16. Restart the application server and the webserver
17. The installation will be complete.

For testing the installation process, try accessing the below URL. The request goes to the webserver and since the servlets is not present in the Webserver, the request will be redirected to the application server. (If it does not work, ensure that webserver name and webserver port is added in the host alias for the webhost in the application server. Ensure that the plug-in file is generated in the application server and propagated to the webserver too)

http://?webserver name?:?webserverport?/servlets/snoop

No comments:

Post a Comment