The build is configured using the ''configure'' command. It defines various aspects of the system, including the methods nginx is allowed to use for connection processing. At the end it creates a Makefile. The configure command supports the following parameters:

+

The build is configured using the ''configure'' command. It defines various aspects of the system, including the methods nginx is allowed to use for connection processing. At the end it creates a Makefile.

+

The configure command supports the following parameters:

+

+

== Files and permissions ==

'''--prefix=''path''''' - defines a directory that will keep server files. This same directory will also be used for all relative paths set by configure (except for paths to libraries sources) and in the nginx.conf configuration file. It is set to the /usr/local/nginx directory by default.

'''--prefix=''path''''' - defines a directory that will keep server files. This same directory will also be used for all relative paths set by configure (except for paths to libraries sources) and in the nginx.conf configuration file. It is set to the /usr/local/nginx directory by default.

Line 11:

Line 14:

'''--pid-path=''path''''' — sets the name of an nginx.pid file that will store the process ID of the main process. After installation, the file name can always be changed in the nginx.conf configuration file using the pid directive. By default the file is named prefix/logs/nginx.pid.

'''--pid-path=''path''''' — sets the name of an nginx.pid file that will store the process ID of the main process. After installation, the file name can always be changed in the nginx.conf configuration file using the pid directive. By default the file is named prefix/logs/nginx.pid.

−

'''--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. By default the file is named prefix/logs/error.log.

+

'''--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. By default the file is named prefix/logs/error.log. The special "stderr" value tells nginx to log pre-configuration messages to the standard error.

'''--http-log-path=''path''''' — sets the name of the primary request log file of the HTTP server. After installation, the file name can always be changed in the nginx.conf configuration file using the access_log directive. By default the file is named prefix/logs/access.log.

'''--http-log-path=''path''''' — sets the name of the primary request log file of the HTTP server. After installation, the file name can always be changed in the nginx.conf configuration file using the access_log directive. By default the file is named prefix/logs/access.log.

Line 19:

Line 22:

'''--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. By default, a group name is set to the name of an unprivileged user.

'''--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. By default, a group name is set to the name of an unprivileged user.

−

'''--with-select_module'''

+

== Event loop ==

+

'''--with-select_module'''<br>

'''--without-select_module''' — enables or disables building a module that allows the server to work with the select() method. This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, rtsig, or /dev/poll.

'''--without-select_module''' — enables or disables building a module that allows the server to work with the select() method. This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, rtsig, or /dev/poll.

−

+

'''--with-poll_module'''<br>

−

'''--with-poll_module'''

+

'''--without-poll_module''' — enables or disables building a module that allows the server to work with the poll() method. This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, rtsig, or /dev/poll.

'''--without-poll_module''' — enables or disables building a module that allows the server to work with the poll() method. This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, rtsig, or /dev/poll.

+

== Optional modules ==

'''--without-http_gzip_module''' — disables building a module that compresses responses of an HTTP server. The zlib library is required to build and run this module.

'''--without-http_gzip_module''' — disables building a module that compresses responses of an HTTP server. The zlib library is required to build and run this module.

Line 33:

Line 37:

'''--with-http_ssl_module''' — enables building a module that adds the HTTPS protocol support to an HTTP server. This module is not built by default. The OpenSSL library is required to build and run this module.

'''--with-http_ssl_module''' — enables building a module that adds the HTTPS protocol support to an HTTP server. This module is not built by default. The OpenSSL library is required to build and run this module.

−

'''--with-pcre=path''' — sets the path to the sources of the PCRE library. The library distribution (version 4.4 — 8.21) needs to be downloaded from the PCRE site and extracted. The rest is done by nginx's ./configure and make. The library is required for regular expressions support in the location directive and for the ngx_http_rewrite_module module. See [[#note]] below for using system PCRE on FreeBSD systems.

+

'''--with-pcre=path''' — sets the path to the sources of the PCRE library. The library distribution (version 4.4 — 8.21) needs to be downloaded from the PCRE site and extracted. The rest is done by nginx's ./configure and make. The library is required for regular expressions support in the location directive and for the ngx_http_rewrite_module module. See [[#Notes|notes]] below for using system PCRE on FreeBSD systems.

'''--with-zlib=''path''''' — sets the path to the sources of the zlib library. The library distribution (version 1.1.3 — 1.2.5) needs to be downloaded from the zlib site and extracted. The rest is done by nginx's ./configure and make. The library is required for the ngx_http_gzip_module module.

'''--with-zlib=''path''''' — sets the path to the sources of the zlib library. The library distribution (version 1.1.3 — 1.2.5) needs to be downloaded from the zlib site and extracted. The rest is done by nginx's ./configure and make. The library is required for the ngx_http_gzip_module module.

