默认网站根目录为/usr/local/nginx/html,要将它改成/homw/www
vi /usr/local/nginx/conf/nginx.conf
将其中的
location / {
root html;
index index.php index.html index.htm;
}
改为
location / {
root /home/www;
index index.php index.html index.htm;
}
- start nginx //运行nginx
- nginx -s stop // 停止nginx
- nginx -s reload // 重新加载配置文件(如修改配置文件后,可通过该命令重新加载)
- nginx -s quit // 退出nginx
- nginx -v //可查nginx版本