Nginx源码编译configure参数分类详解

Nginx 1655℃

一、Path选项类

参数 用途 默认值
–prefix=… Nginx安装的基础目录 /usr/local/nginx
–sbin-path=… Nginx二进制安装目录 /sbin/nginx
–conf-path=… 主配置文件安装位置 /conf/nginx.conf
–error-log-path=… 错误日志位置 /logs/error.log
–pid-path=… pid文件路径,可在配置文件指定 /logs/nginx.pid
–lock-path=… 锁文件位置 /logs/nginx.lock
–with-perl_modules_path=… Perl模块位置
–with-perl=… Perl二进制文件路径
–http-log-path=… 访问日志路径,可在配置文件指定 /logs/access.log
–http-client-body-temp-path=… 由客户端请求生成的临时文件路径 /client_body_temp
–http-proxy-temp-path=… proxy产生的临时文件路径 /proxy_temp
–http-fastcgi-temp-path=…
–http-uwsgi-temp-path=…
–http-scgi-temp-path=…
由FastCGI, uWSGI和SCG
I模块产生的临时文件路径
/fastcgi_temp/uwsgi_temp/scgi_temp
–add-module=… 加载第三方模块路径
–add-dynamic-module=… 加载动态第三方模块路径 nginx1.9.11版后支持
–modules-path=… 设置模块路径
–user=USER 为工作进程设置非特权用户
–group=GROUP 为工作进程设置非特权用户组

二、依赖选项类

依赖以库和二进制文件的形式出现,即使它们已存在于您的系统上,也有可能出现配置脚本无法找到它们的情况(原因可能是它们安装在非标准目录中)。为解决这些问题,可以选用以下选项来指定依赖的路径(其他依赖相关选项已组合在一起):

编译选项 描述
–with-cc=… 指定C编译器的备用位置
–with-cpp=… 指定C预处理器的备用位置
–with-cc-opt=… 定义要传递到C编译器命令行的其他选项
–with-ld-opt=… 定义要传递到C链接器命令行的其他选项
–with-cpu-opt=… 可以指定以下目标处理器体系结构:
pentium、pentiumpro、pentium3、pentium4、
athlon、opteron、sparc32、sparc64、ppc64
PCRE选项 描述
–without-pcre 禁用PCRE库的使用。不建议使用,
因为会删除对正则表达式支持,从而禁用Rewrite模块
–with-pcre 强制使用PCRE库
–with-pcre=… 指定PCRE库源代码的路径
–with-pcre-opt=… 构建PCRE库的其他选项
–with-pcre-jit=… 构建PCRE与JIT编译的支持
MD5选项 描述
–with-md5=… 指定MD5库源的路径
–with-md5-opt=… 构建MD5库的其他选项
–with-md5-asm 为MD5库指定汇编源
SHA1选项 描述
–with-sha1=… 指定SHA1库源的路径
–with-sha1-opt=… 构建SHA1库的其他选项
–with-sha1-asm 为SHA1库指定汇编器源
zlib选项 描述
–with-zlib=… 指定zlib库源的路径
–with-zlib-opt=… 构建zlib库的其他选项
–with-zlib-asm=… 为zlib库指定汇编器源
OpenSSL选项 描述
–with-openssl=… 指定OpenSSL库源的路径。
–with-openssl-opt=… 用于构建OpenSSL库的其他选项。

三、模块选项

在编译程序之前,需要指定要安装的模块。 有些是默认启用的,有些需要手动启用,具体如下所示。

1.默认启用的模块

--without-http_charset_module
--without-http_gzip_module
--without-http_ssi_module
--without-http_userid_module
--without-http_access_module
--without-http_access_module
--without-http_autoindex_module
--without-http_geo_module
--without-http_map_module
--without-http_referer_module
--without-http_rewrite_module
--without-http_proxy_module
--without-http_fastcgi_module
--without-http_uwsgi_module
--without-http_scgi_module
--without-http_memcached_module
--without-http_limit_conn_module
--without-http_limit_req_module
--without-http_empty_gif_module
--without-http_browser_module
--without-http_upstream_ip_hash_module
--without-http_upstream_least_conn_module
--without-http_split_clients_module
--without-http
--without-http_auth_basic_module
--without-http_upstream_hash_module
--without-http_upstream_keepalive_module
--without-http_upstream_zone_module
--without-http-cache
--without-mail_imap_module
--without-mail_pop3_module
--without-mail_smtp_module
--without-poll_module
--without-select_module
--without-stream_access_module
--without-stream_geo_module
--without-stream_limit_conn_module
--without-stream_map_module
--without-stream_return_module
--without-stream_split_clients_module
--without-stream_upstream_hash_module
--without-stream_upstream_least_conn_module
--without-stream_upstream_zone_module

2.默认禁用的模块

--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_xslt_module
--with-http_image_filter_module
--with-http_geoip_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_stub_status_module
--with-google_perftools_module
--with-http_degradation_module
--with-http_perl_module
--with-http_spdy_module
--with-http_gunzip_module
--with-http_auth_request_module
--with-debug
--with-file-aio
--with-compat

转载请注明:零五宝典 » Nginx源码编译configure参数分类详解