CentOS7卸载及安装Nginx
CentOS7卸载及安装Nginx
1、查询Nginx服务并停掉
ps -ef | grep nginx
kill -9 29377
2、.查找、删除Nginx相关文件
whereis nginx
find / -name nginx
3、使用yum清理
yum remove nginx
5.备份原来的Nginx配置
tar cvzf nginx201912191626.tar.gz nginx/
6.安装新的Nginx
sudo yum -y update
sudo yum -y install epel-release
sudo yum -y install vim wget lrzsz pcre pcre-devel openssl openssl-devel zlib zlib-devel lua luajit gcc gcc-c++ axel telnet
cd /usr/local/src
wget https://nchc.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
cd nginx-1.16.1
./configure --prefix=/usr/local/nginx --with-debug --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module
./configure --prefix=/usr/local/nginx --with-debug --with-luajit --user=nobody --group=nobody --with-threads --with-file-aio --with-http_sub_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-stream --with-stream_ssl_module
--with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module