默认站点根文件夹为/usr/local/nginx/html。要将它改成/homw/www
location / {
root html;
index index.php index.html index.htm;
}
location / {
root /home/www;
index index.php index.html index.htm;
}
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
root
/home/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
vi /usr/local/nginx/conf/nginx.conf
将当中的
改为
然后再将
location ~ .php$ {
改为
location ~ .php$ {
然后重新启动nginx
已经安装了samba,所以要将vi /etc/samba/smb.conf中的[public]下的path值改为
path = /home/www/
chown nginx(全部者):nginx(组) /home/www/ -R #设置文件夹全部者
chmod 700 /home/www/ -R #设置文件夹权限