Hide Forgot
Description of problem: Using firefox to display an html page on loclahostthat refered to a jpg file in the same directory SELinux is preventing httpd from 'getattr' accesses on the file /var/www/html/gcf/html5/ph5p2ed/L0308/gravel.jpg. ***** Plugin catchall_boolean (89.3 confidence) suggests ****************** If you want to allow httpd to read user content Then you must tell SELinux about this by enabling the 'httpd_read_user_content' boolean. You can read 'None' man page for more details. Do setsebool -P httpd_read_user_content 1 ***** Plugin catchall (11.6 confidence) suggests ************************** If you believe that httpd should be allowed getattr access on the gravel.jpg file by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # ausearch -c 'httpd' --raw | audit2allow -M my-httpd # semodule -X 300 -i my-httpd.pp Additional Information: Source Context system_u:system_r:httpd_t:s0 Target Context unconfined_u:object_r:home_bin_t:s0 Target Objects /var/www/html/gcf/html5/ph5p2ed/L0308/gravel.jpg [ file ] Source httpd Source Path httpd Port <Unknown> Host (removed) Source RPM Packages Target RPM Packages Policy RPM <Unknown> Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name (removed) Platform Linux (removed) 4.7.9-200.fc24.x86_64 #1 SMP Thu Oct 20 14:26:16 UTC 2016 x86_64 x86_64 Alert Count 45 First Seen 2016-10-26 18:34:08 NZDT Last Seen 2016-10-26 20:56:04 NZDT Local ID 089cb97b-936b-421b-9aa9-b4dfdb3f8da6 Raw Audit Messages type=AVC msg=audit(1477468564.821:4311): avc: denied { getattr } for pid=31838 comm="httpd" path="/var/www/html/gcf/html5/ph5p2ed/L0308/gravel.jpg" dev="dm-0" ino=527480 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:home_bin_t:s0 tclass=file permissive=0 Hash: httpd,httpd_t,home_bin_t,file,getattr Additional info: reporter: libreport-2.7.2 hashmarkername: setroubleshoot kernel: 4.7.9-200.fc24.x86_64 type: libreport
Please run: # restorecon -Rv /var/www/html/ To fix your issue.