nginx配置编译学习

来源:互联网 发布:多目标优化算法 编辑:程序博客网 时间:2024/05/21 22:35

nginx配置编译安装过程:

 

   功能配置信息,目标路径信息等                                    makefile, modules.c                                   可执行文件

 -----------------------------------------------》 Config 操作 ----------------------------------》make 操作 ---------------------------------》makeinstall操作

 

NGINX  为什么在config时生成一个modules.c 文件呢? -------------- 为了把modules配置信息传递到 系统执行阶段;

 

 这样系统代码执行的时候就不必修改代码就可以知道要调用哪些Modules相关内容了(如下代码内容),config阶段配置了哪些modules下面的数组就有哪些模块地址:

ngx_module_t *ngx_modules[] = { 
    &ngx_core_module, 
    &ngx_errlog_module, 
    &ngx_conf_module, 
    ... ... 

 

否则配置内容一改,特别是系统需要调用新增modules时就需要修改代码了,直接在Config阶段一次性搞定:)

 

原创粉丝点击