ラップトップでWebサーバーとしてapache2を実行していましたが、nginxに移行することにしました。
-Apacheを削除せずにnginx-php(fastcgi-fpm)をインストール
- /etc/nginx/site-enabled/default を次のルールで構成
root /var/www;
index index.html index.htm index.php;
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
deny all;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
ブラウザーから localhost と入力すると、403 禁止で応答します
127.0.0.1:9000 と入力しています この Web ページは利用できません
12.0.0.1 禁止
権限の問題が表示されますが、表示Webサイトを実行するときにchmod 777 var/wwwおよびapache2を実行します
では、構成の何が問題なのか、何が欠けているのでしょうか?