Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

enter image description here

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.

enter image description here enter image description here

enter image description here

enter image description here

enter image description here

like image 832
Omar Avatar asked Nov 01 '16 14:11

Omar


People also ask

Why Apache server is not working?

There are several reasons your Apache server might fail to run. Something could be blocking the port it uses; there could be another instance of Apache already running; or there might be an incompatibility with the version of PHP you're using in MAMP.

Where is my Apache root directory on Mac?

The document root for your apache server, by default, is "Sites" in your home directory. That's not the root folder. Root is http://localhost/ . The folder you're refering to is located at http://localhost/~User/ .

Why Apache server is not starting in xampp on Mac?

This is because in Mac OS X there is already Apache pre-installed. So what you can do is to change the listening port of one of the Apaches, either the Apache that you installed with XAMPP or the pre-installed one. To change the listening port for XAMPP's Apache, go to /Applications/XAMPP/xamppfiles/etc and edit httpd.


1 Answers

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.

like image 170
nensamuel Avatar answered Sep 28 '22 12:09

nensamuel