
ウェブサイトを構築した後、RAID がすべてのスペースを/home/admin/
フォルダーに割り当てるように設定されていることに気付きました。
そのため、私は自分のウェブサイトすべてを から にコピーしました/var/www/
。/home/admin/www/
また、次のようにディレクトリを chmod しました。
sudo chown -R root:root /home/admin/www/website.com/public_html
sudo chmod 755 /home/admin/www
その後、nginx を再起動すると、すべてのシステムが緑色に表示されましたが、今度は Web サイトにアクセスすると 403 エラーが表示されます。
これが私の仮想.confファイル:
server {
listen 80;
# listen *:80;
server_name website.com www.website.com;
access_log /home/admin/www/html/website.com/public_html/access.log;
error_log /home/admin/www/html/website.com/public_html/error.log;
location / {
root /home/admin/www/html/website.com/public_html;
index index.php index.html index.htm;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/admin/www/html/website.com/public_html$fastcgi_script_name;
}
}
server {
listen 80;
# listen *:80;
server_name website2.com www.website2.com;
location / {
root /home/admin/www/html/website2.com/public_html/;
index index.php index.html index.htm;
}
}
ありがとう!