When "Web Sharing" is NOT enabled it takes /usr/htdocs
as the root. When you enable "Web Sharing" it will take the config file at /etc/apache2/httpd.conf
. The directory will be the one specified near the following section on the file.
<IfDefine WEBSHARING_ON>
#
# 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"
Also you con use your "Sites" directory at /Users/USERNAME/Sites
accessing with localhost/~USERNAME
.
nothing in the
/etc/apache2/available-sites/*
configs? – ragnq – 2011-11-18T16:28:08.343The default OSX setup does not use the available-sites or enabled-sites structure. – vinhboy – 2011-11-18T16:33:35.363
1It's not. A new OS X Lion installation uses
/Library/WebServer/Documents
, just like the major releases before Lion, which is also where the button Open Computer Website Folder… in System Preferences » Sharing » Web Sharing points to. Did you install a package manager like Homebrew, Fink, or MacPorts; XAMPP or a similar Apache solution? What is the output ofwhich httpd
andps aux | grep httpd
in Terminal? – Daniel Beck – 2011-11-18T17:31:15.310I did not install any of those package managers. But thanks, I will look down that path. I do see the
/Library/WebServer/Documents
directive in the httpd.conf file. However, it is obviously being overwritten somewhere else. I tried following all the references to other .conf file, but no luck yet. – vinhboy – 2011-11-18T17:38:52.267Why not
grep
for/usr/htdocs
on your machine and see where it's overwritten? — (/cc @dan, you didn't get a reply for this) – slhck – 2011-11-18T17:41:02.167When you write new OSX Lion install, this implies that you didn't restore e.g. your personal data from a Time Machine backup, right? (Thanks @slhck) – Daniel Beck – 2011-11-18T17:46:14.523