不使用Homebrew,在MacOS M1上编译安装Openresty

目录 运维

最近需要开发一个Openresty的项目,因为是Mac所以直接使用Homebrew来安装Openresty,安装完后发现Homebrew安装的Openresty的程序目录不符合自己的开发习惯,所以打算直接使用编译的方式来安装。

#!/bin/bash
#brew install pcre openssl

path=`pwd`

prefix=$path"/openresty/"
pidPath=$path"/openresty/var/run/openresty.pid"
lockPath=$path"/openresty/var/run/openresty.lock"
confPath=$path"/openresty/etc/openresty/nginx.conf"
httpLogPath=$path"/openresty/var/log/nginx/access.log"
errorLogPath=$path"/openresty/var/log/nginx/error.log"
withPath=$path"/pcre-8.45"
withOpenssl=$path"/openssl-1.1.1n"


./configure --prefix=$prefix \
--pid-path=$pidPath \
--lock-path=$lockPath \
--conf-path=$confPath \
--http-log-path=$httpLogPath \
--error-log-path=$errorLogPath \
--with-pcre=$withPath \
--with-openssl=$withOpenssl \
--with-pcre-jit \
--with-stream \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-http_v2_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_secure_link_module \
--with-http_random_index_module \
--with-http_gzip_static_module \
--with-http_sub_module \
--with-http_gunzip_module \
--with-threads \
--with-http_ssl_module

make install

链接: https://pan.baidu.com/s/1FZJQqQbl-Rtm5xAwtdKn5g?pwd=kjmt 提取码: kjmt