[toc]
###依赖软件包安装
wget https://openresty.org/download/openresty-1.9.7.4.tar.gz
brew update
brew install pcre openssl
pcre安装完成会提示如下
==> Downloading https://homebrew.bintray.com/bottles/pcre-8.38.el_capitan.bottle
######################################################################## 100.0%
==> Pouring pcre-8.38.el_capitan.bottle.tar.gz
/usr/local/Cellar/pcre/8.38: 203 files, 5.4M
openssl安装完成会提示默认安装路径LDFLAGS 、CPPFLAGS
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
###编译安装
####编译参数
./configure --with-luajit \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_addition_module \
--with-cc-opt="-I/usr/local/Cellar/pcre/8.38/include -I/usr/local/opt/openssl/include" \
--with-ld-opt="-L/usr/local/Cellar/pcre/8.38/lib -L/usr/local/opt/openssl/lib" \
-j4
####具体编译参数
./configure --prefix=/usr/local/openresty/nginx \
--with-cc-opt='-O2 -I/usr/local/Cellar/pcre/8.38/include -I/usr/local/opt/openssl/include' \
--add-module=../ngx_devel_kit-0.2.19 \
--add-module=../echo-nginx-module-0.58 \
--add-module=../xss-nginx-module-0.05 \
--add-module=../ngx_coolkit-0.2rc3 \
--add-module=../set-misc-nginx-module-0.30 \
--add-module=../form-input-nginx-module-0.11 \
--add-module=../encrypted-session-nginx-module-0.04 \
--add-module=../srcache-nginx-module-0.30 \
--add-module=../ngx_lua-0.10.2 \
--add-module=../ngx_lua_upstream-0.05 \
--add-module=../headers-more-nginx-module-0.29 \
--add-module=../array-var-nginx-module-0.05 \
--add-module=../memc-nginx-module-0.16 \
--add-module=../redis2-nginx-module-0.12 \
--add-module=../redis-nginx-module-0.3.7 \
--add-module=../rds-json-nginx-module-0.14 \
--add-module=../rds-csv-nginx-module-0.07 \
--with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/Cellar/pcre/8.38/lib -L/usr/local/opt/openssl/lib' \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_addition_module
--with-http_ssl_module
####编译结果汇总
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
nginx path prefix: "/usr/local/openresty/nginx"
nginx binary file: "/usr/local/openresty/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/openresty/nginx/conf"
nginx configuration file: "/usr/local/openresty/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/openresty/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/openresty/nginx/logs/error.log"
nginx http access log file: "/usr/local/openresty/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
###安装
make -j4
make install