Mac系统的openresty编译安装

[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 

转载于:https://my.oschina.net/diluga/blog/667961

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值