NGINX 0.8.53 编译参数详解(二)

来源:互联网 发布:知世故而不世故的女人 编辑:程序博客网 时间:2024/06/13 23:25

上次出版参数解析并未注明NGINX版本,此版本是基于NGINX 0.8.53版本完成,多数资料与网络参阅或者是英文翻译,如有发现不准确的地方,请帮忙提出,我及时做修订。


 

NGINX -- 0.8.53

--help this message
--prefix=PATH set the installation prefix
--sbin-path=PATH set path to the nginx binary file
--conf-path=PATH set path to the nginx.conf file
--error-log-path=PATH set path to the error log
--pid-path=PATH set path to nginx.pid file
--lock-path=PATH set path to nginx.lock file
--user=USER set non-privilege user
                                   for the worker processes
--group=GROUP set non-privilege group
                                   for the worker processes
--builddir=DIR set the build directory
--with-rtsig_module enable rtsig module
rtsig模块是一种实时信号,在Linux 2.2.19 默认情况下,实时信号连接数不超过1024,但是对于高负载是肯定不够的。因此通过调整内核参数/proc/sys/kernel/rtsig-max达到效果。但是Linux 2.6.6-mm2开始,这个参数不再可用,并为每个进程有一个独立的信号队列,数字是由RLIMIT_SIGPENDING确定。当队列变得满载时,nginx开始抛弃连接并使用poll方法,直到负载恢复正常。
--with-select_module enable select module
--without-select_module disable select module
标准方法。 如果当前平台没有更有效的方法,它是编译时默认的方法。你可以使用配置参数 -with-select_module 和 -without-select_module 来启用或禁用这个模块。
--with-poll_module enable poll module
--without-poll_module disable poll module
标准方法。 如果当前平台没有更有效的方法,它是编译时默认的方法。你可以使用配置参数 -with-poll_module 和 -without-poll_module 来启用或禁用这个模块。
--with-file-aio enable file aio support
aio的优点就是能够同时提交多个io请求给内核,然后直接由内核的io调度算法去处理这些请求(directio),这样的话,内核就有可能执行一些合并,优化,此模块要求内核保持在2.6.22以上。
--with-ipv6 enable ipv6 support
支持IPV6模式
--with-http_ssl_module enable ngx_http_ssl_module
提供HTTPS支持,支持通过限制检查客户端证书。
--with-http_realip_module enable ngx_http_realip_module
此模块支持显示真实来源IP地址,主要用于NGINX做前端负载均衡服务器使用。
--with-http_addition_module enable ngx_http_addition_module
应用服务器不必安装,门户网站可以安装,有利于被搜索引擎收录页面信息。
--with-http_xslt_module enable ngx_http_xslt_module
这个模块是一个过滤器,它可以通过XSLT模板转换XML应答。0.7.8后面版本才可以使用。
--with-http_image_filter_module enable ngx_http_image_filter_module
Nginx0.7.54中出现的一个模块,主要是用来裁剪过大的图片
--with-http_geoip_module enable ngx_http_geoip_module
这个模块基于客户端的IP地址创建一些ngx_http_geoip_module变量,并与MaxMindGeoIP文件进行匹配,该模块仅用于0.7.63和0.8.6版本之后。但效果不太理想,对于城市的IP记录并不是特别准确,不过对于网站的来源访问区域的分析大致有一定参考性
--with-http_sub_module enable ngx_http_sub_module
这个模块可以能够在nginx的应答中搜索并替换文本,可以完成替换静态页面的源代码的替换工作。
--with-http_dav_module enable ngx_http_dav_module
为文件和目录指定权限,限制不同类型的用户对于页面有不同的操作权限。
--with-http_flv_module enable ngx_http_flv_module
这个模块支持对FLV(flash)文件的拖动播放。
--with-http_gzip_static_module enable ngx_http_gzip_static_module
这个模块在一个预压缩文件传送到开启Gzip压缩的客户端之前检查是否已经存在以“.gz”结尾的压缩文件,这样可以防止文件被重复压缩。
--with-http_random_index_module enable ngx_http_random_index_module
从目录中选择一个随机主页,apache对于模块:mod_autoindex
--with-http_secure_link_module enable ngx_http_secure_link_module
这个模块为一个必需的安全性令牌检查请求网址,可以用于防治盗链使用,0.7.18后版本可用
--with-http_degradation_module enable ngx_http_degradation_module
无介绍
--with-http_stub_status_module enable ngx_http_stub_status_module
这个模块可以取得一些nginx的运行状态,如果是工业状况,可以直接取消。
--without-http_charset_module disable ngx_http_charset_module
这个模块将在应答头中为"Content-Type"字段添加字符编码
--without-http_gzip_module disable ngx_http_gzip_module
支持文件压缩模式
--without-http_ssi_module disable ngx_http_ssi_module
此模块处理服务器端包含文件(ssi)的处理
--without-http_userid_module disable ngx_http_userid_module
此模块用于记录用户cookie存在。
--without-http_access_module disable ngx_http_access_module
访问限制控制模块。
--without-http_auth_basic_module disable ngx_http_auth_basic_module
访问限制控制模块。
--without-http_autoindex_module disable ngx_http_autoindex_module
这个模块提供自动目录列表,在没有找到首页的情况下显示目录列表。
--without-http_geo_module disable ngx_http_geo_module
用于负载均衡作用,可以根据用户的来源IP分配到相应的server提供服务,可以作为电信网通分离服务作用。
--without-http_map_module disable ngx_http_map_module
这个模块允许你分类或者同时映射多个值到多个不同值并储存到一个变量中,可用于页面跳转其他域名使用。
--without-http_split_clients_module disable ngx_http_split_clients_module
此模块基于一些特定条件分开客户端连接,(例如ip地址,请求头,cookies等)
--without-http_referer_module disable ngx_http_referer_module
当一个请求头的Referer字段中包含一些非正确的字段,这个模块可以禁止这个请求访问站点。可以禁止盗链的情况发生
--without-http_rewrite_module disable ngx_http_rewrite_module
这个模块允许使用正则表达式重写URI(需PCRE库),并且可以根据相关变量重定向和选择不同的配置。 
--without-http_proxy_module disable ngx_http_proxy_module
这个模块可以转发请求到其他的服务器,做负载均衡使用。
--without-http_fastcgi_module disable ngx_http_fastcgi_module
这个模块允许nginx同FastCGI协同工作,并且控制哪些参数将被安全传递。
--without-http_uwsgi_module disable ngx_http_uwsgi_module
超快的性能,低内存占用(实测为apache2的mod_wsgi的一半左右);多app管理;详尽的日志功能(可以用来分析app性能和瓶颈)。
--without-http_scgi_module disable ngx_http_scgi_module
此模块同一个开发版本的第二个模块,还处于发展中,所以他在使用中受到一定现在。
--without-http_memcached_module disable ngx_http_memcached_module
使用这个模块可以完成简单的处理缓存问题。
--without-http_limit_zone_module disable ngx_http_limit_zone_module
此模块可以限制并发连接,达到减少攻击的效果。
--without-http_limit_req_module disable ngx_http_limit_req_module
这个模块允许为一个指定的会话或者某个特殊情况限制请求数目
--without-http_empty_gif_module disable ngx_http_empty_gif_module
这个模块在内存中保存一个能够很快传递的1×1透明GIF
--without-http_browser_module disable ngx_http_browser_module
识别客户端浏览器版本来制定计划。可以实现更加来源浏览器的版本访问不同页面的效果。
--without-http_upstream_ip_hash_module disable ngx_http_upstream_ip_hash_module
这个指令将基于客户端连接的IP地址来分发请求,可以实现统一来源IP始终分配到同一地址的效果。


