解决修改XAMPP DocumentRoot: Access forbidden!

来源:互联网 发布:java就业实训 编辑:程序博客网 时间:2024/05/17 22:55

changing the document root to your ‘Sites’ folder

  • install xampp from apachefriends.org
  • open /Applications/XAMPP/xampfiles/etc/ in finder; right click > get info
    make sure its read / write by everyone
  • open /Applications/XAMPP/xampfiles/etc/httpd.conf
  • scroll down to ‘DocumentRoot’
  • type in the location of your ‘sites’ folder [ /Users/username/Sites ]
  • scroll down to the <Directory&gt config
  • replace /Applications/XAMPP/xamppfiles/htdocs with /Users/username/Sites
  • save
  • restart apache
  • goto http://localhost to see what you have

Then gives this error:

“Access forbidden!

You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster. …”


To solve this:

sudo chmod 777  /Users/username/Sites