Nginx module management and process management

Source: Internet
Author: User
Tags epoll

Objective

Nginx and Apache, the same applies to hungry modular management, but with the Apache "Hot plug" (each time you add a module, do not need to recompile, only need to reload) in a different way, Nginx each time you add a module or delete a module, you need to recompile to apply the corresponding function module.

Previous (http://blog.csdn.net/xlgen157387/article/details/49908523) has said Nginx's main modules include core, event, HTTP, Mail, and Misc (Miscellaneous), And each module according to the needs of a lot of modules, these 5 types of modules only core is not prohibited, other modules can be selected according to the actual situation.

Select the appropriate Nginx module

Available in Nginx (1.8.0) directory./configure–help can see which modules have been installed:

[Email protected] nginx-1.8.0]#/configure--help--help Print this message--prefix=PATH set installation prefix--sbin-path=Path set nginx binary pathname--conf-path=Path set nginx.conf pathname--error-log-path=Path set error log pathname--pid-path=Path set Nginx.pid pathname--lock-path=Path set Nginx.lock pathname--user=User set non-privileged user   forWorker Processes--group=Group set non-privileged group   forWorker Processes--build=name Set build name--builddir=DIR Set build directory--with-rtsig_module enable Rtsig module --with-select_module Enable select module --without-select_module Disable Select module --with-poll_module Enable poll module --without-poll_module Disable Poll module --with-threads enable thread pool support--with-file-aio Enable file AIO  Support--with-ipv6 enable IPv6  Support--with-http_ssl_module Enable Ngx_http_ssl_module--with-http_spdy_module Enable Ngx_http_spdy_module--with-http_realip_module Enable Ngx_http_realip_module--with-http_addition_module Enable Ngx_http_addition_module--with-http_xslt_module Enable Ngx_http_xslt_module--with-http_image_filter_module Enable Ngx_http_image_filter_module。。。 Omit part--without-http_charset_module Disable Ngx_http_charset_module--without-http_gzip_module Disable Ngx_http_gzip_module--without-http_ssi_module Disable Ngx_http_ssi_module。。。 Omit part Ngx_http_upstream_hash_module--without-http_upstream_ip_hash_moduleDisable Ngx_http_upstream_ip_hash_module--without-http_upstream_least_conn_moduleDisable Ngx_http_upstream_least_conn_module--without-http_upstream_keepalive_moduleDisable Ngx_http_upstream_keepalive_module--with-http_perl_module Enable Ngx_http_perl_module--with-perl_modules_path=Path set perl modules Path--with-perl=PATH set perl binary pathname--http-log-path=Path set HTTP access log pathname--http-client-body-temp-path=Path set path to storeHTTP client request body temporary files--http-proxy-temp-path=Path set path to storeHTTP Proxy Temporary Files--http-fastcgi-temp-path=Path set path to storeHTTP fastcgi Temporary Files--http-uwsgi-temp-path=Path set path to storeHTTP Uwsgi Temporary Files--http-scgi-temp-path=Path set path to storeHTTP scgi Temporary Files--without-http Disable http server--without-http-cache Disable http cache--with-mail Enable POP3/IMAP4/SMTP proxy module --with-mail_ssl_module Enable Ngx_mail_ssl_module--without-mail_pop3_module Disable Ngx_mail_pop3_module--without-mail_imap_module Disable Ngx_mail_imap_module--without-mail_smtp_module Disable Ngx_mail_smtp_module--with-google_perftools_module Enable Ngx_google_perftools_module--with-cpp_test_module Enable Ngx_cpp_test_module--add-Module=PATHenable  an external module                    --with-cc=PATH set C compiler pathname--with-cpp=PATH set C preprocessor Pathname--with-cc-opt=Options Set additional C compiler Options--with-ld-opt=Options Set additional linker options--with-cpu-opt=CPU build  for the specified CPU, valid values: Pentium, Pentiumpro, ... .... Omit part--with-openssl=DIR set path to OpenSSL library sources--with-openssl-opt=Options Set additional build options  for OpenSSL --with-debug Enable debug logging[Email protected] nginx-1.8.0]#

In the above information, –with-xxx means enable, –without-xxx is disabled, I here side all –WITH-XXX modules are not installed by default, and all –WITHOUT-XXX modules indicate that the default installation is a module that has been selected, so , pay attention to this rule. In addition there are both –with-xxx and –without-xxx, then this choice is not our choice, in the installation of the situation according to the system will install itself.

Nginx installation of third-party modules

In the Configure configuration of Nginx to compile the time, there is a parameter –add-module, is used to price the third-party module, for example:

--add-module=/root/nginx-accesskey-2.0.3

This is the anti-theft chain module, installation is so simple.

Nginx's Process Management

The Nginx is divided into single and master two process modes, one works by Ngx_single_process_cycle, the master model is a master process and multiple worker processes, Use the Master method in the actual development process.

Nginx in the Linux kernel version 2.6 above the use of the machine is the Epoll model, the so-called Epoll model is "Boss and subordinate" type, the boss rejoined subordinates to do.

Nginx module management and process management

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.