Fedora file permissions apache no write acces
I had the same issue because SELinux blocked httpd, it worked fine after this command:
setsebool -P httpd_unified 1
I'm on fedora 23.
There are a number of things that could be affecting this:
- Discretionary Access Control (DAC)
- SELinux file/content type
- user:group ownership
- apache server modules missing/misconfigured.
The fact that your server's directories have the 777 permissions would lead me to exclude DAC as the main reason for the errors; however, you might want to check to make sure that user(chris) is part of the apache
group, just for good measure. Also, the httpd server reads/writes files as the apache
user by default!!
Similarly, you said the errors persisted even after "disabling" SELinux; I'm assuming you executed setenforce 0
or something to that effect in order to change the SELinux policy from Enforcing
to Permissive
. Furthermore, if it had to do with SELinux, most of the time (if not all) you'd receive a notification about the denial, or you'd be able to see it in the logs. Again, for good measure, check the SELinux content type of the directories/files with ls -Z
; the content type should be httpd_sys_content_t
or perhaps even httpd_sys_content_rw_t
.
Lastly, the apache modules and the server configuration should be thoroughly examined--including the comments in the httpd.conf file--for correct options, modules, as well as order. If all else fails, try moving those lines
<Directory "/var/www/html/"> AllowOverride all # Allow open access: Require all granted Options Indexes FollowSymLinks Multiviews</Directory>
to the bottom of the config file (/etc/httpd.conf
). The Options flag within that code block should be examined carefully; you can get more info on that at the apache website. For example, not sure if the order of things will improve/change things for you in this context, but the httpd.conf file on my Fedora system has the Options listed before the Require All granted
.