apache+tomcat 集群后应用无法访问. 求解

calvary 发布于 2014/02/14 16:00
阅读 888
收藏 0

单独访问都可行。 即 单独访问apache 可以访问。 单独访问应用也是可以的。

但是 通过apache访问应用就提示 NOT FOUND..

 

 apache 2.4.7 +tomcat 6  + jdk1.6 

 Linux  已经开启组播功能.

 求大牛解惑.

tomcat  > service.xml配置如下

<Server port="8006" shutdown="SHUTDOWN">
  <Connector port="8090" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
   <Connector port="7080" protocol="AJP/1.3" redirectPort="8443" />
  <Engine name="Catalina" defaultHost="localhost" jvmRoute="jmb">
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
                 channelSendOptions="8">

          <Manager className="org.apache.catalina.ha.session.DeltaManager"
                   expireSessionsOnShutdown="false"
                   notifyListenersOnReplication="true"/>

          <Channel className="org.apache.catalina.tribes.group.GroupChannel">
            <Membership className="org.apache.catalina.tribes.membership.McastService"
                        address="228.0.0.4"
                        port="45564"
                        frequency="500"
                        dropTime="3000"/>
            <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                      address="auto"
                      port="4020"
                      autoBind="100"
                      selectorTimeout="5000"
                      maxThreads="6"/>

            <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
              <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
            </Sender>
            <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
            <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
          </Channel>

          <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
                 filter=""/>
          

          <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>

         
          <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
        </Cluster>



httpd.conf 配置如下

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_express_module modules/mod_proxy_express.so

Include conf/extra/httpd-vhosts.conf
ProxyRequests off
<proxy balancer://cluster>
BalancerMember ajp://10.1.11.58:6080 loadfactor=1 route=jma
BalancerMember ajp://10.1.11.58:7080 loadfactor=1 route=jmb
</proxy>



conf/extra/httpd-vhosts.conf 配置如下

<VirtualHost *:80>
    ServerAdmin guiyingxuan@163.com
    ServerName 10.1.11.58
    ServerAlias localhost
    ProxyPass / balancer://cluster/ stickysession=jsessionid nofailover=on
    ProxyPassReverse / balancer://cluster/
    ErrorLog "|bin/rotatelogs.exe -l logs/cluster-error-%Y-%m-%d.log 86400"
    CustomLog "|bin/rotatelogs.exe -l logs/cluster-access-%Y-%m-%d.log 86400" common
</VirtualHost>




加载中
返回顶部
顶部