gpt4 book ai didi

apache - 403 尝试访问/mod_cluster-manager 时?

转载 作者:行者123 更新时间:2023-12-02 03:18:40 26 4
gpt4 key购买 nike

我正在运行带有 Apache 2.4.6 的 CentOS 7。我正在尝试使用 mod_cluster 1.2.6 创建 Wildfly/JBoss 集群。我已经在 Mac OSX 上成功完成了此任务,并且只是尝试在我们的服务器环境中启动并运行它。

我的集群和虚拟主机配置如下所示:

 LoadModule slotmem_module       modules/mod_slotmem.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
LoadModule manager_module modules/mod_manager.so

MemManagerFile /var/cache/httpd

<VirtualHost *:80>

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

KeepAliveTimeout 60
MaxKeepAliveRequests 0
ManagerBalancerName myBalancer
ServerAdvertise On
AdvertiseFrequency 3
EnableMCPMReceive

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

服务器启动正常,但是当我尝试访问 http://localhost/mod_cluster-manager 时,我收到 403 消息,表示权限被拒绝。这是我的 error_log 文件中的确切消息:

[Wed Jul 30 11:53:21.547109 2014] [authz_core:error] [pid 6012] [client 127.0.0.1:36425] AH01630: client denied by server configuration: /mod_cluster-manager

我在 OSX 上运行时没有遇到任何此类问题,所以我不完全确定问题是什么或为什么我得到 403。据我了解,Allow from all 指令应该足以在通过本地主机连接时授予我访问权限。还有其他人遇到过类似的事情吗?我错过了什么吗?

最佳答案

关于配置

是的,但是修复是一个微不足道的修复:Apache HTTP Server 2.4.x 采用 mod_authz 系统,需要稍微不同的配置,例如:仅允许来自内部网络 10.10 的 EnableMCPMReceive 事件 VirtualHost 中来自工作节点的 MCMP 消息:

<Directory />
Require ip 10.10.
</Directory>

或者为了开发更方便:

<Directory />
Require all granted
</Directory>

无论如何,这是 Apache HTTP Server 2.4.x 的默认配置示例之一:

# Load mod_cluster modules
# Please, note:
# - mod_cluster cannot coexist with proxy_balancer_module; disable it
# - mod_cluster needs proxy_module and proxy_ajp_module loaded for AJP transport

LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule advertise_module modules/mod_advertise.so

# Place for slotmem files
MemManagerFile cache/mod_cluster

<IfModule manager_module>
## We suggest to use a restricted VirtualHost
## for receiving MCPM (Mod Cluster Protocol Message) from worker nodes.
Listen 6666
<VirtualHost *:6666>
<Directory />
Require ip 127.0.0.1
</Directory>
## Apache HTTP Server advertises its presence
## on 224.0.1.105:23364 by default.
ServerAdvertise on
EnableMCPMReceive

## Management and monitoring console
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Require ip 127.0.0.1
</Location>
</VirtualHost>
</IfModule>

关于mod_cluster版本

请注意,mod_cluster 1.2.6.Final 已过时,它包含多个与性能和安全相关的错误,这些错误已在新版本中修复。

一定下载mod_cluster 1.3.1.Final binaries或使用mod_cluster 1.3.1.Final Apache HTTP Server enabled load balancer Docker image 。您也可以自己编译模块; Dockerfile内容可能会指导您了解 Linux 环境。

关于apache - 403 尝试访问/mod_cluster-manager 时?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25041585/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com