Ningx之二次开发版本编译安装tengine(两个版本)

Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。
官网:

http://tengine.taobao.org

1、编译安装 tengine-2.1.2
注意: 不支持CentOS8
#安装所需软件

[root@centos7 ~]#yum -y install gcc pcre-devel openssl-devel  

#创建一个不登录的账号;

[root@centos7 ~]#useradd -r -s /sbin/nologin nginx 

#切换到src目录,下载并解压tengine-2.1.2

[root@centos7 ~]#cd /usr/local/src
[root@centos7 src]#wget http://tengine.taobao.org/download/tengine-2.1.2.tar.gz
[root@centos7 src]#tar xf tengine-2.1.2.tar.gz

#切换到tengine-2.1.2 开始编译

[root@centos7 src]#cd tengine-2.1.2/
[root@centos7 tengine-2.1.2]#./configure --prefix=/apps/tengine-2.1.2 --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  #这里强烈建议手动输入;
[root@centos7 tengine-2.1.2]#make && make install

编译的脚本在这;
/configure --prefix=/apps/tengine-2.1.2 --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
#建立软链接 并启动nginx

[root@centos7 tengine-2.1.2]#ln -s /apps/tengine-2.1.2/sbin/* /usr/sbin/
[root@centos7 tengine-2.1.2]#nginx -v
[root@centos7 tengine-2.1.2]#nginx
[root@centos7 ~]#ss -tnl  #可以看到80端口启动
ss -tnl

#在网页测试 ,安装已经完成;
在这里插入图片描述
2、在tengine-2.1.2中添加 lua 动态模块
#基于上一小节继续以下操作

[root@centos7 ~]#yum -y install lua-devel
[root@centos7 ~]#cd /usr/local/src/tengine-2.1.2

(以下编译文件还是建议手动输入;)
[root@centos7 tengine-2.1.2]#./configure --prefix=/apps/tengine-2.1.2 --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-http_lua_module=shared

[root@centos7 tengine-2.1.2]#make dso_install
[root@centos7 tengine-2.1.2]#vim /apps/tengine-2.1.2/conf/nginx.conf

在这里插入图片描述

[root@centos7 tengine-2.1.2]#nginx -t
[root@centos7 tengine-2.1.2]#nginx -s reload
[root@centos7 tengine-2.1.2]#nginx -V |& grep share

在这里插入图片描述
3、编译安装 tengine-2.3.2

[root@centos8 ~]#yum -y install gcc pcre-devel openssl-devel
[root@centos8 ~]#useradd -r -s /sbin/nologin nginx
[root@centos8 ~]#cd /usr/local/src
[root@centos8 src]#wget http://tengine.taobao.org/download/tengine-2.3.2.tar.gz
[root@centos8 src]#tar xvf tengine-2.3.2.tar.gz
[root@centos8 src]#cd tengine-2.3.2/
[root@Centos8 tengine-2.3.2]#./configure --prefix=/apps/tengine-2.3.2 --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
[root@centos8 tengine-2.3.2]#make && make install

编译脚本在这;
./configure --prefix=/apps/tengine-2.3.2 --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

执行查看安装结果;
在这里插入图片描述
建立软链接

[root@centos8 tengine-2.3.2]#ln -s /apps/tengine-2.3.2/sbin/* /usr/sbin/

查看版本并启动

[root@centos8 tengine-2.3.2]#nginx -v
Tengine version: Tengine/2.3.2
nginx version: nginx/1.17.3
[root@centos8 tengine-2.3.2]#nginx

在网页测试 安装完成

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值