首页 > 其他 > 详细

nginx 编译安装

时间:2021-03-16 11:39:26      阅读:24      评论:0      收藏:0      [点我收藏+]

编译安装nginx

环境:centos7

nginx版本:nginx-1.16.1

依赖安装

yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel  pcre  pcre-devel gd-* patch

创建目录及用户

useradd -s /sbin/nologin nginx

mkdir -p /usr/local/nginx

解包编译

语法:

cd nginx-1.16.1 && ./configure --prefix=安装目录	--模块选项
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module  --user=nginx

make && make install

常用模块

大部分模块都已内置到默认编译选项中,即使编译时不添加也会自动编译进去

模块 作用
ngx_http_core_module 包括一些核心的http参数配置,对应Nginx的配置为HTTP区块部分
ngx_http_access_module 访问控制模块,用来控制网站用户对Nginx的访问
ngx_http_gzip_module 压缩模块,对Nginx返回的数据压缩,属于性能优化模块
ngx_http_fastcgi_module FastCGI模块,和 动态应用相关的模块,例如PHP
ngx_http_proxy_module Proxy代理模块
ngx_http_upstream_module 负载均衡模块,可以实现网站的负载均衡功能及节点的健康检查
ngx_http_rewrite_module URL地址重写模块
ngx_http_limit_conn_module 限制用户并发连接数及请求数模块
ngx_http_limit_req_module 根据定义的key限制Nginx请求过程的速率
ngx_http_log_module 访问日志模块,以指定的格式记录Nginx客户访问日志等信息
ngx_http_auth_basic_module Web认证模块,设置Web用户通过账号、密码访问Nginx
ngx_http_ssl_module ssl模块,用于加密的http连接,如https
ngx_http_stub_status_module 记录Nginx基本访问状态信息等模块
nginx-auth-ldap ldap模块
ngx_http_v2_module 支持http2版本协议
ngx_http_gzip_static_module 预读gzip功能

nginx 编译安装

原文:https://www.cnblogs.com/yhy223/p/14542144.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!