下载最新版本的nginx
访问http://nginx.org可以找到最新版本的nginx,目前最新稳定版本是1.12.2
下载地址:http://nginx.org/download/nginx-1.12.2.tar.gz
依赖包pcre、openssl和zlib
pcre 使用正则匹配所需的包
官方地址 :http://pcre.org
opnessl 使用ssl协议所需要的包
官方地址 :http://www.openssl.org
zlib 使用gzip压缩算法需要的包
官方地址 :http://zlib.net
目前三个使用包的最新版本是 pcre-8.41 、 openssl-1.0.2l zlib-1.2.11
下载地址 :
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
https://www.openssl.org/source/openssl-1.0.2l.tar.gz
http://zlib.net/zlib-1.2.11.tar.gz
使用wget下载
切换到root目录进行下载,为了防止权限问题,编译安装过程都使用root用户进行操作
cd /root/
wget -c http://nginx.org/download/nginx-1.12.2.tar.gz
wget -c https://www.openssl.org/source/openssl-1.0.2l.tar.gz
wget -c http://zlib.net/zlib-1.2.11.tar.gz
wget -c ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
创建运行用户
useradd -M -s /sbin/nolog www
安装编译工具
yum -y install gcc gcc-c++ make
解压编译并安装
tar zxf nginx-1.12.2.tar.gz
tar zxf openssl-1.0.2l.tar.gz
tar zxf zlib-1.2.11.tar.gz
tar zxf pcre-8.41.tar.gz
cd nginx-1.12.2
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_stub_status_module --with-openssl=../openssl-1.0.2l --with-pcre=../pcre-8.41 --with-zlib=../zlib-1.2.11
make
make install
本文暂时没有评论,来添加一个吧(●'◡'●)