1. 程式人生 > 其它 >nginx編譯引數詳解

nginx編譯引數詳解

nginx編譯引數詳解

  1. -–prefix=PATH #指向安裝目錄
  2. -–sbin-path=PATH #指向(執行)程式檔案(nginx)
  3. -–conf-path=PATH #指向配置檔案(nginx.conf)
  4. -–error-log-path=PATH #指向錯誤日誌目錄
  5. -–pid-path=PATH #指向pid 檔案(nginx.pid)
  6. -–lock-path=PATH #指向 lock 檔案(nginx.lock)(安裝檔案鎖定,防止安裝檔案被別人利用,或自己誤操作。)
  7. -–user=USER #指定程式執行時的非特權使用者
  8. -–group=GROUP #指定程式執行時的非特權使用者組
  9. -–builddir=DIR #指向編譯目錄
  10. -–with-rtsig_module #啟用 rtsig 模組支援(實時訊號)
  11. -–with-select_module #啟用 select 模組支援(一種輪詢模式,不推薦在高載環境下使用)禁用: –withoutselect_module
  12. -–with-poll_module #啟用 poll 模組支援(功能與 select 相同,與 select 特性相同,為一種輪詢模式,不推薦在高載環境下使用)
  13. -–with-file-aio #啟用 file aio 支援(一種 APL 檔案傳輸格式)
  14. -–with-ipv6 #啟用 ipv6 支援
  15. -–with-http_ssl_module #啟用ngx_http_ssl_module 支援(使支援 https 請求,需已安裝 openssl)
  16. -–with-http_realip_module #啟用 ngx_http_realip_module 支援(這個模組允許從請求標頭更改客戶端的 IP 地址值,預設為關)
  17. -–with-http_addition_module #啟用 ngx_http_addition_module 支援(作為一個輸出過濾器,支援不完全緩衝,分部分響應請求)
  18. -–with-http_xslt_module #啟用 ngx_http_xslt_module 支援(過濾轉換 XML 請求)
  19. -–with-http_image_filter_module 啟用 ngx_http_image_filter_module 支援(傳輸JPEG/GIF/PNG 圖片的一個過濾器)(預設為不啟用。 gd 庫要用到)
  20. -–with-http_geoip_module #啟用 ngx_http_geoip_module 支援(該模組建立基於與 MaxMind GeoIP 二進位制檔案相配的客戶端 IP 地址的 ngx_http_geoip_module 變數)
  21. -–with-http_sub_module #啟用 ngx_http_sub_module 支援(允許用一些其他文字替換 nginx 響應中的一些文字)
  22. -–with-http_dav_module #啟用 ngx_http_dav_module 支援(增加 PUT,DELETE,MKCOL:建立集合,COPY 和 MOVE 方法)預設情況下為關閉,需編譯開啟
  23. -–with-http_flv_module # 啟用 ngx_http_flv_module 支援(提供尋求記憶體使用基於時間的偏移量檔案)
  24. -–with-http_gzip_static_module #啟用 ngx_http_gzip_static_module 支援(線上實時壓縮輸出資料流)
  25. -–with-http_random_index_module #啟用 ngx_http_random_index_module 支援(從目錄中隨機挑選一個目錄索
  26. 引)
  27. -–with-http_secure_link_module #啟用 ngx_http_secure_link_module 支援(計算和檢查要求所需的安全連結網址)
  28. with-http_degradation_module #啟用 ngx_http_degradation_module 支援(允許在記憶體不足的情況下返回204 或 444 碼)
  29. -–with-http_stub_status_module #啟用 ngx_http_stub_status_module 支援(獲取 nginx 自上次啟動以來的工作狀態)
  30. -–without-http_charset_module #禁用 ngx_http_charset_module 支援(重新編碼 web 頁面,但只能是一個方向伺服器端到客戶端,並且只有一個位元組的編碼可以被重新編碼)
  31. -–without-http_gzip_module #禁用 ngx_http_gzip_module 支援(該模組同-with-http_gzip_static_module 功能一樣)
  32. -–without-http_ssi_module #禁用 ngx_http_ssi_module 支援(該模組提供了一個在輸入端處理處理伺服器包含檔案(SSI)的過濾器,目前支援 SSI 命令的列表是不完整的)
  33. -–without-http_userid_module #禁用 ngx_http_userid_module 支援(該模組用來處理用來確定客戶端後續請求的 cookies)
  34. -–without-http_access_module #禁用 ngx_http_access_module 支援(該模組提供了一個簡單的基於主機的訪問控制。允許/拒絕基於 ip 地址)
  35. -–without-http_auth_basic_module #禁用 ngx_http_auth_basic_module(該模組是可以使用使用者名稱和密碼基於http 基本認證方法來保護你的站點或其部分內容)
  36. -–without-http_autoindex_module #禁用 disable ngx_http_autoindex_module 支援(該模組用於自動生成目錄列表,只在 ngx_http_index_module 模組未找到索引檔案時發出請求。)
  37. -–without-http_geo_module #禁用 ngx_http_geo_module 支援(建立一些變數,其值依賴於客戶端的 IP 地址)
  38. -–without-http_map_module # 禁用 ngx_http_map_module 支援(使用任意的鍵/值對設定配置變數)
  39. -–without-http_split_clients_module #禁用 ngx_http_split_clients_module 支援(該模組用來基於某些條件劃分使用者。條件如: ip 地址、報頭、 cookies 等等)
  40. -–without-http_referer_module #禁用 disable ngx_http_referer_module 支援(該模組用來過濾請求,拒絕報頭中 Referer 值不正確的請求)
  41. -–without-http_rewrite_module #禁用 ngx_http_rewrite_module 支援(該模組允許使用正則表示式改變 URI,並且根據變數來轉向以及選擇配置。如果在 server 級別設定該選項, 那麼他們將在 location 之前生效。如果在location 還有更進一步的重寫規則, location 部分的規則依然會被執行。如果這個 URI 重寫是因為 location 部分的規則造成的,那麼 location 部分會再次被執行作為新的 URI。 這個迴圈會執行 10 次,然後 Nginx 會返回一個 500 錯誤。)
  42. -–without-http_proxy_module #禁用 ngx_http_proxy_module 支援(有關代理伺服器)
  43. -–without-http_fastcgi_module #禁用 ngx_http_fastcgi_module 支援(該模組允許 Nginx 與 FastCGI 程序互動,並通過傳遞引數來控制 FastCGI 程序工作。 ) FastCGI 一個常駐型的公共閘道器介面。
  44. -–without-http_uwsgi_module #禁用 ngx_http_uwsgi_module 支援(該模組用來醫用 uwsgi 協議, uWSGI 伺服器相關)
  45. -–without-http_scgi_module #禁用 ngx_http_scgi_module 支援(該模組用來啟用 SCGI 協議支援, SCGI 協議是CGI 協議的替代。它是一種應用程式與 HTTP 服務介面標準。它有些像 FastCGI 但他的設計 更容易實現。)
  46. -–without-http_memcached_module #禁用 ngx_http_memcached_module 支援(該模組用來提供簡單的快取,以提高系統效率)
  47. --without-http_limit_zone_module #禁用 ngx_http_limit_zone_module 支援(該模組可以針對條件,進行會話的併發連線數控制)
  48. -–without-http_limit_req_module #禁用 ngx_http_limit_req_module 支援(該模組允許你對於一個地址進行請求數量的限制用一個給定的 session 或一個特定的事件)
  49. -–without-http_empty_gif_module #禁用 ngx_http_empty_gif_module 支援(該模組在記憶體中常駐了一個 1*1 的透明 GIF 影象,可以被非常快速的呼叫)
  50. -–without-http_browser_module #禁用 ngx_http_browser_module 支援(該模組用來建立依賴於請求報頭的值。如果瀏覽器為 modern ,則$modern_browser 等於 modern_browser_value 指令分配的值;如 果瀏覽器為 old,則$ancient_browser 等於 ancient_browser_value 指令分配的值;如果瀏覽器為 MSIE 中的任意版本,則 $msie 等於 1)
  51. -–without-http_upstream_ip_hash_module #禁用 ngx_http_upstream_ip_hash_module 支援(該模組用於簡單的負載均衡)
  52. -–with-http_perl_module #啟用 ngx_http_perl_module 支援(該模組使 nginx 可以直接使用 perl 或通過 ssi 呼叫 perl)
  53. -–with-perl_modules_path= #設定 perl 模組路徑
  54. -–with-perl= #設定 perl 庫檔案路徑
  55. -–http-log-path= #設定 access log 路徑
  56. -–http-client-body-temp-path= #設定 http 客戶端請求臨時檔案路徑
  57. -–http-proxy-temp-path= #設定 http 代理臨時檔案路徑
  58. -–http-fastcgi-temp-path= #設定 http fastcgi 臨時檔案路徑
  59. -–http-uwsgi-temp-path= #設定 http uwsgi 臨時檔案路徑
  60. -–http-scgi-temp-path= #設定 http scgi 臨時檔案路徑
  61. --without-http #禁用 http server 功能
  62. -–without-http-cache #禁用 http cache 功能
  63. -–with-mail #啟用 POP3/IMAP4/SMTP 代理模組支援
  64. -–with-mail_ssl_module #啟用 ngx_mail_ssl_module 支援
  65. -–without-mail_pop3_module #禁用 pop3 協議(POP3 即郵局協議的第 3 個版本,它是規定個人計算機如何連線到網際網路上的郵件伺服器進行收發郵件的協議。是因特網電子郵件的第一個離線協議標 準,POP3 協議允許使用者從伺服器上把郵件儲存到本地主機上,同時根據客戶端的操作刪除或儲存在郵件伺服器上的郵件。 POP3 協議是 TCP/IP 協議族中的一員,主要用於 支援使用客戶端遠端管理在伺服器上的電子郵件)
  66. -–without-mail_imap_module #禁用 imap 協議(一種郵件獲取協議。它的主要作用是郵件客戶端可以通過這種協議從郵件伺服器上獲取郵件的資訊,下載郵件等。 IMAP 協議執行在 TCP/IP 協議之上, 使用的埠是 143。它與POP3 協議的主要區別是使用者可以不用把所有的郵件全部下載,可以通過客戶端直接對伺服器上的郵件進行操作。)
  67. -–without-mail_smtp_module #禁用 smtp 協議(SMTP 即簡單郵件傳輸協議,它是一組用於由源地址到目的地址傳送郵件的規則,由它來控制信件的中轉方式。 SMTP 協議屬於 TCP/IP 協議族,它幫助每臺計算機在傳送或中轉信件時找到下一個目的地。)
  68. -–with-google_perftools_module #啟用 ngx_google_perftools_module 支援(除錯用,剖析程式效能瓶頸)
  69. -–with-cpp_test_module # 啟用 ngx_cpp_test_module 支援
  70. -–add-module= #啟用外部模組支援
  71. -–with-cc= #指向 C 編譯器路徑
  72. -–with-cpp= #指向 C 預處理路徑
  73. -–with-cc-opt= #設定 C 編譯器引數(PCRE 庫,需要指定–with-cc-opt=” -I /usr/local/include”,如果使用select()函式則需要同時增加檔案描述符數量,可以通過–with-cc- opt=” -D FD_SETSIZE=2048”指定。)
  74. -–with-ld-opt= #設定連線檔案引數。(PCRE 庫,需要指定–with-ld-opt=” -L /usr/local/lib”。)
  75. -–with-cpu-opt= #指定編譯的 CPU,可用的值為: pentium, pentiumpro, pentium3, pentium4, athlon,opteron, amd64, sparc32, sparc64, ppc64
  76. -–without-pcre #禁用 pcre 庫
  77. -–with-pcre #啟用 pcre 庫
  78. -–with-pcre= #指向 pcre 庫檔案目錄
  79. -–with-pcre-opt= #在編譯時為 pcre 庫設定附加引數
  80. -–with-md5= #指向 md5 庫檔案目錄(訊息摘要演算法第五版,用以提供訊息的完整性保護)
  81. -–with-md5-opt= #在編譯時為 md5 庫設定附加引數
  82. -–with-md5-asm #使用 md5 彙編源
  83. -–with-sha1= #指向 sha1 庫目錄(數字簽名演算法,主要用於數字簽名)
  84. -–with-sha1-opt= #在編譯時為 sha1 庫設定附加引數
  85. -–with-sha1-asm #使用 sha1 彙編源
  86. -–with-zlib= #指向 zlib 庫目錄
  87. -–with-zlib-opt= #在編譯時為 zlib 設定附加引數
  88. -–with-zlib-asm= #為指定的 CPU 使用 zlib 彙編源進行優化, CPU 型別為 pentium, pentiumpro
  89. -–with-libatomic #為原子記憶體的更新操作的實現提供一個架構
  90. -–with-libatomic= #指向 libatomic_ops 安裝目錄
  91. -–with-openssl= #指向 openssl 安裝目錄
  92. -–with-openssl-opt #在編譯時為 openssl 設定附加引數
  93. -–with-debug #啟用 debug 日誌