源碼包地址
https://openresty.org/download/openresty-1.15.8.1.tar.gz
在編譯源碼之前需要確保本機已經(jīng)安裝了依賴環(huán)境
brew install pcre openssl
安裝完成之后就可以編譯了谣妻,下面的例子是自定義模塊的編譯蹋半,添加了HTTP2模塊
./configure --prefix=/Users/user/soft/openresty/nginx\
--with-cc-opt="-I/usr/local/opt/openssl/include/ -I/usr/local/opt/pcre/include/" \
--with-ld-opt="-L/usr/local/opt/openssl/lib/ -L/usr/local/opt/pcre/lib/" \
--with-luajit\
--without-http_redis2_module \
--with-http_v2_module
如果以上步驟沒有問題充坑,最后應該會出現(xiàn)下面的字樣
Type the following commands to build and install:
make
sudo make install
按提示繼續(xù)操作就可以了
make && make install