在mac上不通过brew安装nginx
brew
🍺 The missing package manager for macOS (or Linux)
项目地址:https://gitcode.com/gh_mirrors/br/brew
免费下载资源
·
建议在终端上挂代理,这样比较快
Install Nginx on Mac OS from source
no Homebrew required
- Download Nginx
$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
- Download the PCRE library
The PCRE library distribution (version 4.4 — 8.41) needs to be downloaded from the PCRE site and extracted. The rest is done by nginx’s ./configure and make. PCRE is required for the http_rewrite_module, and also for regular expressions support in the location directive.
$ curl -OL https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz
$ tar xvzf pcre-8.41.tar.gz && rm pcre-8.41.tar.gz
- Configure Nginx
See the full list of ./configure options: http://nginx.org/en/docs/configure.html.
$ cd nginx-1.12.2/
Compile nginx without SSL support
$ ./configure --with-pcre=../pcre-8.41/
with SSL support
Download OpenSSL sources and extract:
$ curl -OL https://www.openssl.org/source/openssl-1.1.0.tar.gz
$ tar xvzf openssl-1.1.0.tar.gz && rm openssl-1.1.0.tar.gz
Compile Nginx:
$ cd ../nginx-1.12.2/
$ ./configure --with-pcre=../pcre-8.41/ --with-http_ssl_module --with-openssl=/usr/local/src/openssl-1.1.0
- Install Nginx
$ [sudo] make && make install
Add the nginx binary to $PATH:
export PATH="/usr/local/nginx/sbin:$PATH"
GitHub 加速计划 / br / brew
40.4 K
9.47 K
下载
🍺 The missing package manager for macOS (or Linux)
最近提交(Master分支:1 个月前 )
90a90b30
1 个月前
47b1cab7
1 个月前
更多推荐
已为社区贡献1条内容
所有评论(0)