`

Nginx 编译参数说明

阅读更多

来自http://wiki.nginx.org/NginxChsInstallOptions
用于 RedHat 系发行版 (RHEL, CentOS, Fedora).
安装需求包:
yum install gcc openssl-devel pcre-devel zlib-devel

 

configure 支持下面的选项:

--prefix=<path> - Nginx安装路径。如果没有指定,默认为 /usr/local/nginx。

 

--sbin-path=<path> - Nginx可执行文件安装路径。只能安装时指定,如果没有指定,默认为<prefix>/sbin/nginx。

 

--conf-path=<path> - 在没有给定-c选项下默认的nginx.conf的路径。如果没有指定,默认为<prefix>/conf/nginx.conf。

 

--pid-path=<path> - 在nginx.conf中没有指定pid指令的情况下,默认的nginx.pid的路径。如果没有指定,默认为 <prefix>/logs/nginx.pid。

 

--lock-path=<path> - nginx.lock文件的路径。

 

--error-log-path=<path> - 在nginx.conf中没有指定error_log指令的情况下,默认的错误日志的路径。如果没有指定,默认为 <prefix>/logs/error.log。

 

--http-log-path=<path> - 在nginx.conf中没有指定access_log指令的情况下,默认的访问日志的路径。如果没有指定,默认为 <prefix>/logs/access.log。

 

--user=<user> - 在nginx.conf中没有指定user指令的情况下,默认的nginx使用的用户。如果没有指定,默认为 nobody。

 

--group=<group> - 在nginx.conf中没有指定user指令的情况下,默认的nginx使用的组。如果没有指定,默认为 nobody。

 

--builddir=DIR - 指定编译的目录

 

--with-rtsig_module - 启用 rtsig 模块

 

--with-select_module --without-select_module - Whether or not to enable the select module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure.

//允许或不允许开启SELECT模式,如果 configure 没有找到更合适的模式,比如:kqueue(sun os),epoll (linux kenel 2.6+), rtsig(实时信号)或者/dev/poll(一种类似select的模式,底层实现与SELECT基本相 同,都是采用轮训方法) SELECT模式将是默认安装模式

 

--with-poll_module --without-poll_module - Whether or not to enable the poll module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure.

 

--with-http_ssl_module - Enable ngx_http_ssl_module. Enables SSL support and the ability to handle HTTPS requests. Requires OpenSSL. On Debian, this is libssl-dev.

//开启HTTP SSL模块,使NGINX可以支持HTTPS请求。这个模块需要已经安装了OPENSSL,在DEBIAN上是libssl

 

--with-http_realip_module - 启用 ngx_http_realip_module

 

--with-http_addition_module - 启用 ngx_http_addition_module

--with-http_sub_module - 启用 ngx_http_sub_module

--with-http_dav_module - 启用 ngx_http_dav_module

--with-http_flv_module - 启用 ngx_http_flv_module

--with-http_stub_status_module - 启用 "server status" 页

--without-http_charset_module - 禁用 ngx_http_charset_module

--without-http_gzip_module - 禁用 ngx_http_gzip_module. 如果启用,需要 zlib 。

--without-http_ssi_module - 禁用 ngx_http_ssi_module

--without-http_userid_module - 禁用 ngx_http_userid_module

--without-http_access_module - 禁用 ngx_http_access_module

--without-http_auth_basic_module - 禁用 ngx_http_auth_basic_module

--without-http_autoindex_module - 禁用 ngx_http_autoindex_module

--without-http_geo_module - 禁用 ngx_http_geo_module

--without-http_map_module - 禁用 ngx_http_map_module

--without-http_referer_module - 禁用 ngx_http_referer_module

--without-http_rewrite_module - 禁用 ngx_http_rewrite_module. 如果启用需要 PCRE 。

--without-http_proxy_module - 禁用 ngx_http_proxy_module

--without-http_fastcgi_module - 禁用 ngx_http_fastcgi_module

--without-http_memcached_module - 禁用 ngx_http_memcached_module

--without-http_limit_zone_module - 禁用 ngx_http_limit_zone_module

--without-http_empty_gif_module - 禁用 ngx_http_empty_gif_module

--without-http_browser_module - 禁用 ngx_http_browser_module

--without-http_upstream_ip_hash_module - 禁用 ngx_http_upstream_ip_hash_module

--with-http_perl_module - 启用 ngx_http_perl_module

 

--with-perl_modules_path=PATH - 指定 perl 模块的路径

 

--with-perl=PATH - 指定 perl 执行文件的路径

 

--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

 

--without-http - 禁用 HTTP server

 

--with-mail - 启用 IMAP4/POP3/SMTP 代理模块

 

--with-mail_ssl_module - 启用 ngx_mail_ssl_module

 

--with-cc=PATH - 指定 C 编译器的路径

 

--with-cpp=PATH - 指定 C 预处理器的路径

 

--with-cc-opt=OPTIONS - Additional parameters which will be added to the variable CFLAGS. With the use of the system library PCRE in FreeBSD, it is necessary to indicate --with-cc-opt="-I /usr/local/include". If we are using select() and it is necessary to increase the number of file descriptors, then this also can be assigned here: --with-cc-opt="-D FD_SETSIZE=2048".

--with-ld-opt=OPTIONS - Additional parameters passed to the linker. With the use of the system library PCRE in FreeBSD, it is necessary to indicate --with-ld-opt="-L /usr/local/lib".

 

--with-cpu-opt=CPU - 为特定的 CPU 编译,有效的值包括:pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64

 

--without-pcre - 禁止 PCRE 库的使用。同时也会禁止 HTTP rewrite 模块。在 "location" 配置指令中的正则表达式也需要 PCRE 。

 

 

--with-pcre=DIR - 指定 PCRE 库的源代码的路径

 

--with-pcre-opt=OPTIONS - Set additional options for PCRE building.

 

--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.

 

--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.

 

--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, valid values are: pentium, pentiumpro

 

--with-openssl=DIR - Set path to OpenSSL library sources

 

--with-openssl-opt=OPTIONS - Set additional options for OpenSSL building

--with-debug - 启用调试日志

 

--add-module=PATH - Add in a third-party module found in directory PATH

 

在不同版本间,选项可能会有些许变化,请总是使用 ./configure --help 命令来检查一下当前的选项列表。

分享到:
评论

相关推荐

    nginx安装带配置和编译参数

    **Nginx安装指南** Nginx是一款高性能的HTTP和反向代理服务器,以其轻量级、稳定性和高效能著称。...参考《nginx的安装.txt》和《编译参数.txt》文件,可以获取更详细的信息和示例,帮助你更好地理解和操作。

    nginx编译文件及说明

    **Nginx编译文件及说明** 在IT运维领域,Nginx是一个广泛使用的高性能Web服务器和反向代理服务器,以其高效、轻量级和稳定性著称。本篇将详细介绍如何编译Nginx源码文件,以及在编译过程中需要注意的要点。 1. **...

    nginx编译安装详细说明.pdf

    ### Nginx编译安装详细说明 #### 一、前言 本文档旨在提供一份详细的指导,帮助用户在CentOS 7环境下成功编译安装Nginx 1.24.0版本。Nginx是一款高性能的HTTP和反向代理Web服务器,同时也提供了IMAP/POP3/SMTP服务...

    Nginx编译安装保姆级教程

    **Nginx编译安装保姆级教程** 在服务器或虚拟机上手动编译安装Nginx是一项基础且重要的技能,特别是在需要自定义配置或者优化性能时。本教程将引导你逐步完成这一过程,确保你在Linux环境下顺利搭建Nginx服务器。 ...

    Centos_6.3_编译安装Nginx+php+Mysql

    - 编译安装PHP,同样需要先运行./configure来指定安装选项,然后编译(make)和安装(make install),可能会涉及到指定Nginx的路径作为编译参数。 - MySQL的安装可能需要先编译cmake,然后使用cmake来配置MySQL...

    Nginx编译参数大全 configure参数中文详解

    本文将详细介绍Nginx的编译参数,帮助你更好地理解和配置Nginx。 1. **基本配置选项** - `--help`:显示所有可用的配置选项和简短说明。 - `--prefix=PATH`:设置Nginx的安装目录,默认为`/usr/local/nginx`。 -...

    Linux下nginx编译安装教程和编译参数详解

    以上就是Linux环境下编译安装Nginx的详细步骤,以及编译参数的解释。注意,实际操作时应根据系统环境和需求选择合适的编译选项。在生产环境中,还可能需要考虑其他模块,例如缓存模块、负载均衡模块等,以及对日志、...

    nginx-1.6.2.tar 源码 需要编译

    **Nginx 1.6.2 源码编译详解** Nginx 是一款高性能的 HTTP 和反向代理服务器,广泛应用于互联网行业,以其轻量级、高并发、低内存消耗等特性受到赞誉。这里我们将深入探讨如何编译 Nginx 1.6.2 版本的源代码,以便...

    Nginx源码编译安装.md

    ### Nginx源码编译安装详解 #### 一、前言 Nginx是一款高性能的HTTP和反向代理Web服务器,它以其出色的稳定性、丰富的功能集、简单的配置方式和低资源消耗而闻名。在很多场景下,尤其是高并发访问的情况下,Nginx...

    MySQL5.6实战部署,编译安装MySQL5.6.22,编译参数详解

    此过程将涵盖从环境准备、依赖库安装到最终的编译参数配置等各个方面,帮助读者全面理解MySQL的编译安装流程及其重要性。 #### 二、环境准备 1. **操作系统**: CentOS 6.6 64位 2. **MySQL版本**: mysql-5.6.22 3....

    nginx配置 +负载均衡+https协议

    1. **检查Nginx版本及其编译参数** - 执行命令查看已有的编译参数。 ```bash /usr/local/nginx/sbin/nginx -V ``` 2. **重新编译Nginx** - 进入Nginx源码目录。 ```bash cd /opt/nginx-1.11.6 ``` - 重新...

    Ubuntu下nginx1.6和sticky1.1安装配置资料 包

    这里我们指定了pcre、zlib和openssl的源代码路径,这些都是Nginx编译所依赖的库。配置完成后,运行`make`来编译Nginx,然后使用`make install`进行安装。在“nginx执行make命令编译成功之后的界面.png”和“nginx...

    nginx 配置及优化

    1. **worker_processes**: 这个参数定义了Nginx启动的 worker进程数量。默认为1,但通常会设置为与CPU核心数相同,以充分利用硬件资源。 2. **events**块:这部分配置决定了Nginx如何处理连接事件。`use`指令用于...

    Linux编译安装软件时编译参数详解

    本文将详细解析在Linux环境中编译安装软件时常用的编译参数,以Nginx为例进行说明。 #### 基础编译参数 1. **--prefix=**:指定安装目录,这是最基本的配置项,用来设置Nginx的安装路径。 2. **--sbin-path=**:...

    nginx服务器及使用

    `nginx服务使用及设置自启动方法.doc`文件很可能是详细的操作指南,它可能包含如何配置`nginx-service.exe`以实现开机自启动的步骤,以及如何管理和控制Nginx服务的说明。建议仔细阅读这份文档,以确保正确设置自...

    Nginx安装手册

    2. 编译安装 Nginx:本部分内容介绍了如何编译和安装 Nginx,包括配置参数的设置和编译安装的过程。 3. 启动和停止 Nginx:本部分内容介绍了如何启动和停止 Nginx 服务器,包括快速停止和完整停止的方法。 4. 重启 ...

    基于linux离线安装nginx的全包,及安装流程命令说明

    为了集成lua-resty,首先需要安装OpenResty,它是一个预编译的Nginx发行版,集成了lua-nginx-module和其他相关模块。 1. 获取OpenResty源码包,如`openresty-1.17.8.2.tar.gz`,并解压。 2. 配置并编译OpenResty,...

    nginxWindows版,自带rtmp服务模块

    这个压缩包提供的是预编译的Nginx Windows版本,特别的是它已经内置了RTMP服务模块,使得用户可以直接在Windows系统上搭建流媒体服务器。 RTMP是一种协议,常用于实时音频、视频的传输,适用于直播、视频会议等应用...

    nginx依赖包.zip

    6. **监控与优化**:安装完成后,可以使用`nginx -V`查看Nginx版本及配置参数,通过`nginx -T`查看当前配置。根据系统负载和性能,可能需要调整Nginx配置以优化性能。 总之,“nginx依赖包.zip”文件是为了简化...

Global site tag (gtag.js) - Google Analytics