開啟SELinux,POST文章時空白、Autoptimize 跳錯權限..等問題
不熟SELinux,大略參考網路文章做以下操作

#semanage fcontext -a -t httpd_sys_content_t "/var/www/wordpress(/.*)?"
#semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/wordpress/wp-content(/.*)?"
#semanage fcontext -a -t httpd_sys_rw_content_t /var/www/wordpress/.htaccess
#semanage fcontext -a -t httpd_sys_rw_content_t /var/www/wordpress/wp-config.php
#restorecon -R -v /var/www/wordpress/

查看一下SELinux 與httpd相關設定
#getsebool -a | grep 'httpd'
以下設為on

#setsebool -P httpd_can_network_connect_db on 
//可以連到DB

#setsebool -P httpd_can_network_connect on 
//早前找文章說這項要on,但有上一條,可能不用這條

#setsebool -P httpd_unified on 
//If you want to unify HTTPD handling of all content files, you must turn on the httpd_unified boolean.

#setsebool -P httpd_can_sendmail on 
//我沒開能發信,不過開吧

#setsebool -P httpd_setrlimit on 
//If you want to allow httpd daemon to change system limits, you must turn on the httpd_setrlimit boolean.

#setsebool -P httpd_execmem on 
//If you want to allow httpd scripts and modules execmem/execstack, you must turn on the httpd_execmem boolean.

參考來源:
httpd_selinux(8) – Linux man page
Nginx SELinux Configuration
WordPress Multisite 使用者註冊 收不到信 – httpd – php – selinux
等…爬過文忘了



發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *