自定义virtualhost及目录之后,通过浏览器访问会出现以下错误:
You don't have permission to access / on this server
因为apache访问目录时需要执行权限,包括documentroot 的父目录,比如我的为:
DocumentRoot /home/xxx/pangu/webs
此时需要将home及xxx目录均赋予root执行和可读权限:
sudo chmod o+rx /home -R
另外在httpd.conf中加入:
DirectoryIndex index.html index.php