下载
openssl zlib pcre nginx
https://codeload.github.com/openssl/openssl/tar.gz/OpenSSL_1_1_1e
https://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
https://jaist.dl.sourceforge.net/project/pcre/pcre/8.44/pcre-8.44.tar.gz
http://nginx.org/download/nginx-1.18.0.tar.gz
将以上源码上传至root目录
编译
[root@localhost ~]# tar -zxf pcre-8.44.tar.gz
[root@localhost ~]# cd ~/pcre-8.44
[root@localhost pcre-8.44]# ./configure --prefix=/usr/local/pcre-8.44
[root@localhost pcre-8.44]# make
[root@localhost ~]# cd ~
[root@localhost ~]# tar -zxf zlib-1.2.11.tar.gz
[root@localhost ~]# cd zlib-1.2.11
[root@localhost zlib-1.2.11]# ./configure --prefix=/usr/local/zlib-1.2.11
[root@localhost zlib-1.2.11]# make
[root@localhost zlib-1.2.11]#cd ~
[root@localhost ~]#tar -zxf openssl-OpenSSL_1_1_1e.tar.gz
[root@localhost ~]#cd openssl-OpenSSL_1_1_1e
[root@localhost openssl-OpenSSL_1_1_1e]#./config no-shared --prefix=/usr/local/openssl-1.1.1e --openssldir=ssl
[root@localhost openssl-OpenSSL_1_1_1e]#make
[root@localhost openssl-OpenSSL_1_1_1e]#cd ~
[root@localhost ~]#tar -zxf nginx-1.18.0.tar.gz
[root@localhost ~]#cd nginx-1.18.0
[root@localhost nginx-1.18.0]#./configure --prefix=/usr/local/nginx6 --with-http_ssl_module --with-pcre=/root/pcre-8.44 --with-zlib=/root/zlib-1.2.11 --with-openssl=/root/openssl-OpenSSL_1_1_1e
[root@localhost nginx-1.18.0]#make
[root@localhost nginx-1.18.0]#make install
说明
本地gcc版本为4.8.2
[root@localhost openssl-OpenSSL_1_1_1e]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-2/root/usr --mandir=/opt/rh/devtoolset-2/root/usr/share/man --infodir=/opt/rh/devtoolset-2/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/dev/shm/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/isl-install --with-cloog=/dev/shm/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/cloog-install --with-mpc=/dev/shm/home/centos/rpm/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.2 20140120 (Red Hat 4.8.2-15) (GCC)