Linux Centos 7 openresty 1.13.6 安装配置 开启http2

yum install readline-devel pcre-devel  gcc   gcc-c++  
  • openssl 1.0.2+ 当前不兼容openssl-1.1
wget https://www.openssl.org/source/openssl-1.0.2n.tar.gz  
tar zxf openssl-1.0.2n.tar.gz  
cd openssl-1.0.2n  
./config --prefix=/usr/local/openssl
make && make install  
mv /usr/bin/openssl  /usr/bin/openssl.old  
mv /usr/include/openssl /usr/include/openssl.old  
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl  
ln -s /usr/local/openssl/include/openssl /usr/include/openssl  
ln -s /usr/local/openssl/lib/libssl.so /usr/local/lib64/libssl.so  
ln -s /usr/local/openssl/lib/libcrypto.so /usr/local/lib64/libcrypto.so  
strings /usr/local/lib64/libssl.so | grep OpenSSL  
echo '/usr/local/openssl/lib' >> /etc/ld.so.conf  
ldconfig -v  
  • prce
https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz  
tar zxf pcre-8.41.tar.gz  
cd pcre-8.41  
./configure --prefix=/usr/local/pcre
make && make install  
  • openresty
wget https://openresty.org/download/openresty-1.13.6.1.tar.gz  
tar zxf openresty-1.13.6.1.tar.gz  
cd openresty-1.13.6.1  
./configure --with-luajit  --with-http_iconv_module  --with-http_realip_module --with-http_stub_status_module --user=www --group=www --with-http_v2_module --with-pcre=../pcre-8.41 --with-openssl=../openssl-1.0.2n

gmake && gmake install