我必须将路由从我的主apache服务器重定向到DocumentRoot外的目录,但总是返回一个禁止的错误 .
禁止您无权访问/测试此服务器 .
这是我的000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Alias /test "/home/myuser/url.es/my-form/test"
<Directory /home/myuser/url.es/my-form/test>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
要测试目录权限不是问题,我已授予777:
drwxrwxrwx 6 root root 4096 Feb 5 18:59 test
在里面:
drwxrwxrwx 2 root root 4096 Feb 4 19:07 api
drwxrwxrwx 2 root root 4096 Feb 4 19:07 assets
-rwxrwxrwx 1 root root 585 Feb 4 19:07 crossdomain.xml
drwxrwxrwx 4 root root 4096 Feb 4 19:07 img
-rwxrwxrwx 1 root root 1818 Feb 4 19:07 index.html
-rwxrwxrwx 1 root root 51 Feb 4 19:07 robots.txt
1 回答
检查您的错误日志,它会告诉您具体问题 . 可能其中一个较高目录没有Apache用户的搜索权限 .
您似乎没有授予DocumentRoot本身的权限 . 也许这是你主要的配置部分 .