# 安装
[root@localhost safe-island]# sudo yum install nginx
# 设置开机自启动
[root@localhost safe-island]# sudo systemctl enable nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
# 开启nginx
[root@localhost safe-island]# sudo systemctl start nginx
# 查看状态
[root@localhost safe-island]# sudo systemctl status nginx
# 停止命令
[root@localhost safe-island]# systemctl stop nginx.service
# 重载命令
[root@localhost safe-island]# sudo systemctl reload nginx
#如果您不想在引导时启动NGINX服务器,则必须通过运行来禁用它
[root@localhost safe-island]# sudo systemctl disable nginx
#端口80 443 根据需要放开防火墙限制
CentOS 8安装Nginx
最新推荐文章于 2024-03-12 14:12:26 发布