我的httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>
<VirtualHost *:80>
ServerName education.com
ServerAlias www.education.com
DocumentRoot "/Library/WebServer/Documents/Education"
ErrorLog "/private/var/log/apache2/education.com-error_log"
CustomLog "/private/var/log/apache2/education.com-access_log" common
<Directory "/Library/WebServer/Documents/Education">
Options Indexes FollowSymLinks
AllowOverride All
Order allow, deny
Allow from all
</Directory>
</VirtualHost>
我的主机文件是
127.0.0.1 education.com
127.0.0.1 www.education.com
我在Mac上,不知道我在这里做错了什么。 (如果我删除
<VirtualHost
section localhost工作正常,否则它们都不起作用)
日志说
[Sat May 03 15:17:09 2014] [error] [client 127.0.0.1] client denied by server configuration: /usr/\xe2\x80\x9c, referer: http://education.com/
[Sat May 03 15:17:46 2014] [error] [client 127.0.0.1] client denied by server configuration: /usr/\xe2\x80\x9c
答案 0 :(得分:0)
像这样定义你的目录:
<Directory "/Library/WebServer/Documents/Education">
Options Indexes FollowSymLinks
AllowOverride All
Order allow, deny
Allow from all
Require all granted
</Directory>