nginx源碼包下載地址
http://nginx.org/en/download.html
穩定版1.12.1
http://nginx.org/download/nginx-1.12.1.tar.gz
穩定版1.10.3
http://nginx.org/download/nginx-1.10.3.tar.gz
從源碼包編譯
--prefix=
定義安裝路徑path
--sbin-path=
定義可執行文件安裝路徑path
--conf-path=
定義配置文件路徑path
--pid-path=
定義nginx.pid文件路徑path
--error-log-path=
定義錯誤日誌文件路徑path
--http-log-path=
定義訪問日誌文件路徑path
--build=
— sets an optional nginx build name.設置一個可選的Nginx建立名稱name
--user=
設置默認用戶為 nobody.name
--group=
設置默認組name
--with-select_module或
--without-select_module
允許或禁止編譯服務器使用select()方法工作。如果平臺上沒有合適的方法找到,例如kqueue,epoll,或者/dev/poll,那麽這個模塊會自動編譯。
--with-poll_module或
--without-poll_module
允許或禁止服務器工作在poll()方式。如果平臺上沒有合適的方法像kqueue,epoll或者/dev/poll,那麽這個模塊會自動編譯。
poll和select實現功能差不多,但poll效率高,以後要多用poll
--without-http_gzip_module
禁止編譯壓縮HTTP服務器回復的模塊。要想編譯和運行這麽模塊,那麽需要zlib庫的支持。--without-http_rewrite_module
禁止編譯HTTP重定向請求的模塊。為了編譯這個模塊,PCRE庫需要事先準備好。--without-http_proxy_module
禁止編譯HTTP服務器代理模塊--with-http_ssl_module
允許編譯支持HTTPS協議的模塊。默認沒編譯。為了編譯和運行這個模塊,OpenSSL庫是需要的。--with-pcre=
指定pcre庫的位置path
--with-pcre-jit
構建帶有“just-in-time compilation(運行時編譯執行的技術)”的pcre庫,支持 (1.1.12, the pcre_jit directive).--with-zlib=
指定zlib庫的位置path
--with-cc-opt=
— sets additional parameters that will be added to the CFLAGS variable. When using the system PCRE library under FreeBSD,parameters
--with-cc-opt="-I /usr/local/include"
should be specified. If the number of files supported byselect()
needs to be increased it can also be specified here such as this:--with-cc-opt="-D FD_SETSIZE=2048"
.--with-ld-opt=
設置在鏈接時候的額外的參數 (When using the system PCRE library under FreeBSD,parameters
--with-ld-opt="-L /usr/local/lib"
should be specified.)
本文出自 “菜鳥學習筆記” 博客,謝絕轉載!
nginx源碼包下載地址