2017-04-13 12 views
1

mod_clusterをWildfly 9のリバースプロキシとして設定しようとしています。(mod_clusterとWildflyの間の)プロトコルとしてhttpを使用すると、アプリケーションサーバーと検出サーバー)。mod_clusterを使用したApacheとWidflyの接続

ajpをプロトコルとして使用してmod_clusterとwildflyを配線しようとすると、私の問題が発生します。 mod_cluster-managerを確認したところ、 mod_clusterがwildflyに接続されていたようですが、アプリケーションサーバに リクエストを転送できませんでした。

私は、以下の構成を持っている:

  • httpサーバ:Apacheの/ 2.4.18(Ubuntuの)
  • アプリケーションサーバ:Wildfly 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> 

Wildfly構成(関連断片):

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]

私は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> 

[編集2]

ajpポートを8009に設定すると動作します。私はカスタムポート番号を使いたい。 誰かがそれを行う方法の手がかりを持っていますか?

答えて

0

私には間違ったバイナリがありました。オフィシャルウェブサイトのものと入れ替えると、WildflyとAJPを使ってApacheと接続することができました。

関連する問題