nginx 备份及卸载

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx 备份及卸载相关的知识,希望对你有一定的参考价值。

1.备份

[root@localhost home]# mkdir nginx_bak
[root@localhost home]# ls
nginx-1.22.0-1.el7.ngx.x86_64.rpm nginx_bak tomcat
[root@localhost home]# cd /etc/nginx/
[root@localhost nginx]# ls
conf.d fastcgi_params mime.types modules nginx.conf scgi_params uwsgi_params
[root@localhost nginx]# cp -r conf.d/ /home/nginx_bak/
[root@localhost nginx]# cp -r nginx.conf /home/nginx_bak/
[root@localhost nginx]# cd /home/nginx_bak/
[root@localhost nginx_bak]# ls
conf.d nginx.conf
[root@localhost nginx_bak]#
  1. 卸载

1停2删除相关目录3开机启动删除


[root@localhost home]# /usr/sbin/nginx -s stop
[root@localhost home]# ps -ef | grep nginx
root 11911 11723 0 23:19 pts/1 00:00:00 grep --color=auto nginx

[root@localhost home]# find / -name nginx
/etc/logrotate.d/nginx
/etc/nginx
/var/log/nginx
/var/cache/nginx
/usr/sbin/nginx
/usr/lib64/nginx
/usr/share/nginx
/usr/libexec/initscripts/legacy-actions/nginx
[root@localhost home]# rm -rf /etc/nginx
[root@localhost home]# rm -rf /var/log/nginx
[root@localhost home]# rm -rf /var/cache/nginx
[root@localhost home]# rm -rf /usr/sbin/nginx
[root@localhost home]# rm -rf /usr/lib64/nginx
[root@localhost home]# rm -rf /usr/share/nginx
[root@localhost home]# rm -rf /usr/libexec/initscripts/legacy-actions/nginx


[root@localhost home]# find / -name nginx


[root@localhost home]# ps -ef | grep nginx
root 12657 11723 0 23:31 pts/1 00:00:00 grep --color=auto nginx

[root@localhost home]# yum remove nginx

[root@localhost home]# chkconfig nginx off

[root@localhost home]# rm -rf /etc/init.d/nginx

以上是关于nginx 备份及卸载的主要内容,如果未能解决你的问题,请参考以下文章

卸载nginx之后重新安装

Centos7卸载nginx及phpphp-fpm方法

nginx--基于crond定时服务+shell脚本实现nginx日志自动清理及备份

Centos7Yum安装配置指定版本nginx及卸载Centos7Yum安装的nginx

如何彻底卸载安装在lnmp环境下的ssl证书?

linux服务器nginx的卸载和安装