linux centos7 rpm 安装nginx

1. 官方下载RPM 包

http://nginx.org/packages/centos/7/x86_64/RPMS/

我这里下载nginx-1.18.0-1.el7.ngx.x86_64

2.上传服务器执行安装

rpm -ivh nginx-1.18.0-1.el7.ngx.x86_64.rpm

3.启动nginx

systemctl start nginx

4.加入开机自启

#查看nginx 是否 开机自启
systemctl list-unit-files | grep nginx

#设置nginx 开机自启
systemctl enable  nginx

rpm 安装方式nginx 默认安装位置在 /etc/nginx/ 目录下, 

linux centos7 rpm 安装nginx_第1张图片

5.卸载

# 查看是否安装nginx
rpm -qa | grep nginx

# 卸载前先停止nginx
systemctl stop nginx

#卸载
rpm -e nginx

#删除文件
rm -rf /etc/nginx/

 

你可能感兴趣的:(centos7)