之所以手動安裝是因為阿里雲無法使用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