奇怪的Apache 403问题

我在/ var / www / html(在CentOS中)有两个感兴趣的文件:index1.html和index2.html。

index1.html是从一个网站下载的,拥有chm到root和chmoded 0644. index2.html是由root创build的,并且把index1.html的内容复制到它里面。 它们具有相同的内容和相同的权限。 Apache将加载index2.html,但会返回一个403 forbidden错误index1.html。 如果我交换文件名,权限问题跟在重命名。 这是怎么回事?

[root@localhost html]# ls -al total 52 drwxr-xr-x. 6 root root 4096 Jul 8 13:32 . drwxr-xr-x. 6 root root 4096 Jul 8 12:59 .. drw-r--r--. 2 root root 4096 Jun 26 12:14 css -rw-r--r--. 1 root root 1558 Jul 8 11:42 dashboard.css drw-r--r--. 2 root root 4096 Jun 26 12:14 fonts -rw-r--r--. 1 root root 8744 Jul 8 13:12 index1.html -rw-r--r--. 1 root root 8744 Jul 8 11:42 index2.html drw-r--r--. 2 root root 4096 Jul 8 13:32 js drw-r--r--. 4 root root 4096 Jun 21 18:39 PHP_Site [root@localhost html]# 

其余的文件被下载和chown / chmodded,他们也都返回403错误。 index2.html是Apache将加载的唯一文件。

如果我'阿帕奇'和猫的文件,它可以读取所有这些。

尝试更新您的Apache共享的文件/文件夹上下文。

 # restorecon -R /var/www/html/ 

SELinux是有用的,不要关掉它,除非你必须。