0

问题

现在,我是 Apache 上的一个完整的 n00b,我当然可以在我当前的问题上使用一些帮助。我已经在 3 个不同的系统上安装了 httpd rpm(所有 Advantech 计算机、1 台 Box PC、1 个 Advanced TCA 刀片、1 个 Compact PCI 刀片,并且都安装了 RHEL6)。我已经使用之前在其他安装中使用的文件配置了 Apache。当我发出命令时

# service httpd restart

一切顺利,我得到了这个输出:

Stopping httpd: [  OK  ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for <PC_Name>
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[  OK  ]

现在,当我尝试通过 Apache 连接到机器时,我得到了登录屏幕,要求输入用户名和密码,正如您所期望的那样。但是,它无法登录。当我查看 /var/log/httpd/ 中的 error_log 时,它会显示以下错误消息:

[Thu Sep 15 14:24:40 2011] [error] [client 192.168.10.175] (13)Permission denied: Could not open password file: /etc/shadow
[Thu Sep 15 14:24:40 2011] [error] [client 192.168.10.175] PAM: user 'root' - not authenticated: System error

在我看来,这要么是配置错误,要么与权限有关。但我似乎无法找出哪个。另一个有趣的事实是,这只适用于最后两个安装(Advanced TCA 和 Compact PCI),而不是第一个(Box PC),而所有 3 个安装完全相同。

附加信息

我安装它的方式是从 yum 安装 httpd,

# yum install httpd

接下来安装配置所需的mod_auth_pam,

# yum install mod_auth_pam

然后我使用从以前的安装中获得的文件配置 Apache(基本上只是替换标准 Apache 安装中的配置文件),然后我重新启动了 Apache 服务。

4

2 回答 2

1

对于这个错误“apr_sockaddr_info_get() failed”

您需要正确设置主机名。

主机名实际未过期域名.com

不要忘记在 httpd.conf 和 /etc/hosts 中设置名称。

于 2011-09-15T15:36:15.150 回答
0

我已经能够通过将 SELinux 设置为允许 Apache 请求来解决这个问题。这是通过发出以下命令来完成的:

semanage permissive -a http_t

Semanage 是 policycoreutils-python 包中的一个实用程序。这应该随安装介质一起提供。

于 2011-09-28T11:51:48.237 回答