Mac Apache Web服务器不再启动,无法找到任何Web目录

时间:2016-11-01 14:07:51

标签: macos apache xampp yosemite

我在Mac Yosemite 10.10.5上。 Apache Web服务器突然不再启动。我尝试将端口更改为8080.还尝试了sudo apachectl stop和sudo apachectl start。仍然没有开放。

我认为在添加新打印机并启用打印共享后可能会发生这种情况。我把它关了,它仍然没有开始。我无法记住我运行的哪个命令给了我这个消息以及更多细节。

enter image description here

更新:当我使用sudo apachectl start时,我注意到服务器可以通过浏览器访问,即使界面仍然显示STOPPED,但是当我转到localhost / webdirectory时,我就找不到了。

enter image description here enter image description here

enter image description here

enter image description here

enter image description here

6 个答案:

答案 0 :(得分:13)

经过48小时的研究,我找到了这个有效的解决方案,我找到了解决方案here:禁用OSX的内置Apache服务器。

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

这允许XAMPP从80开始,而POW在20559上运行。

答案 1 :(得分:0)

您必须以root用户身份运行该命令。

sudo apachectl stop

sudo apachectl start

答案 2 :(得分:0)

在我之前运行命令apachectl configtest的经验中,将显示您可能遇到的任何配置错误。如果一切正常,它将打印Status OK,否则它将显示配置错误。修复这些问题,然后重试apachectl start

答案 3 :(得分:0)

我用终端中的以下代码解决它。你可以尝试一下。

sudo / Applications / XAMPP / xamppfiles / bin / apachectl start sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

答案 4 :(得分:0)

这对我有用:

sudo launchctl load -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist

答案 5 :(得分:0)

通过直接通过 service 文件运行 .plist 来解决这个问题。

在那之后,服务向我解释到底发生了什么。

就我而言,我删除了 apache2 中的 /var/log 文件夹。

当我尝试通过命令运行 httpd 时:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

答案为空。

在编辑器中打开 org.apache.httpd.plist, 您需要 <string><key>ProgramArguments\<key> 之后的服务路径 问候!