Install Nginx? To grab from the doll

  nginx, php

Translation of this article and August 26, 2017

Use the configure command to configure the build. It defines all aspects of the system, including methods that allow connection processing using nginx. Finally it creates a Makefile. The configure command supports the following parameters:

  • –prefix=pathDefine a system directory stored by nginx, which will store nginx code and configuration files. If it is not set, it will be installed in the /usr/local/nginx directory by default.
  • –sbin-path=pathSets the path to a nginx executable. By default, the path is prefix/sbin/nginx
  • –conf-path=pathSet the directory where the default nginx configuration file is located. You can start nginx through different configuration files. Add the parameter -c fileprefix/conf/nginx.conf when starting
  • –pid-path=pathSet the path to the nginx.pid file where the main process ID will be stored. By default, files are installed to prefix/logs/nginx.pid.
  • –error-log-path=pathThe files and directories where error messages such as errors, warnings and reminders are stored will be installed to by default.

Log. After installation, you can modify the error_log option in the nginx.conf configuration file to change it.

  • –http-log-path=pathSet the name of the server request log file. After installation, it can be modified through the access_log option in nginx.conf the default name is prefix/logs/access.log.
  • –build=nameSet an optional nginx build name.
  • –user=nameSet the user of nginx. Under normal circumstances, I will set up a nginx user to specify. The default user is nobody.
  • –group=nameSet the group to which nginx belongs. Under normal circumstances, I will set up a nginx group to specify. The default is nobody group.
  • –without-http_gzip_moduleThe response module of the compressed HTTP server is not compiled. The zlib library is required to compile and run this module.
  • –without-http_rewrite_moduleThe rewrite module is not compiled. Compile and run this module requires PCRE library support.
  • –without-http_proxy_moduleDisable building HTTP server proxy module.
  • –with-http_ssl_moduleCompile https module so that the server can support https protocol.
  • –with-pcre=pathSpecify the path to PCRE
  • –with-pcre-jitBuild PCRE library (1.1.12, pcre_jit instruction) with “instant compilation”.
  • –with-zlib=pathSpecify the path to zlib

I also don’t know how to understand the following configurations. I can’t explain them reasonably. Friends who know them can trust me privately.

  • –with-select_module–without-select_module _ module enables or disables building modules that allow the server to use the select () method. If the platform does not seem to support a more appropriate method (such as kqueue, EPOL, or/dev/poll), the module will be built automatically.
  • –with-poll_module-without-poll _ module enables or disables building modules that allow the server to use the poll () method. If the platform does not seem to support a more appropriate method (such as kqueue, EPOL, or/dev/poll), the module will be built automatically.
  • –with-cc-opt=parametersSet additional parameters to 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 supported files select () needs to be increased, it can also be specified here, for example:-WITH-CC-OPT = “-DFD _ SETSIZE = 2048”.
  • –with-ld-opt=parametersSet additional parameters to be used during linking. When using the system PCRE library under FreeBSD,-with-ld-opt = “-l/usr/local/lib” should be specified.

Examples of parameter usage (all of which require one line of input):

./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-8.41
 --with-zlib = ../zlib-1.2.11

After the configuration is completed, use make to compile and install.