Nginx的四大组成部分
1.nginx二进制文件 由各模块编译出的一个文件
2.nginx.conf 控制nginx的行为
3.access.log 访问日志 记录每一条请求信息
4.error.log 错误日志 定位问题
Nginx的发行版本
nginx.org 开源版本
nginx.com 商业版本
openresty 开源版 效率提升
openresty 商业版 开发专业API服务器
编译自己的nginx
1.下载nginx stable稳定版
2.目录结构

auto :

cc 编译
lib 库
os 系统判断
其他 辅助config进行nginx支持哪些模块
change: 版本特性
conf : 示例配置文件
configure: liux必备步骤
contrib :nginx语法文件,可以拷贝到vim中,高亮显示
html
50x.html 50x错误页面
index.html 默认首页
3.configure
./configure --help|more 查看nginx支持哪些参数
三大类
1.set Path 设置nginx目录,如果指定prefixPath,后续目录可以自己生成响应文件夹
2.设置编译哪些模块 通过 with 和without决定添加和移除模块
3.特殊参数配置 ,比如设置debug打印,优化参数 加第三方模块
4.中间文件介绍

./configure --prefix=/home/xx/nginx
config 生成中间文件 放在objs 文件中
ngx_module.c 所有需要编译的nginx模块
5.编译
make
6.安装

首次安装 make install
网友评论