• 绍兴印染布质量比对成果发布 部分指标国际领先 2019-07-11
  • 陕西守艺人丨一场大火后,她带领600羌州绣娘从头开始 2019-07-11
  • 今日武汉中考考生可看考点考场 进行英语听力试听 2019-07-08
  • 中方坚决捍卫国家利益和人民利益 2019-07-08
  • "创造101"杨超越引争议 表演业余人气高别光怨选手 2019-07-07
  • 风水神话的回帖除了对我的攻击以外吗,别的还有什么吗? 2019-06-21
  • 通过学历教育、职业培训、在线学习等渠道 新区居民将享天津职教资源 2019-06-17
  • 千名新疆学子的梦想在鄱湖之滨启航 2019-06-13
  • 晋冀鲁豫人民日报印刷厂的组建与迁徙 2019-06-01
  • 高清图集:习近平在山东考察 2019-05-28
  • 让海淀城市“名片”更闪亮 2019-05-28
  • 轻生活,做不一样的自己 2019-05-27
  • 【理上网来·辉煌十九大】德国北威州经济部长:十九大报告表明中国有能力为世界做出更多贡献 2019-05-27
  • 端午出行怕拥堵 别慌,这里有一份出行指南 2019-05-24
  • 空军飞行学员展开高强度实战打靶 消耗千余枚弹药 2019-05-24
  • 
      The Apache Tomcat Servlet/JSP Container

    akk十三水编程:Apache Tomcat 7

    Version 7.0.68, Feb 8 2016
    Apache Logo

    qq游戏里有十三水这个游戏吗 www.tdgb.net Links

    User Guide

    Reference

    Apache Tomcat Development

    Proxy Support HOW-TO

    Table of Contents
    Introduction

    Using standard configurations of Tomcat, web applications can ask for the server name and port number to which the request was directed for processing. When Tomcat is running standalone with the HTTP/1.1 Connector, it will generally report the server name specified in the request, and the port number on which the Connector is listening. The servlet API calls of interest, for this purpose, are:

    • ServletRequest.getServerName(): Returns the host name of the server to which the request was sent.
    • ServletRequest.getServerPort(): Returns the host name of the server to which the request was sent.
    • ServletRequest.getLocalName(): Returns the host name of the Internet Protocol (IP) interface on which the request was received.
    • ServletRequest.getLocalPort(): Returns the Internet Protocol (IP) port number of the interface on which the request was received.

    When you are running behind a proxy server (or a web server that is configured to behave like a proxy server), you will sometimes prefer to manage the values returned by these calls. In particular, you will generally want the port number to reflect that specified in the original request, not the one on which the Connector itself is listening. You can use the proxyName and proxyPort attributes on the <Connector> element to configure these values.

    Proxy support can take many forms. The following sections describe proxy configurations for several common cases.

    Apache 1.3 Proxy Support

    Apache 1.3 supports an optional module (mod_proxy) that configures the web server to act as a proxy server. This can be used to forward requests for a particular web application to a Tomcat instance, without having to configure a web connector such as mod_jk. To accomplish this, you need to perform the following tasks:

    1. Configure your copy of Apache so that it includes the mod_proxy module. If you are building from source, the easiest way to do this is to include the --enable-module=proxy directive on the ./configure command line.
    2. If not already added for you, make sure that you are loading the mod_proxy module at Apache startup time, by using the following directives in your httpd.conf file:
      
      LoadModule proxy_module  {path-to-modules}/mod_proxy.so
      AddModule  mod_proxy.c
      
    3. Include two directives in your httpd.conf file for each web application that you wish to forward to Tomcat. For example, to forward an application at context path /myapp:
      
      ProxyPass         /myapp  //localhost:8081/myapp
      ProxyPassReverse  /myapp  //localhost:8081/myapp
      
      which tells Apache to forward URLs of the form //localhost/myapp/* to the Tomcat connector listening on port 8081.
    4. Configure your copy of Tomcat to include a special <Connector> element, with appropriate proxy settings, for example:
      
      <Connector port="8081" ...
                    proxyName="www.mycompany.com"
                    proxyPort="80"/>
      
      which will cause servlets inside this web application to think that all proxied requests were directed to www.mycompany.com on port 80.
    5. It is legal to omit the proxyName attribute from the <Connector> element. If you do so, the value returned by request.getServerName() will by the host name on which Tomcat is running. In the example above, it would be localhost.
    6. If you also have a <Connector> listening on port 8080 (nested within the same Service element), the requests to either port will share the same set of virtual hosts and web applications.
    7. You might wish to use the IP filtering features of your operating system to restrict connections to port 8081 (in this example) to be allowed only from the server that is running Apache.
    8. Alternatively, you can set up a series of web applications that are only available via proxying, as follows:
      • Configure another <Service> that contains only a <Connector> for the proxy port.
      • Configure appropriate Engine, Host, and Context elements for the virtual hosts and web applications accessible via proxying.
      • Optionally, protect port 8081 with IP filters as described earlier.
    9. When requests are proxied by Apache, the web server will be recording these requests in its access log. Therefore, you will generally want to disable any access logging performed by Tomcat itself.

    When requests are proxied in this manner, all requests for the configured web applications will be processed by Tomcat (including requests for static content). You can improve performance by using the mod_jk web connector instead of mod_proxy. mod_jk can be configured so that the web server serves static content that is not processed by filters or security constraints defined within the web application's deployment descriptor (/WEB-INF/web.xml).

    Apache 2.0 Proxy Support
    The same instructions hold true as for 1.3. (Except in Apache 2.0, you may omit AddModule mod_proxy.c)
    Comments

    Notice: This comments section collects your suggestions on improving documentation for Apache Tomcat.

    If you have trouble and need help, read Find Help page and ask your question on the tomcat-users qq游戏里有十三水这个游戏吗. Do not ask such questions here. This is not a Q&A section.

    The Apache Comments System is explained here. Comments may be removed by our moderators if they are either implemented or considered invalid/off-topic.


    Copyright © 1999-2016, Apache Software Foundation
  • 绍兴印染布质量比对成果发布 部分指标国际领先 2019-07-11
  • 陕西守艺人丨一场大火后,她带领600羌州绣娘从头开始 2019-07-11
  • 今日武汉中考考生可看考点考场 进行英语听力试听 2019-07-08
  • 中方坚决捍卫国家利益和人民利益 2019-07-08
  • "创造101"杨超越引争议 表演业余人气高别光怨选手 2019-07-07
  • 风水神话的回帖除了对我的攻击以外吗,别的还有什么吗? 2019-06-21
  • 通过学历教育、职业培训、在线学习等渠道 新区居民将享天津职教资源 2019-06-17
  • 千名新疆学子的梦想在鄱湖之滨启航 2019-06-13
  • 晋冀鲁豫人民日报印刷厂的组建与迁徙 2019-06-01
  • 高清图集:习近平在山东考察 2019-05-28
  • 让海淀城市“名片”更闪亮 2019-05-28
  • 轻生活,做不一样的自己 2019-05-27
  • 【理上网来·辉煌十九大】德国北威州经济部长:十九大报告表明中国有能力为世界做出更多贡献 2019-05-27
  • 端午出行怕拥堵 别慌,这里有一份出行指南 2019-05-24
  • 空军飞行学员展开高强度实战打靶 消耗千余枚弹药 2019-05-24
  • 爱彩乐彩票下载 25选5开奖结果今晚i 3d军团彩票论坛 un联众彩票平台 qq游戏欢乐升级外挂 88369通比牛牛技巧 排列五走势图500期走势图 北京赛车pk10彩票控 浙江体彩6十1兑奖图 余姚福利彩票销售网点 北京11选5号怎么中奖的 博彩集团二肖中特 北京十一选五软件下载 三肖两码中特 湖南幸运赛车大小走势