File Contexts For Nginx

894 단어 nginxcacheF#

$ vi /etc/selinux/targeted/contexts/files/file_contexts       다음 내용 추가:
#
# nginx file contexts
#

/etc/nginx(/.*)?        system_u:object_r:httpd_config_t
/usr/share/nginx(/.*)?        system_u:object_r:httpd_sys_content_t
/usr/sbin/nginx        --    system_u:object_r:httpd_exec_t
/var/lib/nginx(/.*)?        system_u:object_r:httpd_cache_t
/var/log/nginx(/.*)?        system_u:object_r:httpd_log_t
  :
sudo semanage fcontext -a -t httpd_config_t "/etc/nginx(/.*)?"
sudo semanage fcontext -a -t httpd_sys_content_t "/usr/share/nginx(/.*)?"
sudo semanage fcontext -a -t httpd_exec_t -f -- /usr/sbin/nginx
sudo semanage fcontext -a -t httpd_cache_t "/var/lib/nginx(/.*)?"
sudo semanage fcontext -a -t httpd_log_t "/var/log/nginx(/.*)?"

nginx 패키지 다시 표시:
$ sudo /sbin/fixfiles -R nginx relabel

좋은 웹페이지 즐겨찾기