{"id":386,"date":"2018-09-12T17:51:12","date_gmt":"2018-09-12T17:51:12","guid":{"rendered":"http:\/\/www.linuxauthority.com\/wordpress\/?p=386"},"modified":"2018-09-12T17:51:12","modified_gmt":"2018-09-12T17:51:12","slug":"rhcsa-selinux-allow-a-apache-subdirectory-to-be-serviced","status":"publish","type":"post","link":"https:\/\/www.linuxauthority.com\/wordpress\/?p=386","title":{"rendered":"RHCSA SELINUX allow a apache subdirectory to be serviced"},"content":{"rendered":"\n<!-- ALL ADSENSE ADS DISABLED -->\n<p>RHCSA studying. classroom.example.com 10.0.2.10 has a web server and \/var\/www\/html\/repo is where we want the yum repository to be.<\/p>\n<p>A little selinux problem with that in enforcing mode.<\/p>\n<p>yum -y install nmap\u00a0 ##our test dummy.<\/p>\n<p><a href=\"http:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.21.39-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-388\" src=\"http:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.21.39-PM.png\" alt=\"\" width=\"2000\" height=\"676\" srcset=\"https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.21.39-PM.png 2000w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.21.39-PM-300x101.png 300w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.21.39-PM-768x260.png 768w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.21.39-PM-1024x346.png 1024w\" sizes=\"(max-width: 2000px) 100vw, 2000px\" \/><\/a><\/p>\n<p>The answer:<\/p>\n<p><a href=\"http:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.37.32-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-392\" src=\"http:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.37.32-PM.png\" alt=\"\" width=\"2014\" height=\"502\" srcset=\"https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.37.32-PM.png 2014w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.37.32-PM-300x75.png 300w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.37.32-PM-768x191.png 768w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.37.32-PM-1024x255.png 1024w\" sizes=\"(max-width: 2014px) 100vw, 2014px\" \/><\/a><\/p>\n<p>chcon -R -t httpd_sys_content_t &#8220;\/var\/www\/html\/repo\/&#8221;<\/p>\n<p>restorecon -R \/var\/www\/html\/repo<\/p>\n<p>Like magic yum then works.<\/p>\n<p><a href=\"http:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.38.14-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-390\" src=\"http:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.38.14-PM.png\" alt=\"\" width=\"2014\" height=\"1202\" srcset=\"https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.38.14-PM.png 2014w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.38.14-PM-300x179.png 300w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.38.14-PM-768x458.png 768w, https:\/\/www.linuxauthority.com\/wordpress\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-12-at-1.38.14-PM-1024x611.png 1024w\" sizes=\"(max-width: 2014px) 100vw, 2014px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>RHCSA studying. classroom.example.com 10.0.2.10 has a web server and \/var\/www\/html\/repo is where we want the yum repository to be. A little selinux problem with that in enforcing mode. yum -y install nmap\u00a0 ##our test dummy. The answer: chcon -R -t httpd_sys_content_t &#8220;\/var\/www\/html\/repo\/&#8221; restorecon -R \/var\/www\/html\/repo Like magic yum then works.<\/p>\n<a role=\"link\" class=\"rtp-readmore\" title=\"Read more on RHCSA SELINUX allow a apache subdirectory to be serviced\" href=\"https:\/\/www.linuxauthority.com\/wordpress\/?p=386\" rel=\"nofollow\">Read More &rarr;<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-386","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/386"}],"collection":[{"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=386"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/386\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxauthority.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}