- 运行命令
sudo dnf install nginx # 安装nginx
whereis nginx # 查找nginx
sudo nginx # 运行nginx
- 修改nginx.conf
sudo vim /etc/nginx/nginx.conf # 编辑配置文件
在第一行增加user root
;
修改server
节点下,location
后的根目录为自己的路径
location / {
root /home/gisxiaowei/html;
}
- 重新加载nginx配置文件
sudo nginx -s reload