'Mac Apache web server won't start anymore and can't find any web directories
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.
Solution 1:[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.
Solution 2:[2]
You have to run the command as the root user.
sudo apachectl stop
sudo apachectl start
Solution 3:[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
.
Solution 4:[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
Solution 5:[5]
I have found a command that should locate your issue(s). In the Terminal enter: apachectl configtest
Solution 6:[6]
This worked for me:
sudo launchctl load -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist
Solution 7:[7]
Solvet this by run service
directly trougth .plist
file.
After that, service explane me what happen exactly.
In my case, i am was delete apache2
folder in /var/log
.
When i was try run httpd with by command:
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
answer was empty.
Open org.apache.httpd.plist
in editor,
you need <string>
with path to service after <key>ProgramArguments\<key>
Regards!
Solution 8:[8]
You can try to start Apache without DocumentRoot, It's just a trick.
sudo apachectl -T
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | nensamuel |
Solution 2 | infinigrove |
Solution 3 | R T |
Solution 4 | appbanana |
Solution 5 | Kat Joy |
Solution 6 | baikho |
Solution 7 | jacobkim |
Solution 8 | Rawan-25 |