Centos7Yum安装配置指定版本nginx

时间:2021-07-03 18:49:56

1、安装

rpm -ivh http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.14.2-1.el7_4.ngx.x86_64.rpm

Centos7Yum安装配置指定版本nginx

2、启动

# systemctl start nginx
// 验证是否启动成功
# curl http://127.0.0.1:80
// 正常会返回html代码

Centos7Yum安装配置指定版本nginx

3、设置开机启动服务

 systemctl enable nginx

Centos7Yum安装配置指定版本nginx

4、常用命令

// 服务状态
# systemctl status nginx
// 服务启动
# systemctl start nginx
// 服务停止
# systemctl stop nginx
// 服务重启
# systemctl restart nginx