- 安裝一些需要的依賴
yum install readline-devel pcre-devel openssl-devel gcc
- 爲了支持 http2 ,依次執行以下命令
cd /opt/
wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
tar -zxvf openssl-1.0.2-laest.tar.gz
- 開始 openresty 部分,依次執行
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
tar -zxvf openresty-1.13.6.2.tar.gz
cd openresty-1.13.6.2
./configure --prefix=/opt/openresty --with-luajit --without-http_redis2_module --with-http_iconv_module --with-http_v2_module --with-openssl=/opt/openssl-1.0.2p
make
make install
- 啓動 nginx
/opt/openresty/nginx/sbin/nginx -c /opt/openresty/nginx/conf/nginx.conf -p /opt/openresty/nginx/