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
1)Nginx官网下载地址
http://nginx.org/en/download.html
2)下载在/usr/local目录并解压
cd /data/install/ && wget http://nginx.org/download/nginx-1.27.3.tar.gz
tar xvzf nginx-1.27.3.tar.gz && cd nginx-1.27.3
3)编译并安装
yum -y install pcre-devel openssl openssl-devel
sudo apt update && sudo apt install libpcre3-dev libssl-dev
#debian12
sudo apt update &&sudo apt install libgd-dev -y
# 确认 libgd-dev 是否正确安装
dpkg -l | grep libgd-dev
./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
make && make install
参考:https://blog.csdn.net/hfsu0419/article/details/7190152/
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
错误指南 https://blog.csdn.net/sanchan/article/details/51213382
图片处理模块需要安装依赖
./configure: error: the HTTP image filter module requires the GD library.
You can either do not enable the module or install the libraries.
yum install gd-devel yum install gd
./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