httpd服务无法启动 /bin/systemctl start httpd.service

[root@austgl gl]# service httpd start
Redirecting to /bin/systemctl start httpd.service
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
[root@austgl gl]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: failed (Result: exit-code) since 六 2013-07-27 02:53:04 CST; 20s ago
Process: 5466 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=0/SUCCESS)
Process: 5463 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)

7月 27 02:53:04 austgl.com systemd[1]: Starting The Apache HTTP Server...
7月 27 02:53:04 austgl.com httpd[5463]: AH00557: httpd: apr_sockaddr_info_get() failed for austgl.com
7月 27 02:53:04 austgl.com httpd[5463]: AH00558: httpd: Could not reliably determine the server's fully qualified do...essage
7月 27 02:53:04 austgl.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
7月 27 02:53:04 austgl.com httpd[5466]: AH00557: httpd: apr_sockaddr_info_get() failed for austgl.com
7月 27 02:53:04 austgl.com httpd[5466]: AH00558: httpd: Could not reliably determine the server's fully qualified do...essage
7月 27 02:53:04 austgl.com httpd[5466]: httpd (no pid file) not running
7月 27 02:53:04 austgl.com systemd[1]: Failed to start The Apache HTTP Server.
7月 27 02:53:04 austgl.com systemd[1]: Unit httpd.service entered failed state.
[root@austgl gl]#
[root@austgl gl]# /usr/sbin/httpd $OPTIONS -DFOREGROUND
AH00557: httpd: apr_sockaddr_info_get() failed for austgl.com
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[root@austgl gl]#

解决方法
先查看hostname
[root@austgl sysconfig]# hostname
austgl.com

将hostname加入host文件即可

[root@austgl sysconfig]# vi /etc/host

127.0.0.1 austgl.com localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
~
[root@austgl sysconfig]# /usr/sbin/httpd $OPTIONS -DFOREGROUND

在打开localhost

OK了
上述命令开启的服务在Ctrl+C或关闭终端后就停止了服务 请用

[root@austgl sysconfig]# /usr/sbin/httpd $OPTIONS -DFOREGROUND
^C^C[root@austgl sysconfiservice httpd start
Redirecting to /bin/systemctl start httpd.service
[root@austgl sysconfig]#

抓图2

抓图3

未经允许不得转载:ganlei的个人博客 » httpd服务无法启动 /bin/systemctl start httpd.service

赞 (9)
分享到:更多 ()