−

'''--with-cc-opt=''parameters''''' — sets additional parameters that will be added to the CFLAGS variable. When using the system PCRE library under FreeBSD, --with-cc-opt="-I /usr/local/include" should be specified. If the number of files supported by select() needs to be increased it can also be specified here such as this: --with-cc-opt="-D FD_SETSIZE=2048".

+

== Compilation controls ==

+

'''--with-cc-opt=''parameters''''' — sets additional parameters that will be added to the CFLAGS variable.

−

'''--with-ld-opt=''parameters''''' — sets additional parameters that will be used during linking.

+

'''--with-ld-opt=''parameters''''' — sets additional parameters that will be used during linking.

+

= Example =

Example of parameters usage (all of this needs to be typed in one line):

Example of parameters usage (all of this needs to be typed in one line):

Line 52:

Line 58:

--with-pcre=../pcre-4.4

--with-pcre=../pcre-4.4

--with-zlib=../zlib-1.1.3

--with-zlib=../zlib-1.1.3

−

= Notes =

= Notes =

−

When using the system PCRE library under FreeBSD, ''--with-ld-opt="-L /usr/local/lib"'' should be specified.

+

When using the system PCRE library under FreeBSD, the following options should be specified:

+

+

--with-ld-opt="-L /usr/local/lib" \

+

--with-cc-opt="-I /usr/local/include"

+

+

+

If the number of files supported by select() needs to be increased it can also be specified like this:

+

+

--with-cc-opt="-D FD_SETSIZE=2048"

+

+

= References =

+

[http://nginx.org/en/docs/install.html Official documentation]

Latest revision as of 17:49, 5 October 2012

Contents

Installation and compile-time options

The build is configured using the configure command. It defines various aspects of the system, including the methods nginx is allowed to use for connection processing. At the end it creates a Makefile.

The configure command supports the following parameters:

Files and permissions

--prefix=path - defines a directory that will keep server files. This same directory will also be used for all relative paths set by configure (except for paths to libraries sources) and in the nginx.conf configuration file. It is set to the /usr/local/nginx directory by default.

--sbin-path=path - sets the name of an nginx executable file. This name is used only during installation. By default the file is named prefix/sbin/nginx.

--conf-path=path — sets the name of an nginx.conf configuration file. If needs be, nginx can always be started with a different configuration file, by specifying it in the command-line parameter -c file. By default the file is named prefix/conf/nginx.conf.

--pid-path=path — sets the name of an nginx.pid file that will store the process ID of the main process. After installation, the file name can always be changed in the nginx.conf configuration file using the pid directive. By default the file is named prefix/logs/nginx.pid.

--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. By default the file is named prefix/logs/error.log. The special "stderr" value tells nginx to log pre-configuration messages to the standard error.

--http-log-path=path — sets the name of the primary request log file of the HTTP server. After installation, the file name can always be changed in the nginx.conf configuration file using the access_log directive. By default the file is named prefix/logs/access.log.

--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. The default user name is 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. By default, a group name is set to the name of an unprivileged user.

Event loop

--with-select_module--without-select_module — enables or disables building a module that allows the server to work with the select() method. This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, rtsig, or /dev/poll.
--with-poll_module--without-poll_module — enables or disables building a module that allows the server to work with the poll() method. This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, rtsig, or /dev/poll.

Optional modules

--without-http_gzip_module — disables building a module that compresses responses of an HTTP server. The zlib library is required to build and run this module.

--without-http_rewrite_module — disables building a module that allows an HTTP server to redirect requests and change URI of requests. The PCRE library is required to build and run this module. The module is experimental — its directives may change in the future.

--with-http_ssl_module — enables building a module that adds the HTTPS protocol support to an HTTP server. This module is not built by default. The OpenSSL library is required to build and run this module.

--with-pcre=path — sets the path to the sources of the PCRE library. The library distribution (version 4.4 — 8.21) needs to be downloaded from the PCRE site and extracted. The rest is done by nginx's ./configure and make. The library is required for regular expressions support in the location directive and for the ngx_http_rewrite_module module. See notes below for using system PCRE on FreeBSD systems.

--with-zlib=path — sets the path to the sources of the zlib library. The library distribution (version 1.1.3 — 1.2.5) needs to be downloaded from the zlib site and extracted. The rest is done by nginx's ./configure and make. The library is required for the ngx_http_gzip_module module.

Compilation controls

--with-cc-opt=parameters — sets additional parameters that will be added to the CFLAGS variable.

--with-ld-opt=parameters — sets additional parameters that will be used during linking.

Example

Example of parameters usage (all of this needs to be typed in one line):