Building nginx from Sources从源代码生成nginx
The build is configured using the 使用configure命令配置生成。configure
command. It defines various aspects of the system, including the methods nginx is allowed to use for connection processing. 它定义了系统的各个方面,包括允许nginx用于连接处理的方法。At the end it creates a 最后,它创建一个Makefile。Makefile
.
The configure命令支持以下参数:configure
command supports the following parameters:
--help
prints a help message.打印一条帮助消息。
--prefix=
path
defines a directory that will keep server files.定义将保存服务器文件的目录。This same directory will also be used for all relative paths set byconfigure
(except for paths to libraries sources) and in thenginx.conf
configuration file.configure
设置的所有相对路径(库源路径除外)和nginx.conf
配置文件中也将用到该目录。It is set to the默认设置为/usr/local/nginx
directory by default./usr/local/nginx
目录。--sbin-path=
path
sets the name of an nginx executable file.设置nginx可执行文件的名称。This name is used only during installation.此名称仅在安装期间使用。By default the file is named默认情况下,文件名为
.prefix
/sbin/nginx
。prefix
/sbin/nginx--modules-path=
path
defines a directory where nginx dynamic modules will be installed.定义将在其中安装nginx动态模块的目录。By default the默认情况下,使用前缀
directory is used.prefix
/modules
目录。prefix
/modules--conf-path=
path
sets the name of an设置nginx.conf
configuration file.nginx.conf
配置文件的名称。If needs be, nginx can always be started with a different configuration file, by specifying it in the command-line parameter如果需要,nginx始终可以使用不同的配置文件启动,方法是在命令行参数 .-c
file
中指定它。-c
file
By default the file is named默认情况下,文件名为
.prefix
/conf/nginx.conf
。prefix
/conf/nginx.conf--error-log-path=
path
sets the name of the primary error, warnings, and diagnostic file.设置主要错误、警告和诊断文件的名称。After installation, the file name can always be changed in the安装后,始终可以使用nginx.conf
configuration file using the error_log directive.error_log
指令在nginx.conf
配置文件中更改文件名。By default the file is named默认情况下,文件名为
.prefix
/logs/error.log
。prefix
/logs/error.log--pid-path=
path
sets the name of an设置将存储主进程的进程ID的nginx.pid
file that will store the process ID of the main process.nginx.pid
文件的名称。After installation, the file name can always be changed in the安装后,始终可以使用nginx.conf
configuration file using the pid directive.pid
指令在nginx.conf
配置文件中更改文件名。By default the file is named默认情况下,文件名为
.prefix
/logs/nginx.pid
。prefix
/logs/nginx.pid--lock-path=
path
sets a prefix for the names of lock files.为锁定文件的名称设置前缀。After installation, the value can always be changed in the安装后,始终可以使用nginx.conf
configuration file using the lock_file directive.lock_file
指令在nginx.conf
配置文件中更改该值。By default the value is默认情况下,该值为
.prefix
/logs/nginx.lock
。prefix
/logs/nginx.lock
--user=
name
sets the name of an unprivileged user whose credentials will be used by worker processes.设置其凭据将由工作进程使用的非特权用户的名称。After installation, the name can always be changed in the安装后,始终可以使用nginx.conf
configuration file using the user directive.user
指令在nginx.conf
配置文件中更改名称。The default user name is nobody.默认用户名为nobody。--group=
name
sets the name of a group whose credentials will be used by worker processes.设置工作进程将使用其凭据的组的名称。After installation, the name can always be changed in the安装后,始终可以使用nginx.conf
configuration file using the user directive.user
指令在nginx.conf
配置文件中更改名称。By default, a group name is set to the name of an unprivileged user.默认情况下,组名设置为非特权用户的名称。
--build=
name
sets an optional nginx build name.设置可选的nginx生成名称。--builddir=
path
sets a build directory.设置生成目录。
--with-select_module
--without-select_module
enables or disables building a module that allows the server to work with the启用或禁用生成允许服务器使用select()
method.select()
方法的模块。This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, or /dev/poll.如果平台似乎不支持更合适的方法,如kqueue、epoll或/dev/poll,则会自动生成此模块。--with-poll_module
--without-poll_module
enables or disables building a module that allows the server to work with the启用或禁用生成允许服务器使用poll()
method.poll()
方法的模块。This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, or /dev/poll.如果平台似乎不支持更合适的方法,如kqueue
、epoll
或/dev/poll
,则会自动生成此模块。--with-threads
enables the use of thread pools.启用线程池的使用。--with-file-aio
enables the use of asynchronous file I/O (AIO) on FreeBSD and Linux.启用在FreeBSD和Linux上使用异步文件I/O(AIO)。
--with-http_ssl_module
enables building a module that adds the HTTPS protocol support to an HTTP server.启用生成模块,将HTTPS协议支持添加到HTTP服务器。This module is not built by default.默认情况下不生成此模块。The OpenSSL library is required to build and run this module.生成和运行此模块需要OpenSSL库。--with-http_v2_module
enables building a module that provides support for HTTP/2.启用生成支持HTTP/2的模块。This module is not built by default.默认情况下不生成此模块。--with-http_realip_module
enables building the ngx_http_realip_module module that changes the client address to the address sent in the specified header field.启用生成ngx_http_realip_module模块,该模块将客户端地址更改为在指定标头字段中发送的地址。This module is not built by default.默认情况下不生成此模块。--with-http_addition_module
enables building the ngx_http_addition_module module that adds text before and after a response.启用生成ngx_http_addition_module模块,在响应前后添加文本。This module is not built by default.默认情况下不生成此模块。--with-http_xslt_module
--with-http_xslt_module=dynamic
enables building the ngx_http_xslt_module module that transforms XML responses using one or more XSLT stylesheets.启如生成ngx_http_xslt_module模块,该模块使用一个或多个xslt样式表转换XML响应。This module is not built by default.默认情况下不生成此模块。The libxml2 and libxslt libraries are required to build and run this module.生成和运行此模块需要libxml2和libxslt库。--with-http_image_filter_module
--with-http_image_filter_module=dynamic
enables building the ngx_http_image_filter_module module that transforms images in JPEG, GIF, PNG, and WebP formats.启用生成ngx_http_image_filter_module模块,用于以JPEG、GIF、PNG和WebP格式转换图像。This module is not built by default.默认情况下不生成此模块。--with-http_geoip_module
--with-http_geoip_module=dynamic
enables building the ngx_http_geoip_module module that creates variables depending on the client IP address and the precompiled MaxMind databases.启用生成ngx_http_geoip_module模块,该模块根据客户端IP地址和预编译的MaxMind数据库创建变量。This module is not built by default.默认情况下不生成此模块。--with-http_sub_module
enables building the ngx_http_sub_module module that modifies a response by replacing one specified string by another.启用生成ngx_http_sub_module模块,该模块通过将一个指定字符串替换为另一个指定字符串来修改响应。This module is not built by default.默认情况下不生成此模块。--with-http_dav_module
enables building the ngx_http_dav_module module that provides file management automation via the WebDAV protocol.启用生成ngx_http_dav_module模块,该模块通过WebDAV协议提供文件管理自动化。This module is not built by default.默认情况下不生成此模块。--with-http_flv_module
enables building the ngx_http_flv_module module that provides pseudo-streaming server-side support for Flash Video (FLV) files.启用生成ngx_http_flv_module模块,该模块为Flash视频(flv)文件提供伪流服务器端支持。This module is not built by default.默认情况下不生成此模块。--with-http_mp4_module
enables building the ngx_http_mp4_module module that provides pseudo-streaming server-side support for MP4 files.启用生成ngx_http_mp4_module模块,该模块为mp4文件提供伪流服务器端支持。This module is not built by default.默认情况下不生成此模块。--with-http_gunzip_module
enables building the ngx_http_gunzip_module module that decompresses responses with “启用为不支持“gzip”编码方法的客户端生成ngx_http_gunzip_module模块,该模块使用“Content-Encoding: gzip
” for clients that do not support “gzip” encoding method.Content-Encoding: gzip
”解压缩响应。This module is not built by default.默认情况下不生成此模块。--with-http_gzip_static_module
enables building the ngx_http_gzip_static_module module that enables sending precompressed files with the “启用生成ngx_http_gzip_static_module模块,该模块支持发送文件扩展名为“.gz”的预压缩文件,而不是常规文件。.gz
” filename extension instead of regular files.This module is not built by default.默认情况下不生成此模块。--with-http_auth_request_module
enables building the ngx_http_auth_request_module module that implements client authorization based on the result of a subrequest.启用生成ngx_http_auth_request_module模块,该模块基于子请求的结果实现客户端授权。This module is not built by default.默认情况下不生成此模块。--with-http_random_index_module
enables building the ngx_http_random_index_module module that processes requests ending with the slash character (‘启用生成ngx_http_random_index_module模块,该模块处理以斜杠字符(“/”)结尾的请求,并在目录中选择一个随机文件作为索引文件。/
’) and picks a random file in a directory to serve as an index file.This module is not built by default.默认情况下不生成此模块。--with-http_secure_link_module
enables building the ngx_http_secure_link_module module.启用生成ngx_http_secure_link_module模块。This module is not built by default.默认情况下不生成此模块。--with-http_degradation_module
enables building the启用生成ngx_http_degradation_module
module.ngx_http_degradation_module
模块。This module is not built by default.默认情况下不生成此模块。--with-http_slice_module
enables building the ngx_http_slice_module module that splits a request into subrequests, each returning a certain range of response.启用生成ngx_http_slice_module模块,该模块将请求拆分为子请求,每个子请求返回一定范围的响应。The module provides more effective caching of big responses.该模块提供更有效的大响应缓存。This module is not built by default.默认情况下不生成此模块。--with-http_stub_status_module
enables building the ngx_http_stub_status_module module that provides access to basic status information.启用生成ngx_http_stub_status_module模块,该模块提供对基本状态信息的访问。This module is not built by default.默认情况下不生成此模块。
--without-http_charset_module
disables building the ngx_http_charset_module module that adds the specified charset to the “Content-Type” response header field and can additionally convert data from one charset to another.禁用生成ngx_http_charset_module模块,该模块将指定的字符集添加到“Content-Type”响应头字段,并可以将数据从一个字符集转换为另一个字符集。--without-http_gzip_module
disables building a module that compresses responses of an HTTP server.禁止生成HTTP服务器的压缩响应的模块。The zlib library is required to build and run this module.生成和运行此模块需要zlib库。--without-http_ssi_module
disables building the ngx_http_ssi_module module that processes SSI (Server Side Includes) commands in responses passing through it.禁用生成ngx_http_ssi_module模块,该模块处理通过它的响应中的SSI(服务器端包括)命令。--without-http_userid_module
disables building the ngx_http_userid_module module that sets cookies suitable for client identification.禁用生成ngx_http_userid_module模块,该模块设置适合客户端标识的cookie。--without-http_access_module
disables building the ngx_http_access_module module that allows limiting access to certain client addresses.禁用生成ngx_http_access_module模块,该模块允许限制对某些客户端地址的访问。--without-http_auth_basic_module
disables building the ngx_http_auth_basic_module module that allows limiting access to resources by validating the user name and password using the “HTTP Basic Authentication” protocol.禁用生成ngx_http_auth_basic_module模块,该模块允许通过使用“http basic Authentication”协议验证用户名和密码来限制对资源的访问。--without-http_mirror_module
disables building the ngx_http_mirror_module module that implements mirroring of an original request by creating background mirror subrequests.禁用生成ngx_http_mirror_module模块,该模块通过创建后台镜像子请求来实现原始请求的镜像。--without-http_autoindex_module
disables building the ngx_http_autoindex_module module that processes requests ending with the slash character (‘禁用生成ngx_http_autoindex_module模块,该模块处理以斜杠字符(“/”)结尾的请求,并在ngx_http_index_module模块找不到索引文件时生成目录列表。/
’) and produces a directory listing in case the ngx_http_index_module module cannot find an index file.--without-http_geo_module
disables building the ngx_http_geo_module module that creates variables with values depending on the client IP address.禁用生成ngx_http_geo_module模块,该模块根据客户端IP地址创建具有值的变量。--without-http_map_module
disables building the ngx_http_map_module module that creates variables with values depending on values of other variables.禁用生成ngx_http_map_module模块,该模块创建的变量的值取决于其他变量的值。--without-http_split_clients_module
disables building the ngx_http_split_clients_module module that creates variables for A/B testing.禁用生成创建A/B测试变量的ngx_http_split_clients_module模块。--without-http_referer_module
disables building the ngx_http_referer_module module that can block access to a site for requests with invalid values in the “Referer” header field.禁用生成ngx_http_referer_module模块,该模块可阻止“referer”标头字段中具有无效值的请求访问站点。--without-http_rewrite_module
disables building a module that allows an HTTP server to redirect requests and change URI of requests.禁用生成允许HTTP服务器重定向请求和更改请求URI的模块。The PCRE library is required to build and run this module.生成和运行此模块需要PCRE库。--without-http_proxy_module
disables building an HTTP server proxying module.禁用生成HTTP服务器代理模块。--without-http_fastcgi_module
disables building the ngx_http_fastcgi_module module that passes requests to a FastCGI server.禁用生成将请求传递给FastCGI服务器的ngx_http_fastcgi_module模块。--without-http_uwsgi_module
disables building the ngx_http_uwsgi_module module that passes requests to a uwsgi server.禁用生成将请求传递给uwsgi服务器的ngx_http_uwsgi_module模块。--without-http_scgi_module
disables building the ngx_http_scgi_module module that passes requests to an SCGI server.禁止生成将请求传递给SCGI服务器的ngx_http_scgi_module模块。--without-http_grpc_module
disables building the ngx_http_grpc_module module that passes requests to a gRPC server.禁用生成将请求传递到grpc服务器的ngx_http_grpc_module模块。--without-http_memcached_module
disables building the ngx_http_memcached_module module that obtains responses from a memcached server.禁用生成从memcached服务器获取响应的ngx_http_memcached_module模块。--without-http_limit_conn_module
disables building the ngx_http_limit_conn_module module that limits the number of connections per key, for example, the number of connections from a single IP address.禁用生成ngx_http_limit_conn_module模块,该模块限制每个密钥的连接数,例如,单个IP地址的连接数。--without-http_limit_req_module
disables building the ngx_http_limit_req_module module that limits the request processing rate per key, for example, the processing rate of requests coming from a single IP address.禁用生成ngx_http_limit_req_module模块,该模块限制每个密钥的请求处理速率,例如,来自单个IP地址的请求的处理速率。--without-http_empty_gif_module
disables building a module that emits single-pixel transparent GIF.禁用生成发射单像素透明GIF的模块。--without-http_browser_module
disables building the ngx_http_browser_module module that creates variables whose values depend on the value of the “User-Agent” request header field.禁用生成ngx_http_browser_module模块,该模块创建的变量的值取决于“用户代理”请求标头字段的值。--without-http_upstream_hash_module
disables building a module that implements the hash load balancing method.禁用生成实现哈希负载平衡方法的模块。--without-http_upstream_ip_hash_module
disables building a module that implements the ip_hash load balancing method.禁用生成实现ip_hash负载平衡方法的模块。--without-http_upstream_least_conn_module
disables building a module that implements the least_conn load balancing method.禁用生成实现最小连接负载平衡方法的模块。--without-http_upstream_random_module
disables building a module that implements the random load balancing method.禁用生成实现随机负载平衡方法的模块。--without-http_upstream_keepalive_module
disables building a module that provides caching of connections to upstream servers.禁用生成提供到上游服务器的连接缓存的模块。--without-http_upstream_zone_module
disables building a module that makes it possible to store run-time state of an upstream group in a shared memory zone.禁用生成一个模块,该模块可以将上游组的运行时状态存储在共享内存区域中。
--with-http_perl_module
--with-http_perl_module=dynamic
enables building the embedded Perl module.启用生成嵌入式Perl模块。This module is not built by default.默认情况下不生成此模块。--with-perl_modules_path=
path
defines a directory that will keep Perl modules.定义保存Perl模块的目录。--with-perl=
path
sets the name of the Perl binary.设置Perl二进制文件的名称。
--http-log-path=
path
sets the name of the primary request log file of the HTTP server.设置HTTP服务器的主请求日志文件的名称。After installation, the file name can always be changed in the安装后,始终可以使用access_log指令在nginx.conf
configuration file using the access_log directive.nginx.conf
配置文件中更改文件名。By default the file is named默认情况下,文件名为
.prefix
/logs/access.logprefix/logs/access.log
。--http-client-body-temp-path=
path
defines a directory for storing temporary files that hold client request bodies.定义用于存储包含客户端请求主体的临时文件的目录。After installation, the directory can always be changed in the安装后,始终可以使用client_body_temp_path指令在nginx.conf
configuration file using the client_body_temp_path directive.nginx.conf
配置文件中更改目录。By default the directory is named默认情况下,目录名为
.prefix
/client_body_tempprefix/client_body_temp
。--http-proxy-temp-path=
path
defines a directory for storing temporary files with data received from proxied servers.定义用于存储包含从代理服务器接收的数据的临时文件的目录。After installation, the directory can always be changed in the安装后,始终可以使用proxy_temp_path指令在nginx.conf
configuration file using the proxy_temp_path directive.nginx.conf
配置文件中更改目录。By default the directory is named默认情况下,目录名为
.prefix
/proxy_tempprefix/proxy_temp
。--http-fastcgi-temp-path=
path
defines a directory for storing temporary files with data received from FastCGI servers.定义一个目录,用于存储包含从FastCGI服务器接收的数据的临时文件。After installation, the directory can always be changed in the安装后,始终可以使用fastcgi_temp_path指令在nginx.conf
configuration file using the fastcgi_temp_path directive.nginx.conf
配置文件中更改目录。By default the directory is named默认情况下,目录名为
.prefix
/fastcgi_tempprefix/fastcgi_temp
。--http-uwsgi-temp-path=
path
defines a directory for storing temporary files with data received from uwsgi servers.定义用于存储包含从uwsgi服务器接收的数据的临时文件的目录。After installation, the directory can always be changed in the安装后,始终可以使用uwsgi_temp_path指令在nginx.conf
configuration file using the uwsgi_temp_path directive.nginx.conf
配置文件中更改目录。By default the directory is named默认情况下,目录名为
.prefix
/uwsgi_tempprefix/uwsgi_temp
。--http-scgi-temp-path=
path
defines a directory for storing temporary files with data received from SCGI servers.定义用于存储包含从SCGI服务器接收的数据的临时文件的目录。After installation, the directory can always be changed in the安装后,始终可以使用scgi_temp_path指令在nginx.conf
configuration file using the scgi_temp_path directive.nginx.conf
配置文件中更改目录。By default the directory is named默认情况下,目录名为
.prefix
/scgi_tempprefix/scgi_temp
。
--without-http
disables the HTTP server.禁用HTTP服务器。--without-http-cache
disables HTTP cache.禁用HTTP缓存。
--with-mail
--with-mail=dynamic
enables POP3/IMAP4/SMTP mail proxy server.启用POP3/IMAP4/SMTP邮件代理服务器。--with-mail_ssl_module
enables building a module that adds the SSL/TLS protocol support to the mail proxy server.启用生成模块,将SSL/TLS协议支持添加到邮件代理服务器。This module is not built by default.默认情况下不生成此模块。The OpenSSL library is required to build and run this module.生成和运行此模块需要OpenSSL库。--without-mail_pop3_module
disables the POP3 protocol in mail proxy server.在邮件代理服务器中禁用POP3协议。--without-mail_imap_module
disables the IMAP protocol in mail proxy server.在邮件代理服务器中禁用IMAP协议。--without-mail_smtp_module
disables the SMTP protocol in mail proxy server.在邮件代理服务器中禁用SMTP协议。
--with-stream
--with-stream=dynamic
enables building the stream module for generic TCP/UDP proxying and load balancing.启用为通用TCP/UDP代理和负载平衡生成流模块。This module is not built by default.默认情况下不生成此模块。--with-stream_ssl_module
enables building a module that adds the SSL/TLS protocol support to the stream module.启用生成将SSL/TLS协议支持添加到流模块的模块。This module is not built by default.默认情况下不生成此模块。The OpenSSL library is required to build and run this module.生成和运行此模块需要OpenSSL库。--with-stream_realip_module
enables building the ngx_stream_realip_module module that changes the client address to the address sent in the PROXY protocol header.启用生成ngx_stream_realip_module模块,将客户端地址更改为代理协议标头中发送的地址。This module is not built by default.默认情况下不生成此模块。--with-stream_geoip_module
--with-stream_geoip_module=dynamic
enables building the ngx_stream_geoip_module module that creates variables depending on the client IP address and the precompiled MaxMind databases.启用生成ngx_stream_geoip_module模块,该模块根据客户端IP地址和预编译的MaxMind数据库创建变量。This module is not built by default.默认情况下不生成此模块。--with-stream_ssl_preread_module
enables building the ngx_stream_ssl_preread_module module that allows extracting information from the ClientHello message without terminating SSL/TLS.启用生成ngx_stream_ssl_preread_module模块,该模块允许从ClientHello消息中提取信息,而无需终止ssl/TLS。This module is not built by default.默认情况下不生成此模块。--without-stream_limit_conn_module
disables building the ngx_stream_limit_conn_module module that limits the number of connections per key, for example, the number of connections from a single IP address.禁用生成ngx_stream_limit_conn_module模块,该模块限制每个密钥的连接数,例如,单个IP地址的连接数。--without-stream_access_module
disables building the ngx_stream_access_module module that allows limiting access to certain client addresses.禁用生成ngx_stream_access_module模块,该模块允许限制对特定客户端地址的访问。--without-stream_geo_module
disables building the ngx_stream_geo_module module that creates variables with values depending on the client IP address.禁用生成ngx_stream_geo_module模块,该模块根据客户端IP地址创建具有值的变量。--without-stream_map_module
disables building the ngx_stream_map_module module that creates variables with values depending on values of other variables.禁用生成ngx_stream_map_module模块,该模块创建的变量的值取决于其他变量的值。--without-stream_split_clients_module
disables building the ngx_stream_split_clients_module module that creates variables for A/B testing.禁用生成创建A/B测试变量的ngx_stream_split_clients_module模块。--without-stream_return_module
disables building the ngx_stream_return_module module that sends some specified value to the client and then closes the connection.禁用生成ngx_stream_return_module模块,该模块向客户端发送某些指定值,然后关闭连接。--without-stream_set_module
disables building the ngx_stream_set_module module that sets a value for a variable.禁用生成为变量设置值的ngx_stream_set_module模块。--without-stream_upstream_hash_module
disables building a module that implements the hash load balancing method.禁用生成实现哈希负载平衡方法的模块。--without-stream_upstream_least_conn_module
disables building a module that implements the least_conn load balancing method.禁用生成实现最小连接负载平衡方法的模块。--without-stream_upstream_random_module
disables building a module that implements the random load balancing method.禁用生成实现随机负载平衡方法的模块。--without-stream_upstream_zone_module
disables building a module that makes it possible to store run-time state of an upstream group in a shared memory zone.禁用生成一个模块,该模块可以将上游组的运行时状态存储在共享内存区域中。
--with-google_perftools_module
enables building the ngx_google_perftools_module module that enables profiling of nginx worker processes using Google Performance Tools.启用生成ngx_google_perftools_module模块,该模块支持使用google性能工具评测nginx工作进程。The module is intended for nginx developers and is not built by default.该模块是为nginx开发人员设计的,默认情况下不是生成的。--with-cpp_test_module
enables building the启用生成ngx_cpp_test_module
module.ngx_cpp_test_module
模块。
--add-module=
path
enables an external module.启用外部模块。--add-dynamic-module=
path
enables an external dynamic module.启用外部动态模块。
--with-compat
enables dynamic modules compatibility.启用动态模块兼容性。
--with-cc=
path
sets the name of the C compiler.设置C编译器的名称。--with-cpp=
path
sets the name of the C preprocessor.设置C预处理器的名称。--with-cc-opt=
parameters
sets additional parameters that will be added to the CFLAGS variable.设置将添加到CFLAGS变量的其他参数。When using the system PCRE library under FreeBSD,在FreeBSD下使用系统PCRE库时,应指定--with-cc-opt="-I /usr/local/include"
should be specified.--with-cc-opt="-I /usr/local/include"
。If the number of files supported by如果select()
needs to be increased it can also be specified here such as this:select()
支持的文件数需要增加,也可以在此处指定,例如:--with-cc-opt="-D FD_SETSIZE=2048"
.--with-ld-opt=
parameters
sets additional parameters that will be used during linking.设置链接期间将使用的其他参数。When using the system PCRE library under FreeBSD,在FreeBSD下使用系统PCRE库时,应指定--with-ld-opt="-L /usr/local/lib"
should be specified.--with-ld-opt="-L /usr/local/lib"
。--with-cpu-opt=
cpu
enables building per specified CPU:根据指定的CPU启用生成:pentium
,pentiumpro
,pentium3
,pentium4
,athlon
,opteron
,sparc32
,sparc64
,ppc64
.pentium
、pentiumpro
、pentium3
、pentium4
、athlon
、opteron
、sparc32
、sparc64
、ppc64
。
--without-pcre
disables the usage of the PCRE library.禁用PCRE库的使用。--with-pcre
forces the usage of the PCRE library.强制使用PCRE库。--with-pcre=
path
sets the path to the sources of the PCRE library.设置PCRE库源的路径。The library distribution (version 4.4 — 8.43) needs to be downloaded from the PCRE site and extracted.图书馆发行版(版本4.4-8.43)需要从PCRE站点下载并提取。The rest is done by nginx’s其余由nginx的./configure
andmake
../configure
和make
完成。The library is required for regular expressions support in the location directive and for the ngx_http_rewrite_module module.location指令中的正则表达式支持和ngx_http_rewrite_module模块都需要该库。--with-pcre-opt=
parameters
sets additional build options for PCRE.为PCRE设置其他生成选项。--with-pcre-jit
builds the PCRE library with “just-in-time compilation” support (1.1.12, the pcre_jit directive).生成具有“即时编译”支持的PCRE库(1.1.12,pcre_jit指令)。
--with-zlib=
path
sets the path to the sources of the zlib library.设置zlib库源的路径。The library distribution (version 1.1.3 — 1.2.11) needs to be downloaded from the zlib site and extracted.图书馆发行版(版本1.1.3-1.2.11)需要从zlib站点下载并提取。The rest is done by nginx’s其余由nginx的./configure
andmake
../configure
和make
完成。The library is required for the ngx_http_gzip_module module.ngx_http_gzip_module模块需要该库。--with-zlib-opt=
parameters
sets additional build options for zlib.为zlib设置其他生成选项。--with-zlib-asm=
cpu
enables the use of the zlib assembler sources optimized for one of the specified CPUs:允许使用为指定CPU之一优化的zlib汇编程序源:pentium
,pentiumpro
.pentium
、pentiumpro
。
--with-libatomic
forces the libatomic_ops library usage.强制使用libu-ops库。--with-libatomic=
path
sets the path to the libatomic_ops library sources.设置libatomic_ops库源的路径。
--with-openssl=
path
sets the path to the OpenSSL library sources.设置OpenSSL库源的路径。--with-openssl-opt=
parameters
sets additional build options for OpenSSL.为OpenSSL设置其他生成选项。
--with-debug
enables the debugging log.启用调试日志。
Example of parameters usage (all of this needs to be typed in one line):参数使用示例(所有这些都需要在一行中键入):
./configure
--sbin-path=/usr/local/nginx/nginx
--conf-path=/usr/local/nginx/nginx.conf
--pid-path=/usr/local/nginx/nginx.pid
--with-http_ssl_module
--with-pcre=../pcre-8.44
--with-zlib=../zlib-1.2.11
After configuration, nginx is compiled and installed using 配置后,使用make
.make
编译和安装nginx。