-
官方下载RPM 包
http://nginx.org/packages/centos/7/x86_64/RPMS/
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/ 目录下,
5.卸载
查看是否安装nginx
rpm -qa | grep nginx
卸载前先停止nginx
systemctl stop nginx
卸载
rpm -e nginx
删除文件
rm -rf /etc/nginx/
启动bug:
nginx: [emerg] bind() to 0.0.0.0:xxxx failed (13: Permission denied)
解决网址
https://blog.csdn.net/qq_32448349/article/details/109725173