• 水费欠账竟“穿越”16年?用户质疑:为何没见催缴过? 2019-09-11
  • 青海学习十九大精神嵌套页面--青海频道--人民网 2019-09-11
  • 图片报道:江西省峡江县举行公共租赁住房钥匙发放仪式 2019-09-09
  • 机器人正在敲响未来生活的“大门” 2019-09-09
  • 香蕉-热门标签-华商生活 2019-08-20
  • 更聪明、更可靠、更低价 广汽传祺全新GS4上市 2019-07-30
  • 社会主要矛盾的转化规律及其政策取向 2019-07-30
  • 为太原人才新政点赞! 2019-07-27
  • 坚定不移全面深化改革 2019-07-19
  • 全运有约:李冰洁谈个人参赛感受和训练生活 2019-07-19
  • 魏晨:与女友感情稳定 有结婚计划会第一时间公开 2019-07-17
  • 绍兴印染布质量比对成果发布 部分指标国际领先 2019-07-11
  • 陕西守艺人丨一场大火后,她带领600羌州绣娘从头开始 2019-07-11
  • 今日武汉中考考生可看考点考场 进行英语听力试听 2019-07-08
  • 中方坚决捍卫国家利益和人民利益 2019-07-08
  • 
      The Apache Tomcat Servlet/JSP Container

    决战十三水: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
  • 水费欠账竟“穿越”16年?用户质疑:为何没见催缴过? 2019-09-11
  • 青海学习十九大精神嵌套页面--青海频道--人民网 2019-09-11
  • 图片报道:江西省峡江县举行公共租赁住房钥匙发放仪式 2019-09-09
  • 机器人正在敲响未来生活的“大门” 2019-09-09
  • 香蕉-热门标签-华商生活 2019-08-20
  • 更聪明、更可靠、更低价 广汽传祺全新GS4上市 2019-07-30
  • 社会主要矛盾的转化规律及其政策取向 2019-07-30
  • 为太原人才新政点赞! 2019-07-27
  • 坚定不移全面深化改革 2019-07-19
  • 全运有约:李冰洁谈个人参赛感受和训练生活 2019-07-19
  • 魏晨:与女友感情稳定 有结婚计划会第一时间公开 2019-07-17
  • 绍兴印染布质量比对成果发布 部分指标国际领先 2019-07-11
  • 陕西守艺人丨一场大火后,她带领600羌州绣娘从头开始 2019-07-11
  • 今日武汉中考考生可看考点考场 进行英语听力试听 2019-07-08
  • 中方坚决捍卫国家利益和人民利益 2019-07-08
  • 快乐飞艇怎么计划 网络棋牌游戏 一头一尾中特 大乐透预测最准确的计算公式 广东快乐10分乐彩时彩 山东快乐扑克3开奖查询 3D组三复式金额 马后炮今天解太湖字谜汇总 家财网推荐号 双色球特等奖多少钱 做时时彩抓到了怎么办 伯爵棋牌平台 天天足球视频教程 支持比例 排列五重号走势图