Re: Forbidden: can't access *.html files in /var/www/html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Alexander Farber wrote:
Hello,

I'm using the latest CentOS with phpBB 3.0.x + postgreSQL + sendmail
(relayed through gmail.com) - all those programs working fine,
with no big modifications of the CentOS defaults (i.e. SELinux is on).

Now I'm struggling with the seemingly simple problem, that when
I put an .html file into /var/www/html/ then Apache won't serve it.

<SNIP>

I've looked into /etc/httpd/conf/httpd.conf and conf.d/ files...

Does anybody know what is wrong, how to find out?

Regards
Alex

Did you possibly use mv to put the file in that directory? If so, it will not always set the file context properly. You can tell if you will check to see if SELinux is active (run getenforce and see if it returns "Enforcing") and use the -Z switch to ls to see the file context of the problem files. If the context is not "httpd_sys_content_t" or something similar you need to fix the context.

Fixing it is easy, just run restorecon:

restorecon -rv /var/www/html

This will walk down the directory tree and fix up the file contexts, giving you a message about the files it changes.

Of course, if it isn't an SELinux problem, this won't help.
--
Jay Leafey - jay.leafey@xxxxxxxxxxxx
Memphis, TN

<<attachment: smime.p7s>>

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux