​nginx依赖模块pcre、zlib、openssl 安装

环境

系统:centos7
nginx版本:1.12.2

nginx 下载地址:

https://nginx.org/download/

gzip模块需要 zlib 库

http://www.zlib.net/fossils/

rewrite模块需要 pcre 库

https://ftp.pcre.org/pub/pcre/

ssl 功能需要openssl库

https://www.openssl.org/source/

安装gcc

yum install gcc gcc-c++

下载

cd /opt/
wget https://nginx.org/download/nginx-1.12.2.tar.gz
wget https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz
wget http://www.zlib.net/fossils/zlib-1.2.11.tar.gz
wget https://www.openssl.org/source/old/1.1.0/openssl-1.1.0f.tar.gz

解压

tar -zxvf nginx-1.12.2.tar.gz
tar -zxvf pcre-8.41.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
tar -zxvf openssl-1.1.0f.tar.gz

开始安装

cd pcre-8.41/
./configure 
make && make install

cd ../zlib-1.2.11/
./configure 
make && make install

cd ../openssl-1.1.0f/
./config
make && make install

cd ../nginx-1.12.2/
./configure \
--prefix=/usr/local/nginx/ \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_gzip_static_module \
--with-pcre=../pcre-8.41 \
--with-zlib=../zlib-1.2.11 \
--with-openssl=../openssl-1.1.0f \
--with-http_secure_link_module \
--with-http_random_index_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_gzip_static_module \
--with-cc-opt=-O3 \
--with-http_gunzip_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_auth_request_module \
--with-threads \
--with-stream_ssl_module \
--with-http_slice_module \
--with-file-aio \
--with-http_v2_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module

make && make install

启动服务

/usr/local/nginx/sbin/nginx

转载于:https://blog.51cto.com/chaichuan/2070387

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值