--with-http_perl_module enable ngx_http_perl_module
这个模块允许nginx使用SSI调用perl或直接执行perl
--with-perl_modules_path=PATH set path to the perl modules
--with-perl=PATH set path to the perl binary

--http-log-path=PATH set path to the http access log
默认日志存放地址
--http-client-body-temp-path=PATH set path to the http client request body temporary files
临时客户端文件存放地址
--http-proxy-temp-path=PATH set path to the http proxy temporary files
临时代理文件地址
--http-fastcgi-temp-path=PATH set path to the http fastcgi temporary files
临时fastCGI文件存放地址
--http-uwsgi-temp-path=PATH set path to the http uwsgi temporary files
临时UWCGI文件存放地址
--http-scgi-temp-path=PATH set path to the http scgi temporary files
临时SCGI文件存放地址
--without-http disable HTTP server
不提供HTTP服务,如果制作负载均衡服务器,可以不需要HTTP服务。
--without-http-cache disable HTTP cache
不提供缓存,一般都保留选项。
--with-mail enable POP3/IMAP4/SMTP proxy module
支持邮件服务
--with-mail_ssl_module enable ngx_mail_ssl_module
--without-mail_pop3_module disable ngx_mail_pop3_module
--without-mail_imap_module disable ngx_mail_imap_module
--without-mail_smtp_module disable ngx_mail_smtp_module

