2017-04-13 44 views
1

mod_cluster를 Wildfly 9의 역방향 프록시로 설정하려고합니다. mod_cluster와 Wildfly 사이의 프로토콜로 http를 사용하면 모든 것이 잘 동작합니다 (애플리케이션 서버로의 요청 전달 및 서버 감지).mod_cluster를 사용하여 아파치와 Widfly 연결하기

ajp를 프로토콜로 사용하여 mod_cluster와 wildfly를 연결할 때 내 문제가 발생합니다. mod_cluster-manager를 확인했는데 mod_cluster가 wildfly에 연결되어 있지만 응용 프로그램 서버에 요청을 전달할 수 없습니다.

나는 다음과 같은 구성을 가지고

  • http 서버 : 아파치/2.4.18 (우분투)
  • 애플리케이션 서버 : 제이보스 9.0.2
  • mod_cluster : 1.3

mod_cluster .conf

PersistSlots on 
CreateBalancers 1 
MemManagerFile /opt/mod_cluster/logs 


EnableOptions 
AllowDisplay On 
AllowCmd On 
WaitForRemove 1 



UseAlias 1 
ServerAdvertise Off 

Listen *:5555 
<VirtualHost *:5555> 
    <Directory /> 
     Order deny,allow 
     Allow from 192.168.0.71 
     Allow from 192.168.0.71 
     Allow from 127 
     Require all granted 
    </Directory> 
    <Location /mcm> 
     SetHandler mod_cluster-manager 
     Allow from 192.168 
     Allow from all 
    </Location> 
    KeepAliveTimeout 300 
    MaxKeepAliveRequests 0 
    ManagerBalancerName mycluster 
    #AdvertiseFrequency 5 
    EnableMCPMReceive 

</VirtualHost> 



<VirtualHost *:80> 

    ServerName my-app.org 
    ServerAlias my-app.org 
    ErrorLog /var/log/apache2/user.error.log 
    LogLevel warn 
    CustomLog /var/log/apache2/my_app.access.log combined 
    ServerSignature On 

    Redirect "/" https://my-app.org 
    ProxyPreserveHost On 
    SSLProxyEngine On 
    ProxyPreserveHost On 
    #ProxyPass /_error ! 
    #ProxyPass/balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=on 
    #ProxyPassReverse/balancer://mycluster 


    <Location /> 
     Order deny,allow 
     Allow from all 
    </Location> 

</VirtualHost> 

<VirtualHost *:443> 

    ServerName my-app.org 
    ServerAlias my-app.org 
    SSLEngine on 
    SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem 
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key 
    ErrorLog /var/log/apache2/user.ssl.error.log 
    LogLevel warn 
    CustomLog /var/log/apache2/my_app.ssl.access.log combined 
    ServerSignature On 

    SSLProxyEngine On 
    ProxyPreserveHost On 
    ProxyPass /_error ! 
    ProxyPass/balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=on 
    ProxyPassReverse/balancer://mycluster 
    <Location /> 
     Order deny,allow 
     Allow from all 
    </Location> 
</VirtualHost> 

제이보스 구성 (관련 단편)

mod_cluster 서브 시스템 :

<subsystem xmlns="urn:jboss:domain:modcluster:2.0"> 
     <mod-cluster-config advertise-socket="modcluster" 
          proxies="mc-prox1" 
          advertise="false" 
          sticky-session-force="true" load-balancing-group="mycluster" connector="ajp"> 
      <dynamic-load-provider> 
       <load-metric type="cpu"/> 
      </dynamic-load-provider> 
     </mod-cluster-config> 
    </subsystem> 

발신 소켓 결합 :

<outbound-socket-binding name="mc-prox1"> 
     <remote-destination host="192.168.0.71" port="5555"/> 
    </outbound-socket-binding> 

[EDIT]

I 포함해야 AJP 구성 :

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:1500}"> 
    <socket-binding name="ajp" port="${jboss.ajp.port:0}" /> 
....... 
</socket-binding-group> 

[EDIT2]

ajp 포트를 8009로 설정하면 작동합니다. 맞춤 포트 번호를 사용하고 싶습니다. 누구나 어떻게해야하는지 실마리가 있습니까?

답변

0

잘못된 바이너리가 있음이 드러났습니다. /. 공식 웹 사이트의 내용으로 교체 한 후 AJP를 통해 Apache와 Wildfly를 연결했습니다.