1 | sudo yum install -y epel-release |
安装成功后,默认的网站目录为: /usr/share/nginx/html
默认的配置文件为:/etc/nginx/nginx.conf
自定义配置文件目录为: /etc/nginx/conf.d/
开启端口
1 | sudo firewall-cmd --permanent --zone=public --add-service=http |
开启80和443端口
常用操作
启动Nginx
1
systemctl start nginx
停止Nginx
1 | systemctl stop nginx |
重启Nginx
1
systemctl restart nginx
查看Nginx状态
1 | systemctl status nginx |
设置开机启动
1
systemctl enable nginx
禁止开机启动
1 | systemctl disable nginx |