Main Tutorials

Mac OSX – where is default localhost folder?

On Mac OSX, the default localhost folder is located at /Library/WebServer/Documents

P.S Tested with MacOS Sierra, 10.12.6

Find httpd.conf

By default, Apache is enabled and installed in /etc/apache2/, inside httpd.conf file, find DocumentRoot to tell where is the default localhost folder.

sudo vim /etc/apache2/httpd.conf

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/WebServer/Documents">
    #...
</Directory>

References

  1. Apache – Mapping URLs to Filesystem Locations

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
2 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Anne
4 years ago

So I read that Catalina (10.15) comes with Apache and PHP. All I need to run Drupal is mySQL.

The thing is : I hate command shell ! Is there a way (Automator ?) or an app to turn on/off Apache and PHP with only a button ?

Thanks

A.

Andrei Lucaci
4 years ago
Reply to  Anne

well, not exactly, perhaps if you’d build it, but if you are against terminal that bad, you could, at least, use the terminal to open the folder with code:

you could type
code /etc/apache2/

and this commend will open the VS Code (if you have it install) and you’ll be able to process everything in the VS code editor