Configure IBMHTTPSERVER and WebSphereApplicationServer Connection Optimization Application Server Performance
In this article, you can learn:
• What are the benefits of using IBM HTTP Server?
• How to configure IBM HTTP Server and IBM WebSphere Application Server connection
• How to publish an EAR package to optimize IBM WebSphere Application Server performance
• One example
Foreword
Everyone knows that IBM's WebSphereApplicationServer (abbreviated as WAS) is a corporate EJB container, which itself has fun functions such as EJB, Servlets, JSP, HTML, that is, the WAS itself has EJB containers and Webserver features.
Our simple WebServer such as IIS, Apache, IBM HTTP Server (IHS), which only has functions that handle the static HTML page, and does not have the function of the EJB container.
When we install the IBM WebSphere package, we can choose to install both WAS and IHS. They can be mounted on the same physical host, or they can be mounted on different hosts separately.
WAs are handled by Java input and output flows in handling static HTML pages and some picture files. IHS is modified based on Apache, which is a request for the user's static file with a C language. In contrast, the speed of IHS handles static files is fast. At the same time, if we can let the two connect it to a whole, it is transparent to the client user, so that the WAS makes the EJB container to process dynamic requests, let IHS handle static files, have the following benefits:
• IHS can process static requests at a faster speed, in many business applications, requests for HTML pages and requests for JSP / Server and the number of requests for background EJBs are reduced. In this case, IHS can be shared by the burden of WAS.
• IHS and WAS can be mounted on different physical hosts, which allows IHS to be in the DMZ area, allowing WAS to be protected, improve security. In particular, you can refer to other network topology.
• When enterprise applications increase, we need to use cluster technology to achieve load balancing, which may require multiple WAS nodes and manage them through ND (NetworkDeploymentManager). At this time, there must be an IHS to provide this distribution function in front. That is to say, IHS can be better prepared for future expansion.
Specifically, the connection of IHS and WAS is connected through a webserverplug-in. Their topologies can be shown below:
The above figure is clear enough to not explain.
Precondition
To connect IHS and WAS, we must select a custom installation when you install a WebSphere package, and select "Plug-in for IBM HTTP Server". At the same time, we need to install IHS and WAS. In this article, we are described in the same host with IHS and WAS.
With: WAS installation is below D: / WebSphere511 / WebSphere / AppServer.
IHS is installed under D: / WebSphere511 / IBMHTTPSERVER below.
Second, we need a WSAD work area that has not been packaged yet. When we finally package, we must perform some settings to meet the requirements. Note that this work area must be finally packaged in the work area. Before starting, we will start IHS and WAS first, enter:
Http: // localhost: 9080 / snoop / See if it is installed correctly
Ok, everything is good, let's see how to configure it.
Configuration steps
Use WSAD5 to start the workspace that will be packaged, enter the J2EE view of the development environment, double-click the web.xml file under the "Web Content" directory, enter the XML editor, select the extended page, as shown below Down:
In the above figure, the "Enable file service" is removed. save.
2. Packing the work area, output the system to the EAR package or output as a JAR package and WAR package.
3. Enter the WAS Management Workbench, configure J2C certification and JDBC data sources, and successfully release the EAR package just exported.
4. Select the "Environment" -> "Update Web Server Plugin" on the left of the WAS management table, and select "OK" on the right.
5, then exit the WAS management workbench, enter the WAS installation directory:
D: / WebSphere511 / WebSphere / AppServer / config / cells, confirming Plugin-cfg.xml in the directory is new generation.
6, enter the IHS installation directory: d: / WebSphere511 / ibmhttpserver / conf, and open it with the text editor
HTTPD.CONF file, move the cursor to the last line, confirm that the last two lines are:
LoadModule IBM_APP_SERVER_HTTP_MODULE "D: /WEBSPHERE511/websphere/appserver/bin/mod_ibm_app_server_http.dll"
WebSpherePluginConfig "D: /Websphere511/websphere/appserver/config/cells/plugin-cfg.xml"
That is to confirm that the two files point to the correct position, PLUGIN-CFG.xml points to it just generated.
At the same time, find two lines similar to:
# TIHS SHOULD BE CHANGED to WHATOR You Set Document To.
It can be seen that this line is where the root directory is set. You can modify it or you can do not modify it. For example, let's modify it here:
Note the path of the path separator above, at the same time, please create a directory myProject on D: / WebSphere511 / IBMHTTPSERVER / HTDOCS.
At the same time, find the DocumentRoot line and modify it to:
Document D: / WebSphere511 / IBMHTTPSERVER / HTDOCS / MyProject
This makes the root directory of the IHS point to this directory.
7. Newly started IHS and WAS.
8, enter the WAS installation directory:
D: / WebSphere511 / WebSphere / Appserver / InstalledApps / Abnerchai directory, where ABNERCHAI is a directory named by your host, find the EAR package directory just released under this directory and enters the x.war in this directory. In the catalog, you are stored in this directory, all of your HTML files and JSPs and other IMG files, etc., this directory is also rooted, copy all static files in this directory such as images directory, etc. The root directory. 9. Restart the IHS server:
Http://xxx.xxx.xxx/yourapplicationName/ to access your system.
Appendix: Example:
Now there is a JSP file in the Web Content directory in WSAD as follows:
<% @ page language = "java" contenttype = "text / html; charSet = GBK" PageEncoding = "GBK"%>
HEAD>
img>
<%
Out.println ("
This is dynamic output! p>");
%>
Body>
Html>
At the same time, there is an in.html file and an images directory in the web content directory, and there is a CZ.JPG file.
At the same time, there are some JavaBean and EJB in the workspace. After publishing the EAR package in the above way, the name is:
HelloWorldearProject.ear
Restart IHS and WAS after publishing and updating the plugin in WAS. in:
D: /websphere511/websphere/appserver/installedapps/abnerchai/helloWorldearProject.ear
In the directory, there is a HelloWorldWebProject.war directory, which contains Images Directory and In.html files, we can access it via http://localhost/heloworldwebproject/index.jsp (this could not see the picture and the static connection is incorrect, Because the WAS is set to do not process these static files).
At this time we can do this, in:
D: / WebSphere511 / IBMHTTPSERVER / HTDOCS / MyProject Directory New HelloWebProject Directory, copy the images directory and in .html to this directory. Finally, their directory structure is as follows:
This is the directory of IBM HTTP Server
This is the directory of IBM WebSphere Application Server (after release).
Copyright
Copyright by Abnerchai, 2004. You Can CAN Contact Me At: abnerrtsai@sina.com