Apachectl命令在mac上无法正常工作

时间:2015-06-23 15:13:54

标签: macos apache terminal

我开始用我的macbook学习Apache服务器,并在终端上键入apachectl。

不幸的是我只能看到以下消息。

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Marshalls-MacBook-Air.local. Set the 'ServerName' directive globally to suppress this message
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

您认为这是怎么回事,我应该如何解决?

1 个答案:

答案 0 :(得分:0)

  

我输入了apachectl

您需要apachectl前缀为sudo,所以:

sudo apachectl start

否则该命令没有足够的权限绑定到端口80。

  

AH00558:httpd:无法可靠地确定服务器的完全限定域名

您需要编辑httpd.conf Apache配置文件并取消注释ServerName行。

要找到该文件,请先运行:apachectl -t -D DUMP_INCLUDES

相关问题