Here is a quick step to configure Apache2 in Mac OS X (I use Mountain Lion) to be able working with custom document root and Directory listing. For example, I put my website projects on ~/htdocs.
So first thing to do, we need to give permission Apache2 to be able accessing this folder.
1 | chmod o+x ~/htdocs/ |
If you don’t, you might facing errors like :
1 | Permission denied: access to /index.php denied |
We also need to disable AllowOverride by set the value :
1 | AllowOverride = None |
If we don’t, we might get this errors:
1 | apache .htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable |
If you got error like this:
1 | Directory index forbidden by Options directive |