安装了捆绑了ngx_small_light的自制NGINX
听说通过homebrew/tap安装nginx,就可以安装ngx_small_light插件,所以我试了一下。
$ brew tap homebrew/nginx
$brew info nginx-full | grep small-light
--with-small-light-module
$
由于在nginx-full中添加了–with-small-light-module选项,因此使用此选项似乎是一个不错的选择。
$ brew install nginx-full --with-small-light-module
==> Installing nginx-full from homebrew/homebrew-nginx
==> Installing nginx-full dependency: small-light-nginx-module
==> Downloading https://github.com/cubicdaiya/ngx_small_light/archive/v0.6.6.tar.gz
Already downloaded: /Library/Caches/Homebrew/small-light-nginx-module-0.6.6.tar.gz
� /usr/local/Cellar/small-light-nginx-module/0.6.6: 33 files, 232K, built in 2 seconds
==> Installing nginx-full
==> Downloading http://nginx.org/download/nginx-1.6.2.tar.gz
######################################################################## 100.0%
==> ./setup
==> ./configure --prefix=/usr/local/Cellar/nginx-full/1.6.2 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/usr/local/Cellar/nginx-full/1.6.2/bi
==> make
==> make install
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
- Tips -
Run port 80:
$ sudo chown root:wheel /usr/local/Cellar/nginx-full/1.6.2/sbin/nginx
$ sudo chmod u+s /usr/local/Cellar/nginx-full/1.6.2/sbin/nginx
Reload config:
$ nginx -s reload
Reopen Logfile:
$ nginx -s reopen
Stop process:
$ nginx -s stop
Waiting on exit process
$ nginx -s quit
To have launchd start nginx-full at login:
ln -sfv /usr/local/opt/nginx-full/*.plist ~/Library/LaunchAgents
Then to load nginx-full now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx-full.plist
==> Summary
� /usr/local/Cellar/nginx-full/1.6.2: 7 files, 940K, built in 20 seconds
$ /usr/local/bin/nginx -V
nginx version: nginx/1.6.2
built by clang 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/Cellar/nginx-full/1.6.2 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/usr/local/Cellar/nginx-full/1.6.2/bin/nginx --with-cc-opt='-I/usr/local/include -I/usr/local/opt/pcre/include -I/usr/local/opt/openssl/include' --with-ld-opt='-L/usr/local/lib -L/usr/local/opt/pcre/lib -L/usr/local/opt/openssl/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock --http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --add-module=/usr/local/share/small-light-nginx-module
我们的ngx_small_light模块已经正确添加了。非常感谢@Tei1988用户提供的PR。