--with-google_perftools_module enable ngx_google_perftools_module
这个模块可以启用google性能分析工具套件,模块在版本0.6.29增加。
--with-cpp_test_module enable ngx_cpp_test_module
用于性能测试模块,详情见:http://www.ibm.com/developerworks/cn/aix/library/au-ctools3_ccptest/index.html
--add-module=PATH enable an external module
新增其他模块地址
--with-cc=PATH set path to C compiler
--with-cpp=PATH set path to C preprocessor
--with-cc-opt=OPTIONS set additional options for C compiler
--with-ld-opt=OPTIONS set additional options for linker

--with-cpu-opt=CPU build for specified CPU, the valid values:
                                   pentium, pentiumpro, pentium3, pentium4,
                                   athlon, opteron, sparc32, sparc64, ppc64

pcre是包括 perl 兼容的正规表达式库
--without-pcre disable PCRE library usage
--with-pcre force PCRE library usage
--with-pcre=DIR set path to PCRE library sources
--with-pcre-opt=OPTIONS set additional options for PCRE building

md5是一种加密算法
--with-md5=DIR set path to md5 library sources
--with-md5-opt=OPTIONS set additional options for md5 building
--with-md5-asm use md5 assembler sources

sha1:安全哈希算法(Secure Hash Algorithm)主要适用于数字签名标准(Digital Signature Standard DSS)里面定义的数字签名算法(Digital Signature Algorithm DSA)。对于长度小于2^64位的消息,SHA1会产生一个160位的消息摘要。当接收到消息的时候,这个消息摘要可以用来验证数据的完整性。在传输的过程中,数据很可能会发生变化,那么这时候就会产生不同的消息摘要。
--with-sha1=DIR set path to sha1 library sources
--with-sha1-opt=OPTIONS set additional options for sha1 building
--with-sha1-asm use sha1 assembler sources

zlib是很多程序中的压缩或者解压缩函数都会用到这个库
--with-zlib=DIR set path to zlib library sources
--with-zlib-opt=OPTIONS set additional options for zlib building
--with-zlib-asm=CPU use zlib assembler sources optimized
                                   for specified CPU, the valid values:
                                   pentium, pentiumpro

Nginx中使用的锁是自己来实现的,分为两种情况,一种是支持原子操作的情况,也就是由NGX_HAVE_ATOMIC_OPS这个宏来进行控制的。
--with-libatomic force libatomic_ops library usage
--with-libatomic=DIR set path to libatomic_ops library sources

Openssl为基于密码学的安全开发包。
--with-openssl=DIR set path to OpenSSL library sources
--with-openssl-opt=OPTIONS set additional options for OpenSSL building

--with-debug enable the debugging logging