日期:2014-05-16  浏览次数:20865 次

Apache 反向代理配置与Jetty配置

?在配置文件httpd.conf最后添加

?

<IfModule mod_proxy.c>
    ProxyRequests Off
    ProxyPreserveHost On    
    ProxyErrorOverride On                                #* java_app_err_thorw_to_httpd  *#
    
    <Directory proxy:*>
        Order deny,allow
        Allow from all
    </Directory>

    ProxyPass /r http://localhost:8080/r #*min=1 smax=5 ttl=600 timeout=100*#

    ProxyPass / http://localhost:8080/
    
    SetEnv force-proxy-request-1.0 1
    SetEnv proxy-nokeepalive 1
    
</IfModule>
?

?

为了让Jetty不直接暴露http服务

?

?

 <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">

            <Set name="host"><Property name="jetty.host" default="localhost"></Property></Set>
            <Set name="port"><Property name="jetty.port" default="${bpmhelp_app_port}"/></Set>
            <Set name="maxIdleTime">20000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="acceptQueueSize">256</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
	    <Set name="lowResourcesConnections">250</Set>
	    <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>
?

?

去掉 ??

? <Set name="host"><Property name="jetty.host" default="localhost"></Property></Set>

就可以直接访问jetty的服务

?