Nginx Source Compilation installation Options

Source: Internet
Author: User
Tags epoll openssl library

"Nginx source code compilation process"

Make is used to compile , it reads the instruction from the makefile, and then compiles.

The make install is used to install , and it also reads instructions from makefile and installs to the specified location.

The Configure command is used to detect the target characteristics of your installation platform. It defines all aspects of the system, including Nginx's allowed connection processing methods, such as it detects if you have CC or GCC, does not require CC or GCC, it is a shell script, and at the end of execution it creates a makefile file.

"Nginx's Configure command supports the following parameters"

  • --prefix=pathDefine a directory that stores files on the server, which is the installation directory of Nginx. Default usage/usr/local/nginx
  • --sbin-path=pathSets the path of the Nginx executable file, which defaults toprefix/sbin/nginx
  • --conf-path=pathSet the path to the nginx.conf configuration file. Nginx allows you to start with a different configuration file via the-C option on the command line. Default isprefix/conf/nginx.conf
  • --pid-path=path  设置nginx.pid文件,将存储的主进程的进程号。安装完成后,可以随时改变的文件名 , 在nginx.conf配置文件中使用 PID指令。默认情况下,文件名 为prefix/logs/nginx.pid.
  • --error-log-path=pathSets the name of the primary error, warning, and diagnostic file. After the installation is complete, you can change the file name at any time, using the Error_log directive in the nginx.conf configuration file. By default, the file name isprefix/logs/error.log
  • --http-log-path=pathSets the name of the log file for the HTTP server for the primary request. After the installation is complete, you can change the file name at any time, using the Access_log directive in the nginx.conf configuration file. By default, the file name is prefix/logs/access.log .
  • --user=nameThe user who set the Nginx worker process. After the installation is complete, you can change the name of the user directive that is used in the nginx.conf configuration file at any time. The default user name is nobody
  • --group=nameSets the user group for the Nginx worker process. After the installation is complete, you can change the name of the user directive that is used in the nginx.conf configuration file at any time. Default to non-privileged users
  • --with-select_module--without-select_module 启用或禁用构建一个模块来允许服务器使用select()方法。该模块将自动建立,如果平台不支持的kqueue,epoll,rtsig或/dev/poll
  • --with-poll_module--without-poll_moduleenables or disables building a module to allow the server to use the poll () method. The module will be created automatically if the platform does not support Kqueue,epoll,rtsig or/dev/poll
  • --without-http_gzip_module-Do not compile the response module of the compressed HTTP server. Compiling and running this module requires the Zlib library
  • --without-http_rewrite_moduleThe rewrite module is not compiled. Compiling and running this module requires PCRE library support
  • --without-http_proxy_module-Do not compile Http_proxy module
  • --with-http_ssl_module-Use the HTTPS protocol module. By default, the module is not built. It is necessary to build and run the OpenSSL library for this module
  • --with-pcre=path-Set the source path of the Pcre library. The source code of the Pcre Library (version 4.4-8.30) needs to be downloaded and decompressed from the Pcre website. The rest of the work is nginx./configure and make to complete. Regular expressions are used in the location directive and in the Ngx_http_rewrite_module module
  • --with-pcre-jit-compilation Pcre contains "Just-in-time compilation" (1.1.12, Pcre_jit instructions)
  • --with-zlib=path-Set the source path of the zlib library. To download and unzip from zlib (version 1.1.3-1.2.5). The rest of the work is nginx./configure and make complete. The Ngx_http_gzip_module module requires the use of zlib
  • --with-cc-opt=parameters-Set additional parameters to be added to the cflags variable. For example, when you use the Pcre library on FreeBSD, you need to use: --with-cc-opt="-I /usr/local/include。 . Add as needed select()支持的文件数量 :--with-cc-opt="-D FD_SETSIZE=2048"
  • --with-ld-opt=parameters-Set additional parameters that will be used during the link. For example, when using the Pcre Library of the system under FreeBSD, you should specify:--with-ld-opt="-L /usr/local/lib"

Nginx Source Compilation installation Options

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.