简体   繁体   English

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

[英]Can't connect to Apache server on RHEL6

The issue 问题

Now, I am a complete n00b on Apache, and I could certainly use some help with my current issue. 现在,我对Apache完全满意,我当然可以在当前问题上使用一些帮助。 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). 我已经在3个不同的系统上安装了httpd rpm(所有研华计算机,1台Box PC,1台高级TCA刀片,1台Compact PCI刀片,并且都安装了RHEL6)。 I have configured Apache with files used earlier, on other installations. 我已经为Apache配置了先前在其他安装中使用的文件。 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. 现在,当我尝试通过Apache连接到计算机时,将出现登录屏幕,要求您输入用户名和密码。 However, it fails to log-in. 但是,它无法登录。 When I look at the error_log in /var/log/httpd/, it shows this error message: 当我查看/ 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

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. 另一个有趣的事实是,这仅适用于最后两个安装(高级TCA和Compact PCI),而不适用于第一个安装(Box PC),而所有三个安装都完全相同。

Additional Info 附加信息

The way I installed it was install httpd from yum, 我的安装方式是从yum安装httpd,

# yum install httpd

Next install mod_auth_pam, which is needed by the configuration, 下一步安装配置所需的mod_auth_pam,

# 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. 然后,我使用从先前安装中获得的文件配置了Apache(基本上只是替换了标准Apache安装中的配置文件),然后重新启动了Apache服务。

For this error "apr_sockaddr_info_get() failed" 对于此错误“ apr_sockaddr_info_get()失败”

You need to properly set your hostname. 您需要正确设置主机名。

hostname actual-non-expired-domain-name.com 主机名实际非过期域名.com

Don't forget to set the name in your httpd.conf and in /etc/hosts as well. 不要忘记在httpd.conf和/ etc / hosts中设置名称。

I have been able to solve this by setting SELinux to allow Apache requests. 我可以通过将SELinux设置为允许Apache请求来解决此问题。 This is done by issuing the following command: 通过发出以下命令来完成此操作:

semanage permissive -a http_t

Semanage is a utility from the policycoreutils-python package. Semanage是来自policycoreutils-python软件包的实用程序。 This should come with the installation medium. 该介质应随安装介质一起提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM