| 网站首页 | JAVA文章 | AppServers | Web开发 | 应用开发 | 资源下载 | 论坛
    想学好编程,学好英语很重要  [enadd  2006年12月25日]        
设为首页 加入收藏 联系站长
您现在的位置: 编程笔记网 >> AppServers >> WebSphere >> WebSphere基础 >> 文章正文
[组图]websphere如何分离静态和动态web内容            【字体:
websphere如何分离静态和动态web内容
作者:-    文章来源:-    点击数:    更新时间:2006-4-26

This tip describes how to separate static content from a WebSphere application
so it can be served by the Web server instead of the application server.

Separating static and dynamic Web
content

Separating your static Web content
(HTML, GIF, CSS files, etc.) and dynamic Web content (servlets and JSPs) allows
processing capacity to be split between the Web server and application server.
You can then allocate capacity between the two based on the amount of dynamic
and static content in your site. If your site serves mostly static content, it
is more cost effective to add more Web servers than it is to add more
application servers.


To separate a Web
application's static and dynamic Web content:

  • Disable the WebSphere file-serving feature
    in the Web module:

    • Start the Application Assembly Tool
      (AAT), for example:

      <WAS_HOME>/bin/assembly
    • Select File -> Open... from the AAT main
      menu and open the enterprise archive (EAR) file.

    • Select the required Web module in the
      navigation tree on the left. Click the
      IBM
      Extensions
      tab on the right, then un-check
      the
      File serving enabled option, as shown in the figure below. Click Apply.


此主题相关图片如下:
按此在新窗口浏览图片

    • Save your changes and exit AAT.
  • Install the updated EAR file on your application server machine.
    • You can do this using the WebSphere Administrative Console, or wsadmin.
  • Copy the plug-in configuration file (<WAS_HOME>/config/cells/plugin-cfg.xml) to the remote Web server machine.

    This is the plugin-cfg.xml entry when the WebSphere file serving feature is enabled:
      <UriGroup Name="default_host_server1_appsrv1l_Cluster_URIs">
      ...
      <Uri AffinityCookie="JSESSIONID" Name="/itsobank/*"/>
      </UriGroup>
    WebSphere will serve all URIs starting with /itsobank/....
    Now that we have disabled the file-serving feature of WebSphere, only JSP and servlet URIs are served by the application server. Regenerating the plug-in configuration updates the plugin-cfg.xml entry as follows:
      <UriGroup Name="default_host_server1_appsrv1l_Cluster_URIs">
      ...
      <Uri AffinityCookie="JSESSIONID" Name="/itsobank/servlets/Transfer"/>
      <Uri AffinityCookie="JSESSIONID" Name="/itsobank/servlets/JMSTransfer"/>
      <Uri AffinityCookie="JSESSIONID" Name="/itsobank/*.jsp"/>
      <Uri AffinityCookie="JSESSIONID" Name="/itsobank/*.jsv"/>
      <Uri AffinityCookie="JSESSIONID" Name="/itsobank/*.jsw"/>
      <Uri AffinityCookie="JSESSIONID" Name="/itsobank/j_security_check"/>
      <Uri AffinityCookie="JSESSIONID" Name="/itsobank/servlet/*"/>
      </UriGroup>

    WebSphere has intelligently updated the plug-in file to let the Web server serve static content. The Web server passes dynamic URIs for servlets and JSPs back to WebSphere.
  • Next we need to set up the Web server to serve the application's static content.
    • First, extract the static content from the application archive and copy it to the Web server.
      • Tip: To prevent errors and to make the process repeatable, it is best to use some type of script to extract and deploy the static content to the Web server. Alternatively, intelligent content management software can be used to automatically route documents around the network when they are updated.
    • Next, add an alias for the application's static content folder to the IBM HTTP Server configuration:
      • Open the <IHS_HOME>/conf/httpd.conf file in an editor and add the required alias to the end of the file, for example:
        Alias /itsobank/ "C:/IBMHttpServer/htdocs/itsobank"
      • Save your changes.
    • Restart the IBM HTTP Server.
  • Try out the application from your browser.

    The Web server should serve the static content. If you stop the application server, you should still get the static pages from the Web server, but servlets or JSPs can’t be accessed.

[1] [2] [3] 下一页  

文章录入:enadd    责任编辑:enadd 
  • 上一篇文章:

  • 下一篇文章: 没有了
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  • 管理Websphere的10个有用命令…

  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 管理登录 |