Module-dependent gzip module requires zlib library rewrite module requires pcre Library ssl function requires openssl library pre-compiled installation package Nginx will be available in some Linux releases and BSD variant versions of the installation package repository, you can use the software package management method that comes with each system to install it. Note that many pre-compiled installation packages are outdated. In most cases, it is recommended to compile them directly from the source code. Ubuntu (Deb
The gzip module requires the zlib library rewrite module, and the pcre Library ssl function requires the openssl library.
Nginx is available in the installation package repositories of some Linux distributions and different BSD variants. you can install Nginx by using the software package management method provided by each system. Note that many pre-compiled installation packages are outdated. In most cases, it is recommended to compile them directly from the source code.
2. Extract
3. Compile and install
-
--prefix=path-Defines a directory that will keep server files. This same directory will also be used for all relative paths setconfigure(Could t for paths to libraries sources) and innginx.confConfiguration file. It is set to/usr/local/nginxDirectory by default.
Nginx installation path. If not specified, the default value is/usr/local/nginx.
-
--sbin-path=path-Sets the name of an nginx executable file. This name is used only during installation. By default the file is namedprefix/sbin/nginx.
Nginx Executable File Installation path. It can only be specified during installation. If it is not specified, the default value is /Sbin/nginx.
-
--conf-path=path -Sets the name ofnginx.confConfiguration 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 namedprefix/conf/nginx.conf.
The default nginx. conf path is not given with the-c option. If not specified, the default value is /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 innginx.confConfiguration file using the pid directive. By default the file is namedprefix/logs/nginx.pid.
Specify the nginx. pid file name. After installation, the name can be modified in the nginx. cong file. If not specified, the default value is /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 innginx.confConfiguration file using the error_log directive. By default the file is namedprefix/logs/error.log.
If the error_log command is not specified in nginx. conf, the default Error Log Path is used. If not specified, the default value is /Logs/error. 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 innginx.confConfiguration file using the access_log directive. By default the file is namedprefix/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 innginx.confConfiguration file using the user directive. The default user name is nobody.
If no user command is specified in nginx. conf, the default nginx user is used. If not specified, the default value 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 innginx.confConfiguration file using the user directive. By default, a group name is set to the name of an unprivileged user.
If no user command is specified in nginx. conf, the default group used by nginx is used. If not specified, the default value is nobody.
-
--with-select_module
--without-select_module-Enables or disables building a module that allows the server to work withselect()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 withpoll()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-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.
Disable ngx_http_rewrite_module.
-
--without-http_proxy_module-Disables building an HTTP server proxying 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.
Enable the http ssl module so that NGINX can support HTTPS requests. OPENSSL must be installed for 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.
Specifies the path of the PCRE Library. (PCRE is the Regular Expression Library)
-
--with-pcre-jit-Builds the PCRE library with "just-in-time compilation" support.
-
--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 thengx_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"Shocould be specified. If the number of files supportedselect()Needs to be increased it can also be specified here such as this:--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,--with-ld-opt="-L /usr/local/lib"Shocould be specified.