我无法访问 mod_cluster-manager,并且我在 apache 中的 error.log 中收到以下错误
[Wed Jan 16 17:20:13 2013] [warn] module proxy_module is already loaded, skipping
[Wed Jan 16 17:20:13 2013] [notice] Advertise initialized for process 2410
[Wed Jan 16 17:20:13 2013] [notice] Apache/2.2.17 (Ubuntu) mod_cluster/1.2.0.Final PHP/5.3.5-1ubuntu7.8 with Suhosin-Patch configured -- resuming normal operations
[Wed Jan 16 17:27:22 2013] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state
[Wed Jan 16 17:27:23 2013] [warn] proxy: No protocol handler was valid for the URL /favicon.ico. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
我配置了 jboss Standalone 模式来启用 mod_cluster。我在standalone-ha.xml 的各自部分中添加了以下几行
<extension module="org.jboss.as.modcluster"/>
<subsystem xmlns="urn:jboss:domain:modcluster:1.0">
<mod-cluster-config advertise-socket="modcluster" advertise-security-key="secret"/>
</subsystem>
我下载了以下模块: mod_slotmem.so mod_manager.so mod_proxy_cluster.so mod_advertise.so
在http://downloads.jboss.org/mod_cluster//1.1.0.Final/mod_cluster-1.1.0.Final-linux2-x64-so.tar.gz然后把它放在 usr/lib/apache2/modules 中。
我在 /etc/apache2/mods-available 的 mod_cluster.load 中设置了以下内容。
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule proxy_ajp_module /usr/lib/apache2/modules/mod_proxy_ajp.so
LoadModule slotmem_module /usr/lib/apache2/modules/mod_slotmem.so
LoadModule manager_module /usr/lib/apache2/modules/mod_manager.so
LoadModule proxy_cluster_module /usr/lib/apache2/modules/mod_proxy_cluster.so
LoadModule advertise_module /usr/lib/apache2/modules/mod_advertise.so
我在 mod_cluster.conf 中设置了以下内容
CreateBalancers 1
<IfModule manager_module>
Listen 127.0.0.1:8082
ManagerBalancerName mycluster
<VirtualHost 127.0.0.1:8082>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
AdvertiseFrequency 5
ServerAdvertise On
<Location />
Order deny,allow
Allow from 127.0.0.1
</Location>
</VirtualHost>
</IfModule>
我通过执行 $ sudo a2enmod mod_cluster 启用模块
最后,我在 /etc/apache2/sites-available 的 jboss 中设置了以下内容
#NameVirtualHost *:80
<VirtualHost *:80>
#ServerAdmin info@domain.de
ServerName comitdev2
ServerAlias comitdev2
ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://mycluster
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from All
</Location>
<Location /mod_cluster-manager>
SetHandler mod_cluster-manager
Order deny,allow
#Deny from all
Allow from 127.0.0
</Location>
</VirtualHost>
最后,我禁用了 000-default 站点并启用了 jboss 站点
每次我访问本地主机时,我都会得到服务暂时不可用。
我正在使用 Ubuntu 11.04