CentOS 7 nginx安装

2018-02-10  本文已影响0人  gisxiaowei
  1. 运行命令
sudo dnf install  nginx # 安装nginx
whereis nginx # 查找nginx
sudo nginx # 运行nginx
  1. 修改nginx.conf
sudo vim /etc/nginx/nginx.conf # 编辑配置文件

在第一行增加user root
修改server节点下,location后的根目录为自己的路径

 location / {
   root /home/gisxiaowei/html;
 }
  1. 重新加载nginx配置文件
sudo nginx -s reload
上一篇 下一篇

猜你喜欢

热点阅读