之所以手动安装是因为阿里云无法使用yum安装,Nginx安装需要-手动安装perl、pcre、zlib、openssl。
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
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
wget https://www.cpan.org/src/5.0/perl-5.28.0.tar.gz # tar -zxvf perl-5.28.0.tar.gz cd perl-5.28.0 ./Configure -des -Dprefix=/usr/local/perl make make test make install
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
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
CentOS 不能使用yum命令安装Nginx -手动安装perl、pcre、zlib、openssl
原文:https://www.cnblogs.com/boonya/p/13132547.html