源码包编译nginx, 编译tengine

源码包编译安装nginx

yum -y install epel-release wget
1、安装编译环境
yum -y install gcc gcc-c++
2、安装pcre软件包(使nginx支持http rewrite模块)
yum install -y pcre pcre-devel gd-devel
3、安装openssl-devel(使nginx支持ssl)
yum install -y openssl openssl-devel
4、安装zlib
yum install -y zlib zlib-devel
5、创建用户nginx
useradd nginx
passwd nginx
6.安装nginx
wget http://nginx.org/download/nginx-1.16.0.tar.gz
tar xzf nginx-1.16.0.tar.gz -C /usr/local/
cd /usr/local/nginx-1.16.0/
./configure --prefix=/usr/local/nginx --group=nginx --user=nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/tmp/nginx/client_body --http-proxy-temp-path=/tmp/nginx/proxy --http-fastcgi-temp-path=/tmp/nginx/fastcgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre --with-http_realip_module --with-stream --add-module=/usr/local/ngx_req_status-master --add-module=/usr/local/nginx_upstream_check_module-master/
编译
make && make install
7.查看 nginx 安装的模块
/usr/local/nginx/sbin/nginx -V
8.检测nginx配置文件是否正确
/usr/local/nginx/sbin/nginx -t
mkdir -p /tmp/nginx
9.启动nginx服务
/usr/local/nginx/sbin/nginx

tengine源码安装nginx模块

1.安装编译环境
yum -y install wget pcre pcre-devel openssl openssl-devel gcc gcc-c++ zlib zlib-devel patch.x86_64 unzip
2.下载模块包
wget https://github.com/zls0424/ngx_req_status/archive/master.zip -O ngx_req_status.zip

wget https://tengine.taobao.org/download/tengine-2.3.2.tar.gz
3.解压软件包
unzip ngx_req_status.zip -d /usr/local/
tar -xf tengine-2.3.2.tar.gz
4.编译安装
cd tengine-2.3.2
patch -p1 < …/ngx_req_status-master/write_filter-1.7.11.patch
./configure --prefix=/usr/local/nginx --group=nginx --user

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值