Nginx compilation parameters and nginx Parameters

Source: Internet
Author: User
Tags epoll openssl library

Nginx compilation parameters and nginx Parameters

Configure determines the system features and some features and methods that nginx can use to process connections. At last, it will create Makefile.

Configure supports the following options:

-Prefix = ? -Installation path. If not specified, the default value is/usr/local/nginx.

-Sbin-path = ? -Nginx executable command file. If not specified, the default value is

/Sbin/nginx.

-Conf-path = ? -If the-c parameter is not specified, the default position of nginx. conf is set

/Conf/nginx. conf.

-Pid-path = ? -Nginx. pid path. If it is not specified by the "pid" command in nginx. conf, the default value is

/Logs/nginx. pid.

-Lock-path = ? -Nginx. lock file path. If not specified, the default value is

/Logs/nginx. lock.

-Error-log-path = ? -When the "error_log" command is not used in nginx. conf to indicate the scheduled Error Log location, if not specified, the default value is

/Logs/error. log.

-Http-log-path = ? -If the "access_log" command is not used in nginx. conf to specify the scheduled access log location, the default value is

/Logs/access. log.

-User = ? -If the "user" command is not used in nginx. conf, it indicates that nginx is running at a scheduled time. If it is not specified, the default value is "nobody ".

-Group = ? -If the "user" command is not used in nginx. conf, it indicates the group for scheduled nginx running. If it is not specified, the default value is "nobody ".

-Builddir = DIR? -Set the build directory.

-With-rtsig_module? -Enable the rtsig module.

-With-select_module-without-select_module? -If no kqueue, epoll, rtsig, or/dev/poll is found during configure, the select module is always enabled.

-With-poll_module-without-poll_module? -If no kqueue, epoll, rtsig, or/dev/poll is found during configure, the poll module is always enabled.

-With-http_ssl_module? -Enable ngx_http_ssl_module, enable SSL support, and be able to process HTTPS requests. OpenSSL is required. In the Debian system, the corresponding package 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. If it is enabled, the zlib package is required.

-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. If enabled, the PCRE package is required.

-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 the path for the perl Module

-With-perl = PATH? -Set the path for the perl Library

-Http-client-body-temp-path = PATH? -Set the path for the temporary file of the request object for http connection. If not specified, the default value is

/Client_body_temp

-Http-proxy-temp-path = PATH? -Set the path for the temporary http Proxy file. If not specified, the default value is

/Proxy_temp

-Http-fastcgi-temp-path = PATH? -Set the path for the http fastcgi temporary file. If not specified, the default value is

/Fastcgi_temp

-Without-http? -Disable the HTTP service.

-With-mail? -Enable IMAP4/POP3/SMTP proxy Module

-With-mail_ssl_module? -Enable ngx_mail_ssl_module

-With-cc = PATH? -Set the C compiler path

-With-cpp = PATH? -Set the C Preprocessor path

-With-cc-opt = OPTIONS? -The parameter appended to the variable CFLAGS is used for the PCRE Library in FreeBSD. You also need to specify-with-cc-opt = "-I/usr/local/include ", if we use the select () function, we need to increase the number of file descriptors at the same time. You can use-with-cc-opt = "-D FD_SETSIZE = 2048" to specify.

-With-ld-opt = OPTIONS? -Use the additional parameters of the connector for the PCRE Library in FreeBSD. You also need to specify-with-ld-opt = "-L/usr/local/lib ".

-With-cpu-opt = CPU? -Specify the compiled CPU. Available values: pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, and ppc64.

-Without-pcre? -Disable the PCRE Library file and disable the HTTP rewrite module. If you want to use a regular expression in the "location" command, you also need the PCRE Library.

-With-pcre = DIR? -Set the path of the source file of the PCRE Library.

-With-pcre-opt = OPTIONS? -Set additional parameters for PCRE during compilation.

-With-md5 = DIR? -Set the source file path of the md5 library.

-With-md5-opt = OPTIONS? -Set additional parameters for md5 during compilation.

-With-md5-asm? -Use md5 to compile the source.

-With-sha1 = DIR? -Set the sha1 Library source file path.

-With-sha1-opt = OPTIONS? -Set additional parameters for sha1 during compilation.

-With-sha1-asm? -Use sha1 to compile the source.

-With-zlib = DIR? -Set the source file path of the zlib library.

-With-zlib-opt = OPTIONS? -Set additional parameters for zlib during compilation.

-With-zlib-asm = CPU? -Optimize the zlib Assembly source for the specified CPU. Available values: pentium and pentiumpro.

-With-openssl = DIR? -Set the source file path of the openssl library.

-With-openssl-opt = OPTIONS? -Set additional parameters for openssl during compilation.

-With-debug? -Enable debug record.

-Add-module = PATH? -Add a third-party module in PATH.

The compilation parameters may vary according to different versions. You can use./configure-help to view the compilation parameter list.

Example 1

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

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

It is used for RedHat-based systems (RHEL, CentOS, Fedora ).

First, install the dependency package:

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/

Finally, compile and install:

make && make install


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.