Nginx Real (1) Installation and option description

Source: Internet
Author: User
Tags geoip imap install perl

1. Download Nginx, currently download the latest version can be

Official website: http://nginx.org/en/download.html


2. Compilation option Description, this part is very boring, but it is recommended to see, the new version adds a lot of new features

# ./configure --help--prefix=path         // Specifies the path to the installation directory--sbin-path=path      //specifies the installation path of the executable program--modules-path=path    //the path to the specified module--conf-path=path      //the specified configuration file--error-log-path=path // Specify the path to the error log--pid-path=path       //specify the path to the PID file--lock-path=path       //Specifies the installation path of the lock file  --user=user   //the user who specified the run--group=group // Specify the running group--build=name  //set compilation name--builddir=dir //set compilation directory--with-select_module  // Enabling Select module support is not recommended, enabling--without-select_module //disabling Select module Support--with-poll_module    // Enabling poll module support is not recommended, enabling--without-poll_module  //disable poll module support--with-threads  // Enabling thread pooling supports--with-file-aio //file Aio (asynchronous I/O) mode support, which is recommended to a large extent to improve the throughput of the system--with-ipv6  // IPV6 support--with-http_ssl_module        //enable the support SSL mode, which isHTTPS, you must first install the openssl--with-http_v2_module         //Support HTTP2 protocol, replacing the NGX _http_spdy_module, Google spdy--with-http_realip_module     //allows the request header to change the client's IP address--with-http_ addition_module   //This module is a filter that adds text before and after the reaction. --with-http_xslt_module       //0.7.8 later version support, this module is a filter, Transforms an XML response using one or more XSLT style sheets. --with-http_image_filter_module //a filter that transmits jpeg/gif/png  pictures (default is not enabled.) GD Library to use)--with-http_geoip_module //module (0.8.6+) to create variables, using a precompiled Maxmind database to resolve the client IP address, to obtain the value of the variable--with-http_sub_module    //allows some text in the Nginx response to be replaced with some other text--with-http_dav_module   //add Put,delete,mkcol: Create the collection, Copy and Move method) is off by default and needs to be compiled to open the--with-http_flv_module   //module ngx_http_flv_module  to flash  Video (FLV) file   provide service-side pseudo-streaming media support--with-http_mp4_module   //module Ngx_http_mp4_module is a H.264/AAC file, mainly in  .mp4,. M4V, and. M4A provide pseudo-streaming media service-side support for file extensions, . --with-http_gunzip_module  //ngx_http_gunzipThe _module module is a filter,  it extracts a response with a "Content-encoding: gzip" header for clients that do not support the "gzip" encoding method.  ,  This module is useful when you want to store compressed data to save space and reduce I/o overhead, and do not want to adversely affect clients that do not support gzip compression. --with-http_gzip_static_module  //Module  ngx_http_gzip_static_module  allows you to send a pre-compressed file with ". gz" as the file name extension, Instead of sending a normal file. The--with-http_auth_request_module //module Ngx_http_auth_request_modul (1.5.4+) implements the basic authentication of the client--with-http_random_ index_module //Display random Home module support--with-http_secure_link_module  //This module checks the request URL for a required security token. To use this module, you must specify the following compilation parameters at compile time (0.7.18 version available)--with-http_degradation_module  //enable Ngx_http_degradation_ Module support (allows 204 or 444 yards to be returned in case of low memory) the--with-http_slice_module  //ngx_http_slice_module module (1.9.8) is a filter that It divides the request into subrequests, each of which returns a specific range of responses. Large filters provide a more efficient caching response. The--with-http_stub_status_module //module Ngx_http_stub_status_module provides access to basic state information--without-http_charset_module  //disables Ngx_http_charset_module support (recoding Web pages, but only one Direction-server-to-client, and only one byte of encoding can be re-encoded)--without-http_gzip_module   //does not compile the Http_gzip_module module. The module can compress the response of the HTTP server, the module requires zlib library to compile and run--without-http_ssi_module  //disable SSI support; Ngx_http_ssi_module module is a filter processing SSI (server side included) The command responds through it. Currently, the list of supported SSI commands is incomplete. --without-http_userid_module  //disables Ngx_http_userid_module, this module is suitable for client setting cookie recognition. Receive and set cookies can be recorded using embedded variables $uid_got and $uid_set--without-http_access_module  //prohibit Ngx_http_access_module, This module allows restricting access to certain customer addresses. --without-http_auth_basic_module  //prohibit Basic authentication modules, such as username and password--without-http_autoindex_module    //prohibits the Ngx_http_autoindex_module module process from requesting a slash character ("/") and generating a directory listing. Usually a request is passed to the Ngx_http_autoindex_module module when the Ngx_http_index_module module cannot find an index file. Meet the instructions. --without-http_geo_module  //Disallow Ngx_http_geo_module module creation of variables and values depends on the client IP address. --without-http_map_module  //prohibit Ngx_http_map_module Module The value of creating a variable depends on the value of the other variable. --without-http_split_clients_module  //disables Ngx_http_split_clients_module support, which is used to divide users based on certain conditions. Conditions such as: IP address, header, cookies, etc.)--without-http_referer_module  //disable Disable ngx_http_referer_ Module support (the module is used to filter the request, rejecting the Referer value in the header is incorrect)--without-http_rewrite_module  //Disable the Ngx_http_rewrite_module module for the change request URI using regular expressions, return redirection, conditionally select the configuration. --without-http_proxy_module  //disabling Ngx_http_proxy_module support (for proxy servers)--without-http_fastcgi_module   //disables Ngx_http_fastcgi_module support, which allows nginx  to interact with the fastcgi  process and control the fastcgi  process by passing parameters.  ) fastcgi a resident-type public gateway interface. --without-http_uwsgi_module  //Disable Ngx_http_uwsgi_module Support (this module is used for medical UWSGI protocol, UWSGI server related)--without-http_ scgi_module  //disables Ngx_http_scgi_module support, which is used to enable SCGI protocol support, and the SCGI protocol is an alternative to the CGI protocol. It is an application-to-HTTP service interface standard. It's somewhat like fastcgi but his design   is easier to implement. --without-http_memcached_module  //disables Ngx_http_memcached_module support, which is used to provide a simple cache, To improve system efficiency) The--without-http_limit_conn_module  //ngx_http_limit_conn_module  module can limit the number of connections per key value by the defined key. In particular, you can set the number of connections for a single  IP  source. The--without-http_limit_req_module  //ngx_http_limit_req_module module (0.7.21) can limit the frequency of request processing by defining the   key value. In particular, it can limit the frequency of request processing from a single IP address. The   limit approach is to defer excessive request processing by fixing the number of requests processed per second through a "leaky bucket" approach. --without-http_empty_gif_module  //Disable Ngx_http_empty_gif_module support (the module resides in memory with a 1*1 transparent GIF image that can be called very quickly)--without-http_browser_module  // Disables Ngx_http_browser_module support, which is used to create a value that relies on the request header. If the browser is modern&nbsp, then $modern_browser equals the value assigned by the modern_browser_value instruction, if the   browser is old, $ancient_browser equals   The value of the ancient_browser_value instruction assignment, or if the browser is any version in  msie,   $msie equals 1)--without-http_upstream_hash_module   //disabling upstream hash module--without-http_upstream_ip_hash_module //Disable Ngx_http_upstream_ip_hash_ Module support (for simple load Balancing) The--without-http_upstream_least_conn_module //ngx_http_upstream_module module is used to define the server group, You can refer to the Proxy_pass,fastcgi_pass,uwsgi_pass,scgi_pass,memcached_pass directive. --without-http_upstream_keepalive_module //prohibit upstream_keepalive This module, enable keepalive for upstream  servers--without-http_upstream_zone_module //Disable upstream zone, such as: UPSTREAM BACKEND {}--WITH-HTTP_ perl_module //Enable Ngx_http_perl_module Support (This module allows Nginx to directly use Perl or call Perl via SSI)--with-perl_modules_path=path  //Set Perl module path--with-perl=path  //set perL Library file path--http-log-path=path   //set Access log path--http-client-body-temp-path=path // Set HTTP client request temporary file path--http-proxy-temp-path=path  //defines a directory to store temporary files for data received by the proxy server. To a level three subdirectory hierarchy, you can use the directory specified below. --http-fastcgi-temp-path=path  //setting http fastcgi temporary file path--http-uwsgi-temp-path=path  // Set Http uwsgi temporary file path--http-scgi-temp-path=path  //set http scgi temporary file path--without-http    //Disabling the Http server feature--without-http-cache //disabling http cache--with-mail   // Enable POP3/IMAP/SMTP Agent support--with-mail_ssl_module //enable mail Security support--without-mail_pop3_module // Disabling the POP3 protocol supports--WITHOUT-MAIL_IMAP_MODULE //disabling IMAP protocol support--without-mail_smtp_module // Disable SMTP protocol support--with-stream  //This module will be enabled after version 1.90. However, it is not installed by default and needs to be specified at compile time, this module supports the TCP proxy--with-stream_ssl_module  //ngx_stream_ssl_module module (1.9.0) Provides the necessary SSL/TLS protocols that support the flow proxy server. This module is not established by default, it should be enabled by the--with-stream_ssl_module configuration key. --without-stream_limit_conn_module  //Forbidden ngx_sThe Tream_limit_conn_module module () is used to limit the number of connections/definitions of the key, especially the number of connections from a single IP address. The--without-stream_access_module  //prohibit Ngx_stream_access_module module (1.9.2) allows restricting access to certain customer addresses. The--without-stream_upstream_hash_module  //Forbidden Ngx_stream_upstream_module Module (1.9.0) is used to define a server group and can be referenced proxy_ Pass instruction. --without-stream_upstream_least_conn_module  //prohibits a server group that specifies that server groups should use the load balancing method to pass the least number of active connections to the server, taking into account the weights. If there are several such servers, they try to use the weighted cyclic balancing method--without-stream_upstream_zone_module  //--with-google_perftools_module  //google-perftools contains four tools, namely: Tcmalloc, Heap-checker, Heap-profiler and Cpu-profiler, Tcmalloc is one of the google-perftools tools that optimizes the efficiency and speed of memory allocation, helping to control memory usage well in high concurrency situations. --with-cpp_test_module  //--add-module=path   //add support for third-party modules--add-dynamic-module=path The path of the   //dynamic module--with-cc=path  //The path to the C compiler--with-cpp=path //the path to the C preprocessor--with-cc-opt= options  //set the C compiler parameter--with-ld-opt=options  //set the connection file parameter--with-cpu-opt=cpu   // Specifies that the compiled CPU is available with the following values:  PENTIUM, PENTIUMPRO,&Nbsp;pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64,  ppc64--without-pcre  //disabling Pcre library--with-pcre     //enable pcre--with-pcre=dir   //the directory that points to the Pcre library--with-pcre-opt=options //The compile-time setting additional parameters for the Pcre library--with-pcre-jit  //compile Pcre library when adding "real-time compilation ( Pcre_jit) "Support. --with-md5=dir //points to the MD5 library file directory (message digest algorithm version fifth, which provides integrity protection for messages)--with-md5-opt=options // Set additional parameters for the MD5 library at compile time--with-md5-asm //use MD5 assembler source--with-sha1=dir  //point to SHA1 Library directory (digital Signature Algorithm, Primarily for digital signatures)--with-sha1-opt=options   //set additional parameters for the SHA1 library at compile time--with-sha1-asm  // Use the SHA1 assembler source--with-zlib=dir  //to point to the Zlib Library directory--with-zlib-opt=options //set additional parameters for zlib at compile time--with-zlib-asm= cpu //is optimized for the specified CPU using the zlib assembler source and the CPU type is pentium, pentiumpro--with-libatomic // Provides a schema for the implementation of an update operation for atomic memory--with-libatomic=dir //point to the Libatomic_ops installation directory--with-openssl=dir // Point to the OpenSSL installation directory--with-openssl-opt=options //set additional parameters for OpenSSL at compile time--with-debug //enable debug logging

3. Installing zlib

TAR-XF ZLIB-1.2.8.TAR.GZCD Zlib-1.2.8makemake insatll

4. Installing Pcre

TAR-XF pcre-8.37.tar.gzcd Pcre-8.37makemake Install

5. Installing OpenSSL

TAR-XF openssl-1.0.2.tar.gz./config--prefix=/usr/local--openssldir=/usr/local/opensslmakemake insatll

6. Installing Geo

wget tar-xf GeoIP.tar.gz cd geoip-1.4.8makemake Install

7. Install other dependencies

Yum-y Install Perl-devel perl-extutils-embed libatomic*

8. Install Nginx, the version is the latest nginx-1.9.14,1.9 after adding a lot of new features, such as TCP proxy support HTTP2, etc.

Tar -xf nginx-1.9.14.tar.gzcd nginx-1.9.14./configure  --prefix=/app/local/nginx  --pid-path=/app/local/nginx --user=nginx --group=nginx --with-threads -- With-file-aio --with-http_ssl_module --with-http_v2_module  --with-http_addition_module  --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_ Module --with-http_mp4_module --with-http_perl_module --with-mail --with-http_gzip_static_ Module --with-http_auth_request_module  --with-http_random_index_module --with-http_secure _link_module --with-http_degradation_module --with-http_slice_module -with-http_stub_status_ module --with-http_perl_module --with-zlib=/tmp/soft/zlib-1.2.8 --with-stream -- with-stream_ssl_module --with-pcre=/tmp/soft/pcre-8.37 --with-openssl=/tmp/soft/openssl-1.0.2 - -with-libatomicmakemake install

Start Nginx

/app/local/nginx/sbin/nginx

Restart Nginx (unloading)

/app/local/nginx/sbin/nginx-s relaod

Check for syntax errors

/app/local/nginx/sbin/nginx-t

View version

/app/local/nginx/sbin/nginx-v


This article is from the "OPS rookie" blog, please be sure to keep this source http://ckl893.blog.51cto.com/8827818/1762740

Nginx Real (1) Installation and option description

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.