问题
I'm on Mac Yosemite 10.10.5. Apache web server suddenly no longer starts. I tried changing the port to 8080. Also tried sudo apachectl stop and sudo apachectl start. Still won't open.
I thought this may have happened after adding a new printer and enabling print sharing. I turned that off and it still won't start. I can't remember which command I ran that gave me this message with some more details.
UPDATE: When I use sudo apachectl start, I noticed the server is accessible through the browser even though the interface still says STOPPED, but when I go to localhost/webdirectory I just get not found.
回答1:
After 48 hours of research, I found this working solution, I found the solution here: disable OSX's built-in Apache server.
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
This allowed XAMPP to start on 80, while POW runs on 20559.
回答2:
You have to run the command as the root user.
sudo apachectl stop
sudo apachectl start
回答3:
In my previous experience running the command apachectl configtest will show any configuration errors you might have. If everything is ok it will print Status OK, otherwise it will show you the config error(s). Fix those and then retry apachectl start.
回答4:
I solve it with following code in terminal. You can try it.
sudo /Applications/XAMPP/xamppfiles/bin/apachectl start sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
回答5:
I have found a command that should locate your issue(s). In the Terminal enter: apachectl configtest
回答6:
This worked for me:
sudo launchctl load -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist
来源:https://stackoverflow.com/questions/40361744/mac-apache-web-server-wont-start-anymore-and-cant-find-any-web-directories