エラーログを確認したところ、以下のログが記録されていた。(一部省略)
(13)Permission denied: ...: Call to fopen() failed for '/.../testsite/testsite/wsgi.py'ディレクトリや wsgi.py に対する permission も問題がないことを確認し、一向に原因がわからなかったが、こことここから、SELinux が原因であることが判明した。
原因を特定するため、ここの記載に従い、まず setroubleshoot-server をインストールした。
sudo yum install setroubleshoot-server次に該当のサイトへアクセスし、エラーログ(/var/log/messages)を出力させる。
エラーログには、以下のメッセージは出力されていた。
Jul 24 07:46:40 xxxxxx python: SELinux is preventing /usr/sbin/httpd from read access on the directory testsite. ***** Plugin catchall_boolean (89.3 confidence) suggests ****************** If you want to allow httpd to read user content Then you must tell SELinux about this by enabling the 'httpd_read_user_content' boolean. You can read 'None' man page for more details. Do setsebool -P httpd_read_user_content 1 ***** Plugin catchall (11.6 confidence) suggests ************************** If you believe that httpd should be allowed read access on the testsite directory by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # grep httpd /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.ppメッセージに従い、httpd_read_user_content の値を変更(setsebool -P httpd_read_user_content 1)したところ、無事に表示された。
0 件のコメント:
コメントを投稿