Configure IBMHTTPSERVER and WebSphereApplicationServer Connection Optimization Application Server Performance

zhaozj2021-02-16  56

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"%>

index.jsp </ title></p> <p></ HEAD></p> <p><Body></p> <p><p> <img src = "images / cz.jpg"> </ img></p> <p><p> <a href = "in.html"> Static HTML </ a></p> <p><%</p> <p>Out.println ("<p> This is dynamic output! </ p>");</p> <p>%></p> <p></ Body></p> <p></ Html></p> <p>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.</p> <p>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:</p> <p>HelloWorldearProject.ear</p> <p>Restart IHS and WAS after publishing and updating the plugin in WAS. in:</p> <p>D: /websphere511/websphere/appserver/installedapps/abnerchai/helloWorldearProject.ear</p> <p>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).</p> <p>At this time we can do this, in:</p> <p>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:</p> <p>This is the directory of IBM HTTP Server</p> <p>This is the directory of IBM WebSphere Application Server (after release).</p> <p>Copyright</p> <p>Copyright by Abnerchai, 2004. You Can CAN Contact Me At: abnerrtsai@sina.com</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-21111.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="21111" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.046</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'aDBvz00L3pJeUfdxVyD8kTnk3i2_2FC6PxQmjLXW6mNzYCde1kf7sI5y55y05UDeuh10E5gI0fAjt7eD7iYl_2FQFQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>