Apache Web服务器的Jboss7群集问题

时间:2014-05-08 11:27:51

标签: jboss mod-cluster

我想在jboss 7中集群我的web应用程序。为此我在Jboss7前使用Apache webserver并使用mod_cluster。下面是我在httpd.conf中的配置

`LoadModule authz_host_module modules/mod_authz_host.so
 LoadModule proxy_module modules/mod_proxy.so
 LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
 LoadModule proxy_http_module modules/mod_proxy_http.so
 LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
 LoadModule manager_module modules/mod_manager.so
 LoadModule slotmem_module modules/mod_slotmem.so
 LoadModule advertise_module modules/mod_advertise.so

 Listen  10.1.7.117:90
 Listen  10.1.7.117:10001

<VirtualHost 10.1.7.117:10001>
 <Location />
  Order deny,allow
  Deny from all
  Allow from all      
 </Location>

    KeepAliveTimeout 300
    MaxKeepAliveRequests 0
    #ServerAdvertise on  http://127.0.0.1:6666    
    AdvertiseFrequency 5
    AdvertiseSecurityKey DEV_Cluster
    AdvertiseGroup 224.0.1.105:23364
    EnableMCPMReceive

    <Location /mod_cluster_manager>
       SetHandler mod_cluster-manager
       Order deny,allow
       Deny from all
       Allow from all
   </Location>
  </VirtualHost>

在Jboss 7 standalone-full-ha.xml中,我添加了以下内容:

'<subsystem xmlns="urn:jboss:domain:modcluster:1.0">
        <mod-cluster-config advertise-socket="modcluster" proxy-list="10.1.7.117:10001" advertise="true" advertise-security-key="Dev_Cluster">
            <dynamic-load-provider>
                <load-metric type="busyness"/>
            </dynamic-load-provider>
        </mod-cluster-config>
    </subsystem>

现在启动Apache和Jboss7(我只启动一个实例进行测试)后,我可以访问以下内容:     http://10.1.7.117:10001/mod_cluster_manager

但我只是访问     http://10.1.7.117:10001它显示了Apache主页&#34;它有效!&#34;而不是重定向到我的Web应用程序主页     http://10.1.7.117:8080

我怀疑是因为我的应用程序没有可能成为问题的上下文根。因此,当我在我的Web应用程序中添加上下文根并使用它访问它时     http://10.1.7.117:10001/demo-web 它向我展示了应用程序网页,但是images / CSS / JS没有加载!!。

如果有人有想法,请在此帮助我。感谢

1 个答案:

答案 0 :(得分:0)

您是否取消注释httpd.conf文件中的servername parmater并提供服务器的主机名,默认情况下已注释掉该主机名。我在下面列出了这个配置块。 默认情况下,粘性会话在Jboss中配置为true,强制执行对单个服务器的所有请求。添加sticky-session =&#34; false&#34;您提到的stanalone-ha.xml文件中以下行的参数。

<mod-cluster-config advertise-socket="modcluster" proxy-list="10.1.7.117:10001"    advertise="true" advertise-security-key="Dev_Cluster" sticky-session="false">

希望这有帮助。

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName hostname
相关问题