MacOS – How to set a recognized Apache DocumentRoot under Lion

apacheconfigurationmacos

I have a fresh Lion install, and to configure Apache, I've edited all of the references to DocumentRoot (and the Directory entry for DocumentRoot) to "/Users/jonathan/mirror" (with or without quotes as the original path was with or without quotes). Pointing my browser to localhost gives a 404:

Not Found

The requested URL / was not found on this server.

Apache/2.2.20 (Unix) DAV/2 Server at localhost Port 80

How can I up /Users/jonathan/mirror with appropriate permissions?

Best Answer

Things do doublecheck:

1. File permissions

The specified path for the new document root should allow at least read access for the Apache user, which is _www by default. You probably want to chmod 755 /Users/jonathan/mirror if the file permissions are too restrictive. What are the actual file permissions on the directory and files?

2. Virtual hosts

When you enable name based virtual hosts, the document root in the main config is ignored. Instead the root for the matching hostname will be used, and if none match it will default to the first virtual host.