{"id":438,"date":"2019-08-09T21:11:58","date_gmt":"2019-08-10T04:11:58","guid":{"rendered":"https:\/\/blog.iabsolute.com\/?p=438"},"modified":"2019-08-09T21:11:58","modified_gmt":"2019-08-10T04:11:58","slug":"stumped-by-13permission-denied-file-permissions-deny-server-access","status":"publish","type":"post","link":"https:\/\/blog.iabsolute.com\/?p=438","title":{"rendered":"Stumped by (13)Permission denied: file permissions deny server access ?"},"content":{"rendered":"\n<p>I was just pretty stumped by the following Apache error, in \/var\/log\/httpd\/error_log:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[Thu Dec 08 21:53:28 2011] [error] [client 192.168.1.2] (13)Permission denied: file permissions deny server access: \/var\/www\/html\/aml\/i\nndex.html<\/pre>\n\n\n\n<p>The error implies it\u2019s a filesystem permissions issue, and the Apache site explains that it\u2019s almost always related to filesystem permissions, not Apache configuration. But this was exasperating, because the file ownership was apache.apache, and index.html was chmod 755. Apache could absolutely access it. But then the Apache docs made a passing mention that sometimes it was related to SELinux errors.<\/p>\n\n\n\n<p>Sure enough, that\u2019s exactly my problem:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[matt@bos aml]$ ls -alZ \ndrwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 .\ndrwxr-xr-x. root   root   system_u:object_r:httpd_sys_content_t:s0 ..\n-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 .htaccess\ndrwxr-xr-x. apache apache unconfined_u:object_r:user_home_t:s0 images\n-rw-r--r--. apache apache unconfined_u:object_r:user_home_t:s0 index.html\ndrwxr-xr-x. apache apache unconfined_u:object_r:user_home_t:s0 stylesheets<\/pre>\n\n\n\n<p>Note that the directory, and the .htaccess file I touched, have the <code>httpd_sys_content<\/code> label, which is appropriate here. But the other files show <code>user_home_t<\/code>. This apparently precludes Apache from being able to see them.<\/p>\n\n\n\n<p>Where this went wrong is that, to get them onto the server, I scp\u2019ed them from my desktop to my home directory on the webserver, and then cp\u2019ed them to \/var\/www\/html. In doing so, they picked up the user_home_t label since they were in my home directory.<\/p>\n\n\n\n<p>A quick <code>sudo restorecon -r .<\/code> got everything sorted out<\/p>\n\n\n\n<p>then restart sudo systemctl restart httpd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was just pretty stumped by the following Apache error, in \/var\/log\/httpd\/error_log: [Thu Dec 08 21:53:28 2011] [error] [client 192.168.1.2] (13)Permission denied: file permissions deny server access: \/var\/www\/html\/aml\/i ndex.html The error implies it\u2019s a filesystem permissions issue, and the Apache &hellip; <a href=\"https:\/\/blog.iabsolute.com\/?p=438\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,10,9],"tags":[],"class_list":["post-438","post","type-post","status-publish","format-standard","hentry","category-apache","category-centos","category-command-line-my-linux"],"_links":{"self":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=438"}],"version-history":[{"count":1,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":439,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/438\/revisions\/439"}],"wp:attachment":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}