1.下载安装包
cd/usr/local/src
wgetftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gzhttp://zlib.net/zlib-1.2.8.tar.gz http://nginx.org/download/nginx-1.9.2.tar.gzhttp://nginx.org/download/nginx-1.9.2.tar.gz
2.安装PCRE库及zlib库
tar -zxvf pcre-8.37.tar.gz && tar-zxvf zlib-1.2.8.tar.gz nginx-1.9.2.tar.gz
cd pcre-8.37
ls
./configure && make && makeinstall
cd ../zlib-1.2.8
./configure && make && makeinstall
3.编译安装
cd /usr/local/src/nginx-1.9.2
法一
./configure --prefix=/usr/local/nginx--conf-path=/usr/local/nginx/nginx.conf --with-pcre=/usr/local/src/pcre-8.37--with-zlib=/usr/local/src/zlib-1.2.8
法二、
./configure--sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf--pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module--with-pcre=/usr/local/src/pcre-8.37 --with-zlib=/usr/local/src/zlib-1.2.8--with-openssl=/usr/local/src/openssl-1.0.2c
重启
# /usr/local/nginx/sbin/nginx -s reload
本文转自 xoyabc 51CTO博客,原文链接:http://blog.51cto.com/xoyabc/1665765,如需转载请自行联系原作者