我有一个centos VM和httpd -v给我输出
Server version: Apache/2.2.15 (Unix)
Server built: Oct 16 2014 14:48:21
我使用命令关闭服务器: sudo /etc/init.d/httpd stop
现在,当我尝试启动服务器时,出现以下错误:
Starting httpd: httpd: apr_sockaddr_info_get() failed for bslm-022.corp.day.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
no listening sockets available, shutting down
Unable to open logs
[FAILED]
我在线阅读的here是我应该在/etc/apache2/httpd.conf文件中添加ServerName localhost。 但我的VM上没有名为/ etc / apache2的目录。
/ etc / hosts文件的内容是:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
$ hostname命令的结果是:
bslm-022.corp.day.com
我希望apache服务器能够在localhost上运行。
答案 0 :(得分:1)
确保您的httpd.conf
中有“Listen 80”或/etc/httpd/conf.d/*
如果是,请查看netstat
以查看正在收听的内容
netstat -tunlp