CentOS 不能使用yum命令安装Nginx -手动安装pcre、zlib、openssl

之所以手动安装是因为阿里云无法使用yum安装,Nginx安装需要-手动安装pcre、zlib、openssl。

1、安装pcre

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.33.tar.gz

tar -zxvf pcre-8.33.tar.gz

mv pcre-8.33 /usr/local/pcre

cd /usr/local/pcre

# 配置自动管理目录
    
./configure

# 编译 & 编译安装

make

make install

2、安装zlib

tar -zxvf zlib-1.2.11.tar.gz

mv zlib-1.2.11 /usr/local/zlib

cd /usr/local/zlib


./configure

make

make check

make install

echo "/usr/local/zlib/lib" >> /etc/ld.so.conf

ldconfig -v


3、安装OpenSSL

wget https://www.openssl.org/source/openssl-1.1.1f.tar.gz

tar -zxvf openssl-1.1.1f.tar.gz

cd openssl-1.1.1f


./config  

make

make install


#写入openssl库文件的搜索路径

 echo "/usr/local/openssl/lib" >> /etc/ld.so.conf

#使修改后的/etc/ld.so.conf生效

ldconfig -v

# 查看版本

 openssl version

4、安装Nginx

tar -zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0
./configure   --with-pcre=/usr/local/pcre --with-zlib=/usr/local/zlib --with-openssl=/usr/local/openssl

make & make install
原文地址:https://www.cnblogs.com/boonya/p/13132547.html