brew方式安裝,簡單,但是有兩個很蛋疼的地方, 第一是不能指定版本號,第二是安裝完以後,nginx的目錄到處都是,不便於管理。簡直反人類,無法忍受。
但是還是說下安裝方式:
brew tap denji/homebrew-nginx
brew install nginx-full --with-rtmp-module
brew info nginx-full
nginx.conf在/usr/local/etc/nginx/nginx.conf
html路徑:/usr/local/var/www
下面說第二種安裝方式,就是自己編譯安裝。
給sudo權限
./configure --prefix=/usr/local/nginx --with-ld-opt="-L/usr/local/opt/openssl/lib/ -L/usr/local/opt/pcre/lib/" --with-cc-opt="-I/usr/local/opt/openssl/include/ -I/usr/local/opt/pcre/include/" --with-http_ssl_module --add-module=../nginx-rtmp-module-1.2.1
make && make install