[英]Forbidden error for alias directories on Apache
Help needed regarding setting alias for my web server. 有关为我的Web服务器设置别名的帮助。 I'm getting 403 Forbidden error. 我收到403 Forbidden错误。
I need to create alias for web directory, that is pladed in: 我需要为web目录创建别名,该目录是:
/var/falcon/
My file /etc/httpd/conf.d/helpdesk.conf looks like this: 我的文件/etc/httpd/conf.d/helpdesk.conf如下所示:
Alias /hd/ "/var/falcon/"
<Directory "/var/falcon">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Directory /var/falcon is owned by apache user and by apache group. 目录/ var / falcon由apache用户和apache组拥有。
SeLinux is enabled, so I run following directives: SeLinux已启用,因此我运行以下指令:
setsebool -P httpd_enable_homedirs 1
setsebool -P httpd_read_user_content 1
chcon -R --reference=/var/www/html /var/falcon/
chcon -t httpd_sys_content_t
chcon -t httpd_sys_content_t /var/falcon/
But, as I said, I'm getting 403 Forbidden error, if I open ie. 但是,正如我所说,如果我打开ie,我会收到403 Forbidden错误。 https://my-domain.com/hd https://my-domain.com/hd
Can you help me how can I use /var/falcon/ direcotry as a web direcotry. 你能帮我解决一下如何使用/ var / falcon / direcotry作为web direcotry。
Thank you in advance! 先感谢您!
Ok, solution was very simple - all I was missing was "Require all granted" directive. 好的,解决方案非常简单 - 我所缺少的只是“需要所有授予”指令。
So, my conf file looks like this: 所以,我的conf文件看起来像这样:
Alias /hd/ "/var/falcon/"
<Directory "/var/falcon">
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.