简体   繁体   English

403禁止尝试访问浏览器上的文件夹

[英]403 Forbidden trying to access folder on browser

I have a folder in ~/Documents/WebD/ named Tarea which have a public_html folder inside, to access it I have tried creating a virtual host in a thousand ways but it didn't work, now I'm trying to get there creating a Symlink from tarea to /var/www/html/tarea, and accessing via localhost/tarea/public_html but y get 我在〜/ Documents / WebD /中有一个名为Tarea的文件夹,里面有一个public_html文件夹,要访问它,我尝试了千种方法来创建虚拟主机,但是它没有用,现在我试图在此创建从tarea到/ var / www / html / tarea的符号链接,并通过localhost / tarea / public_html访问,但是得到

    Forbidden
    You don't have permission to access /tarea on this server.
    Apache/2.2.15 (CentOS) Server at localhost Port 80

I tried a lot of different ways named on forums, changing httpd.conf, give permissions to apache, etc, but non of them worked 我尝试了许多在论坛上命名的不同方法,更改了httpd.conf,授予了对Apache的权限等,但其中的一种都不起作用

Any suggestion? 有什么建议吗?

It could be SELinux preventing Apache from accessing those files. SELinux可能阻止Apache访问那些文件。 I would try switching SELinux into permissive mode and seeing if your permissions open up. 我会尝试将SELinux切换为宽松模式,并查看您的权限是否打开。 You can read more about SELinux and Apache here . 您可以在此处阅读有关SELinux和Apache的更多信息。

To put SELinux into permissive mode, do: 要将SELinux置于许可模式,请执行以下操作:

echo 0 > /selinux/enforce

To put SELinux back into enforcing mode, do: 要将SELinux放回强制模式,请执行以下操作:

echo 1 > /selinux/enforce

Hope you have already checked Persmissions for /tarea folder. 希望您已经检查了/ tarea文件夹的权限。 The User which is running the Apache server should have read/write permissions on the specific directories. 运行Apache服务器的用户应该对特定目录具有读/写权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM