0

I have a problem with 403 error Apache is on admin group, files has admin ownership, and 644. .htaccess doesn't matter. All php files, and tpl files shows correct, there is only problem with css an js files.

I'he change permision to 777 without result, also I've deleted .htaccess, with no result.

I've double checked permisions, and made chown to apache group with subfiles and subfolders, i've made the same thing with chmod with no result

What can I do more?

  • Check your config, did you set a `Require` statement anywhere? That includes the virtual host config, if one is set up –  Mar 07 '17 at 09:26

3 Answers3

1

This could be down to seLinux.

Assuming your CGI environment for PHP is running as a user other than the apache/httpd user, it would explain why the PHP part is working. Unless you had placed the other resources in a directory that was already correctly labelled to allow the httpd user access, then I would suspect it is the absence of the correct seLinux context that prevents the files from being served.

I would check /var/log/audit/audit.log for AVC events relating to HTTPd. You could use audit2allow to generate suitable rules to solve your problem.

You might find some more useful information in this question's answers: SELinux interfering with Apache / PHP

iwaseatenbyagrue
  • 3,588
  • 12
  • 22
1

Try runing

chcon -R -t httpd_sys_rw_content_t /path/to/your/site

or use reference directory:

chcon -R --reference=/var/www/html /www/sites

More info:

Link to reference

xCanox
  • 51
  • 5
0

Check that the directories have "executable" permissions. It happened to me. I used 777 and it wasn't enough yo can do chmod +x to directories.

Found here

lesolorzanov
  • 109
  • 2
  • Why the negative? This is the right solution instead of messing up with SElinux. When you use chmod 777 in directories you disable the access to web served directories. – lesolorzanov Mar 14 '18 at 10:44