RHCSA SELINUX allow a apache subdirectory to be serviced

RHCSA studying. classroom.example.com 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  ##our test dummy.

The answer:

chcon -R -t httpd_sys_content_t “/var/www/html/repo/”

restorecon -R /var/www/html/repo

Like magic yum then works.