1.进入安装目录:
# cd /usr/local/src
2、下载nginx源码文件
nginx网址:http://nginx.org/en/download.html
3、复制文件下载地址:http://nginx.org/download/nginx-1.22.1.tar.gz
4、开始下载:
# wget http://nginx.org/download/nginx-1.22.1.tar.gz
5、解压
# tar -zxvf nginx-1.22.1.tar.gz
6、进入解压后的目录
# cd nginx-1.22.1
7、安装 pcre-devel
# yum install pcre-devel
8、源码安装zlib
# cd /usr/local/src/ # wget http://www.zlib.net/zlib-1.2.13.tar.gz # tar -zxvf zlib-1.2.13.tar.gz
9、编译Nginx
# cd /usr/local/src/nginx-1.22.1 # ./configure --prefix=/usr/local/nginx --with-pcre --with-zlib=/usr/local/src/zlib-1.2.13
10、安装Nginx
# make
11、最后
# make install
12、启动Nginx
# /usr/local/nginx/sbin/nginx
标签:编译,tar,nginx,local,zlib,gz,Nginx,usr,安装 From: https://www.cnblogs.com/dndt/p/17437425.html