Skip to main content

Best Practice: Configuring Web applications on WebSphere Application Server for z/OS and OS/390

Don Bagwell (dbagwell@us.ibm.com), Senior Software Engineert, IBM
Don Bagwell is with the IBM Washing Systems Center.

Summary:  With the introduction of WebSphere Application Server for z/OS and OS/390 Version 4.0, and now Version 4.0.1, there are several different ways in which you may configure and execute your Web applications. There are a number of choices which have to be made when configuring a Web application to run in your runtime environment. This best practice documents several concepts that will assist in creating this environment. The benefit of following these recommendations is clear -- you will have a working runtime environment for your Web applications within a short time.

Date:  13 May 2002
Level:  Intermediate
Activity:  237 views

This best practice applies to the following product, version, and platform:

  • WebSphere Application Server - Base, versions 4.0 and 4.0.1, OS/390 and zSeries

Recommendation

Although some of the items listed here may seem obvious, they are included for the sake of completeness.

1. Establish a preliminary test environment in which to experiment and gain experience.

Before constructing the webapp environment for production use, invest some time experimenting with a "sandbox" configuration. Establishing a separate J2EE application server in which a test webapp can run is relatively simple, and configuring the Transport Handler to service that application server is even more straightforward. Setting up a test HTTP Server with the plugin is a bit more complicated, but not unduly so.

You can gain valuable insights into how this system works by experimenting before committing a design to production. It is time and effort well spent. The sandbox environment can be quickly dismantled later without affecting the larger WebSphere environment.

2. Decide which HTTP Listener -- Plugin or Transport Handler -- you plan to use, and configure only that one initially.

Having both the Plugin and the Transport Handler configured at the same time is a perfectly acceptable thing to do. However, it can be somewhat confusing at first because of the way applications are bound to the virtual hosts (see next item). With both configured, it's possible a URL issued from a browser will result in a "Virtual Host or Web Application Not Found" message. This results because, for example, the webapp is bound to the Transport Handler's virtual host but the URL was pointed to the Plugin's virtual host.

It's possible to bind applications to both virtual hosts. Unless you have more advanced knowledge of how this works, configuring only one listener is best. After you gain the understanding of how this works, you will be better positioned to configure a more complex environment.

To help you understand the pros and cons of each listener, the following summary chart is offered:


Listener Pros and Cons
Listener Pros and Cons

3. Understand the concept of "binding an application to a virtual host" and how to validate that it occurs properly.

This concept is outlined in fair detail in the white paper referenced in the Resources section of this document. Understanding this concept is important because a webapp not properly bound cannot be executed. And understanding the concept allows you to validate that the webapp was in fact bound successfully.

Several sub-points are noteworthy:

  • You must bind your Web applications to virtual hosts whether you are using the Plugin or the Transport Handler. The act of binding applications is largely independent on which HTTP listening agent is being used out front.
  • Any time you deploy a new application into a WebSphere Application Server Version 4.x J2EE server, you should validate that the webapp is bound to the virtual host you intended. You can verify this by inspecting the SYSPRINT of the server region (not the control region) and reviewing the report of bound applications to virtual hosts. Again, the white paper outlines what this report looks like and how to verify proper binding.

Common Mistakes:

  • The host.[name].alias= value coded doesn't match the host value found on the received URL.

    It's easy to think that the virtual host value you code must be equal to the value coded during the ISPF customization dialogs, and that may be the right value to use. But it also may not. The rule of thumb is this: code the alias= value equal to whatever host value you expect to be on the URL received by your server. Many things in the network can cause a URL to flow to your server (such as DNS configuration, HOSTS file updates on PCs).

  • The host.[name].alias= value is coded in uppercase, or in mixed case.

    WebSphere Application Server will take a received URL and convert the host value to lowercase before it compares it to the alias= value. Therefore, the alias= value should be coded in lower case.

  • Two host.[name].contextroots= statements are coded using the same string value.

    This is typically done in an attempt to bind an application to two virtual hosts. While this is possible, coding two contextroots= statements is not the way to do this. Instead, code one contextroots= statement pointing back to one alias= statement, and provide two (or more) virtual host values on the alias= statement, separating each with a comma.

    If two contextroots= are coded, the WebSphere Application Server will only bind to one of them

4. Make certain your "Virtual Host / Context Root" pair is unique in the WebSphere Application Server node.

This pitfall comes about when someone tries to deploy the same application into two different J2EE application servers. Without going into too much detail here (because it gets somewhat complicated to explain), the best practice is to deploy the application into different J2EE application servers using different "virtual host / context root" pairs.

Of the two (virtual host or context root), the virtual host is the easiest to change. The context root is set during application assembly, and the value for the context root resides in the application.xml file of the assembled EAR file. The virtual host, however, is set in the webcontainer.conf file and is open to changing any way you want. Another point to remember is that the port designation is part of the virtual host, so a value of www.mycompany.com is a different virtual host from www.mycompany.com:8080 . If you need to perform load balancing across two or more different J2EE servers, consider using replicated servers (separate instances of the same server) which support unique "virtual host / context root" pairs by design.

5. Have in place some basic validation mechanisms so you can quickly test the pieces of your system.

The objective here is to have some quick tests in your back pocket so you can determine the health of the various components of your system without having to dig through trace files:

  • If you're using the WebSphere Application Server 4.x Plugin, have a Pass statement coded in the HTTP Server's httpd.conf file that will resolve to a simple HTML page you know is on the server. You can then point your browser at that simple HTML file, and if the file is served to you (beware of browser cache), you know that the HTTP Server is at least up and functioning.
  • If you're using the Plugin, leave the /webapp/examples sample application intact that comes with the supplied sample was.conf file. This serves two valuable functions:
    1. It provides a way of validating that a URL request can be mapped into the Plugin environment with a Service statement, proving that the Plugin has initialized and is operational.
    2. The "Application Dispatching Information" function of the "showCfg" servlet will tell you about the webapps it sees as deployed and available back in the J2EE application servers.

    If you're concerned about exposing that function to the world, Protect the /webapp/examples resource.

    • If you're using the Transport Handler, issue the TSO NETSTAT option to make certain your J2EE application server control region is listening on the port you expect it to.
    • Consider deploying a simple webapp in each J2EE application server that consists of nothing more than a static HTML page packaged in a WAR file. Have the name of the HTML file match the name of your J2EE application server instance, and set the context root to indicate the server instance in which the dummy application is deployed. You may then point your browser at this static HTML page and if the page gets served out (beware of browser cache, please), you validate that the pieces of the system allow your test request to flow all the way to the web container and allow at least a static page to be served out. That allows you to rule out as the cause of error many of the other pieces and focus just on that piece of the puzzle when a URL hits the web container. This test works equally well whether the Plugin or the Transport Handler is being used.


Alternative

AThe essential message here is to start slow, get some experience under your belt, then progress to the more complicated configurations. As you configure your runtime environment, you will find that there are multiple choices available. In some cases, configuring both HTTP Listeners could be very problematic. This is especially true if you are just getting started with the WebSphere Application Server for z/OS and OS/390. Throughout the Recommendation section above, several alternatives and their implications are presented.


Resources

About the author

Don Bagwell is with the IBM Washing Systems Center.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=13158
ArticleTitle=Best Practice: Configuring Web applications on WebSphere Application Server for z/OS and OS/390
publish-date=05132002
author1-email=dbagwell@us.ibm.com
author1-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers