Skip to content

Instantly share code, notes, and snippets.

@iandyh
Forked from marklkelly/openresty-http2-install.sh
Last active November 4, 2016 01:36
Show Gist options
  • Save iandyh/64ebc0ff3b2df1d7d85150658658f4e2 to your computer and use it in GitHub Desktop.
Save iandyh/64ebc0ff3b2df1d7d85150658658f4e2 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o errexit
clear
# Set versions. Check http://openresty.org for latest version and bundled version of nginx.
OPENRESTY_VERSION=1.11.2.1
NGINX_VERSION=1.9.3
OPENSSL_VERSION=1.0.2d
# Install some pre-requisites
yum install -y readline-devel pcre-devel gcc zlib-devel patch
# Get OpenResty
cd /usr/local/src/
git clone https://github.com/yzprofile/ngx_http_dyups_module.git
wget http://openresty.org/download/ngx_openresty-${OPENRESTY_VERSION}.tar.gz
tar vxf ngx_openresty-${OPENRESTY_VERSION}.tar.gz
# Get OpenSSL
wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
tar vxf openssl-${OPENSSL_VERSION}.tar.gz
# Now we can build OpenResty / Nginx.
cd /usr/local/src/ngx_openresty-${OPENRESTY_VERSION}
./configure --with-http_ssl_module \
--with-luajit \
--with-openssl=/usr/local/src/openssl-${OPENSSL_VERSION} \
--with-http_v2_module \
--add-module=/usr/local/src/ngx_http_dyups_module
make && make install
# Check install.
/usr/local/openresty/nginx/sbin/nginx -t
/usr/local/openresty/nginx/sbin/nginx -V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment