编译安装nginx

本文介绍了在CentOS8.2操作系统中如何编译安装Nginx,包括安装必要的依赖组件如gcc、pcre等,并提到了创建Nginx用户以提升权限的操作。
摘要由CSDN通过智能技术生成

安装nginx和编译安装,环境是centos8.2

  1. 准备软件包,这里重点是二进制编译安装。
  2. yum -y install gcc gcc-c++ make automake autoconf pcre pcre-devel zlib zlib-devel openssl openssl-devel 这一步是安装所必须的组件,目的是编译所需
# wget http://nginx.org/download/nginx-1.20.2.tar.gz
# tar -xf nginx-1.20.2.tar.gz
# cd nginx-1.20.2/
# ./configure --prefix=/apps/nginx \
> --user=nginx \
> --group=nginx \
> --with-http_ssl_module \
> --with-http_v2_module \
> --with-http_realip_module \
> --with-http_stub_status_module \
> --with-http_gzip_static_module \
> --with-pcre \
> --with-stream \
> --with-stream_ssl_module \
> --with-stream_realip_module
#后面跟上所需的模块要什么功能就跟什么,一般情况下跟上必备的就够用了
http核心模块相关配置ngx_http_core_module
访问控制模块ngx_http_access_module
用户认证模块ngx_http_auth_basic_module
状态查看模块ngx_http_stub_status_module
日志记录模块ngx_http_log_module
压缩相关选项ngx_http_gzip_module
https模块ngx_http_ssl_module模块
 重定向模块
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值