2014-05-08 41 views
0

我想集群我的Web应用程序在JBoss 7.为此,我在Jboss7前使用Apache Web服务器,并使用mod_cluster。下面是我的配置在httpd.confJboss7集群问题与Apache Web服务器

`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独立-全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主页而不是重定向到我的Web应用程序主页 http://10.1.7.117:8080

我怀疑,因为我的应用程序没有可能是问题的上下文根。所以,当我在我的web应用程序中添加一个上下文根并使用 http://10.1.7.117:10001/demo-web 访问它时,它显示了我的应用程序网页,但图像/ CSS/JS没有加载。

如果有人有一个想法,请在此协助我。谢谢

回答

0

您是否取消注释httpd.conf文件中的servername parmater并提供服务器的主机名,默认情况下该主机名已注释掉。我将下面的配置块包含在内。 默认情况下,粘性会话在Jboss中配置为true,从而将所有请求强制执行到单个服务器。将sticky-session =“false”参数添加到您提到的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