파일의 보안 컨텍스트 설정 (chcon)

$ chcon [설정한 컨텍스트] [파일명]
$ chcon --reference=[참조할파일] [파일명]
# 아파치가 접근할 수 있도록 보안 컨텍스트 지정
$ chcon -t httpd_sys_content_t /var/www/html/myfile.html

표준 보안 컨텍스트로 설정 (restorecon)

$ restorecon /var/www/html/myfile.html

경로에 따른 보안 컨텍스트 확인 (matchpathcon)

$ matchpathcon /var/www/html/
/var/www/html   system_u:object_r:httpd_sys_content_t:s0
$ matchpathcon -V /var/www/html/*
/var/www/html/index.html verified.
/var/www/html/welcome.php has context unconfined_u:object_r:user_home_t:s0, should be system_u:object_r:httpd_sys_content_t:s0