InstallOptions
Contents |
Compile-time options
configure
determines the features of system and, in particular, the methods, which nginx can use for handling connections. Finally it creates the Makefile.
configure
supports the following options:
--prefix=<path> - The path relative to which all other Nginx paths will resolve. If not specified, defaults to /usr/local/nginx.
--sbin-path=<path> - The path to the nginx executable. Only used for installation. If not specified defaults to <prefix>/sbin/nginx.
--conf-path=<path> - The default location of nginx.conf if no -c parameter is provided. If not provided, defaults to <prefix>/conf/nginx.conf.
--pid-path=<path> - The path to nginx.pid, if not set via the "pid" directive in nginx.conf. If not provided, defaults to <prefix>/logs/nginx.pid.
--lock-path=<path> - The path to the nginx.lock file. If not provided, defaults to <prefix>/logs/nginx.lock.
--error-log-path=<path> - The location of the error log if not set via the "error_log" in nginx.conf. If not set, defaults to <prefix>/logs/error.log.
--http-log-path=<path> - The location of the access log if not set via the "access_log" directive in nginx.conf. If not set, defaults to <prefix>/logs/access.log.
--user=<user> - The default user that nginx will run as if not set in nginx.conf via the "user" directive. If not set, defaults to "nobody".
--group=<group> - The default group that nginx will run under if not set via the "user" directive in nginx.conf. If not set defaults to "nobody".
--builddir=DIR - Set the build directory
--with-rtsig_module - Enable rtsig module
--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.
--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.
--with-http_realip_module - Enable ngx_http_realip_module
--with-http_addition_module - Enable ngx_http_addition_module
--with-http_sub_module - Enable ngx_http_sub_module
--with-http_dav_module - Enable ngx_http_dav_module
--with-http_flv_module - Enable ngx_http_flv_module
--with-http_stub_status_module - Enable the "server status" page
--without-http_charset_module - Disable ngx_http_charset_module
--without-http_gzip_module - Disable ngx_http_gzip_module. Requires zlib if enabled.
--without-http_ssi_module - Disable ngx_http_ssi_module
--without-http_userid_module - Disable ngx_http_userid_module
--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
--without-http_map_module - Disable ngx_http_map_module
--without-http_referer_module - Disable ngx_http_referer_module
--without-http_rewrite_module - Disable ngx_http_rewrite_module. Requires PCRE if enabled.
--without-http_proxy_module - Disable ngx_http_proxy_module
--without-http_fastcgi_module - Disable ngx_http_fastcgi_module
--without-http_memcached_module - Disable ngx_http_memcached_module
--without-http_limit_zone_module - Disable ngx_http_limit_zone_module
--without-http_empty_gif_module - Disable ngx_http_empty_gif_module
--without-http_browser_module - Disable ngx_http_browser_module
--without-http_upstream_ip_hash_module - Disable ngx_http_upstream_ip_hash_module
--with-http_perl_module - Enable ngx_http_perl_module
--with-perl_modules_path=PATH - Set path to the perl modules
--with-perl=PATH - Set path to the perl binary
--http-client-body-temp-path=PATH - Set path to the http client request body temporary files. If not set, defaults to <prefix>/client_body_temp
--http-proxy-temp-path=PATH - Set path to the http proxy temporary files. If not set, defaults to <prefix>/proxy_temp
--http-fastcgi-temp-path=PATH - Set path to the http fastcgi temporary files. If not set, defaults to <prefix>/fastcgi_temp
--without-http - Disable HTTP server
--with-mail - Enable IMAP4/POP3/SMTP proxy module
--with-mail_ssl_module - Enable ngx_mail_ssl_module
--with-cc=PATH - Set path to C compiler
--with-cpp=PATH - Set path to C preprocessor
--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 - Build for specified CPU, the valid values: pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64
--without-pcre - Disable PCRE library usage. Also disables HTTP rewrite module. PCRE is also required for regular expressions in "location" directive.
--with-pcre=DIR - Set path to PCRE library sources.
--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 - Enable debug logging
--add-module=PATH - Add in a third-party module found in directory PATH
Options may vary slightly between versions. Always check ./configure --help for the current list.
Examples
Example 1
This is a single 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-4.4 \ --with-zlib=../zlib-1.1.3
Example 2
Default Debian Lenny.
./configure \ --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --pid-path=/var/run/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --http-log-path=/var/log/nginx/access.log \ --with-http_dav_module \ --http-client-body-temp-path=/var/lib/nginx/body \ --with-http_ssl_module \ --http-proxy-temp-path=/var/lib/nginx/proxy \ --with-http_stub_status_module \ --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ --with-debug \ --with-http_flv_module
Example 3
I use this on RedHat based distros (RHEL, CentOS, Fedora). This is the configuration used for running this wiki.
First, install the dependencies:
yum install gcc openssl-devel pcre-devel zlib-devel
Then run configure:
./configure \ --prefix=/usr \ --sbin-path=/usr/sbin/nginx \ --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --pid-path=/var/run/nginx/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --user=nginx \ --group=nginx \ --with-http_ssl_module \ --with-http_flv_module \ --with-http_gzip_static_module \ --http-log-path=/var/log/nginx/access.log \ --http-client-body-temp-path=/var/tmp/nginx/client/ \ --http-proxy-temp-path=/var/tmp/nginx/proxy/ \ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/
Then finally build and install:
make && make install