无法连接到 RHEL6 上的 Apache 服务器

发布于 2024-12-04 21:00:34 字数 1275 浏览 4 评论 0原文

问题

现在,我已经是 Apache 的新手了,我当然需要一些帮助来解决我当前的问题。我已经在 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 服务。

The issue

Now, I am a complete n00b on Apache, and I could certainly use some help with my current issue. I have installed the httpd rpm's on 3 different systems (all Advantech computers, 1 Box PC, 1 Advanced TCA blade, 1 Compact PCI blade, and all have RHEL6 installed). I have configured Apache with files used earlier, on other installations. When I issue the command

# service httpd restart

All goes well and I get this output:

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  ]

Now, when I try to connect to the machine via Apache, I get the log-in screen asking for the username and password, as you would expect. However, it fails to log-in. When I look at the error_log in /var/log/httpd/, it shows this error message:

[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

It seems to me that this is either a configuration error, or it has something to do with permissions. Yet I can't seem to find out which. Another interesting fact is, that this only applies to the last two installations(Advanced TCA & Compact PCI), and not the first (Box PC), while all 3 installations are exactly the same.

Additional Info

The way I installed it was install httpd from yum,

# yum install httpd

Next install mod_auth_pam, which is needed by the configuration,

# yum install mod_auth_pam

Then I configured Apache with the files I got from previous installations (which basically is just replacing the configuration files from the standard Apache install), and after that I restarted the Apache service.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

临风闻羌笛 2024-12-11 21:00:34

对于此错误“apr_sockaddr_info_get() failed”,

您需要正确设置主机名。

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

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

For this error "apr_sockaddr_info_get() failed"

You need to properly set your hostname.

hostname actual-non-expired-domain-name.com

Don't forget to set the name in your httpd.conf and in /etc/hosts as well.

自此以后,行同陌路 2024-12-11 21:00:34

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

semanage permissive -a http_t

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

I have been able to solve this by setting SELinux to allow Apache requests. This is done by issuing the following command:

semanage permissive -a http_t

Semanage is a utility from the policycoreutils-python package. This should come with the installation medium.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文