Apacheからコンテンツを順次nginxサイトへ移植中に発生した出来事の対処メモ
検索で引っかかって誰かの役に立てば何より。
環境は前と一緒
概要
myserver.com/othersite/ は表示されているところに
同じドキュメントルートにフラットにコンテンツをコピーした
myserver.com/mysite/ 以下が表示されずAccess deniedのつれない表示
nginxのエラーログ
yyyy/mm/dd hh:mm:ss [error] xxxxx#xxxxx: *1 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Unable to open primary script: /usr/share/nginx/html/mysite/index.html (Permission denied)" while reading response header from upstream, client: 192.168.xx.xxx, server: localhost, request: "GET /mysite/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "myserver.com"
いろいろ調べましたが犯人はSELinuxでした
対処
sudo setenforce o
再起動時にまた悪さしないように設定ファイルも編集しておく
/etc/selinux/config
SELINUX=disabled