1、安装
rpm -ivh http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.14.2-1.el7_4.ngx.x86_64.rpm
2、启动
# systemctl start nginx // 验证是否启动成功 # curl http://127.0.0.1:80 // 正常会返回html代码
3、设置开机启动服务
systemctl enable nginx
4、常用命令
// 服务状态 # systemctl status nginx // 服务启动 # systemctl start nginx // 服务停止 # systemctl stop nginx // 服务重启 # systemctl restart nginx
原文地址:https://www.cnblogs.com/lamp01/p/10101794.html
时间: 2024-11-05 16:04:32