# 介绍
Tengine 的性能和稳定性已经在大型的网站如淘宝网,天猫商城等得到了很好的检验。它的最终目标是打造一个高效、稳定、安全、易用的 Web 平台。从 2011 年 12 月开始,Tengine 成为一个开源项目。现在,它由 Tengine 团队开发和维护。Tengine 团队的核心成员来自于淘宝、搜狗等互联网企业。
tengine 简单来说就是淘宝自己基于 nginx 优化的网页引擎,在 nginx 原先基础上继续保持兼容,同时功能扩展,效率提高,可以看到目前淘宝网在这么多人同时使用的情况下依然稳定,我们足以相信 tengine,由于它是 nginx 的一个分生版本,所以几乎完全兼容 nginx,所以我认为 tengine 是搭建 lnmp 环境的不二之选。
# 下载
首先访问 tengine 官方网站,获取最新的下载地址。wget http://tengine.taobao.org/download/tengine-2.3.3.tar.gz
# 获取编译参数
nginx -V
# 编译
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_gzip_static_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_uwsgi_module --without-http_scgi_module
./configure 后面的参数是上一步获取的
# Make
make 或者 make -j 内核数
生成的文件在 objs 目录下
# 替换
停止 nginx 服务 service nginx stop
查看 nginx 目录 whereis nginx
备份旧 nginx mv /usr/sbin/nginx /usr/sbin/nginx.old
拷贝 objs 下的 nginx 替换旧 nginx cp ./objs/nginx /usr/sbin/
备份旧 so 文件
拷贝 objs 下的 so 文件替换旧的 so 文件 cp ./objs/*.so /usr/lib/nginx/modules/
# 测试
nginx -t
如果打印 test is successful 则表示替换成功。
然后执行 service nginx start 进行启动即可