CY-Left

基本功底

apache 设置虚拟主机

You don’t have permission to access the requested directory.

文件权限受限, 如果没有设置 require all granted, 就会有上述报错.

<VirtualHost *:80>
    ServerAdmin webmaster@67.218.146.206
    DocumentRoot "/opt/lampp/docs/phpstudy"
    ServerName phpstudy.xxx.com
    ErrorLog "logs/phpstudy-error_log"
    CustomLog "logs/phpstudy-access_log" common
</VirtualHost>

<Directory "/opt/lampp/docs/phpstudy">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    # 设置 required 权限
    Require all granted
    Allow from all
</Directory>

本文虽拙,却也系作者劳动,转载还请保留本文链接: http://cyleft.com/?p=761