憧憬博客Nginx到Tengine的迁移

简介: 憧憬博客Nginx到Tengine的迁移

憧憬博客Nginx到Tengine的迁移

Tengine 是由淘宝网发起的 Web 服务器项目。它在 Nginx 的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。据说 TengineIO 性能比 Nginx 提升了几十倍、淘宝流量高峰全靠 Tengine 应对。

一直在网上听说 Tengine 优秀的性能,淘宝自家都使用的 web server,其稳定性和性能已经在淘宝网,天猫商城等得到了很好的检验。这个时候博主好奇心就来了,非得把博客的 Nginx 迁移到 Tengine 不可,小小体验一下 Tengine

这里就记录一下迁移记录,其实迁移很简单,Tengine基本上继承 Nginx 的所有特性,兼容 Nginx 的配置,所以在迁移上并没花多少时间。

  • 文档资料

http://tengine.taobao.org/document/install.html

https://github.com/alibaba/tengine

安装

wget http://tengine.taobao.org/download/tengine-2.3.2.tar.gz
tar -zxvf tengine-2.3.2.tar.gz
./configure
  • 出错了呀
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
apt-get install libpcre3 libpcre3-dev
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
apt-get install openssl libssl-dev
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
apt-get install zlib1g-dev

找这个 zlib 库的时候比较有意思, zlib 这个包直接安装但是不清楚包名,编译安装下载资源 Not Found,然后看到一个解决问题的思路觉得挺好, 分享给大家:

zlib 的官网打不开, apt-get insatll zlib 也找不到软件包,貌似不在软件源里?解决方法是打开 ubuntu software center ,搜索 zlib ,找到 zlib1g-dev 这个包,安装成功。 有些软件包的名字无法确定,可以借助 ubuntu software center 来确定其有效名字,

# 成功弄好配置项 这里的话如果有需要其他模块的 和 nginx是一样的,Tengine 特有的就直接上官网翻资料就可以
./configure
Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + using system zlib library
  + jemalloc library is disabled
  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
make

迁移

配置脚本选项大多数选项与Nginx兼容。文档有些Tengine的特定选项,可以查看

默认安装路径 /usr/local/nginx/

因为他直接兼容 nginx,所以我直接把原来的站点引入过来 放入到配置文件

  • vi /usr/local/nginx/conf/nginx.conf
include /etc/nginx/sites-enabled/*;
  • sbin/nginx -t
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/sites-enabled/default:67
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
  • 这里在检测配置的时候有个警告,看了一下 ssl 指令废弃了,如果使用 listen 443 ssl,删除 ssl on 就行了。
listen 443 ssl;
server_name aoppp.com;
#ssl on;


目录
相关文章
|
2月前
|
应用服务中间件 Linux PHP
Linux搭建tengine2.0<Nginx>+php7环境
本文介绍了在Linux系统上搭建Tengine 2.0(一个Nginx的增强版本)和PHP 7环境的详细步骤,包括创建安装目录、下载源码包及依赖库、编译安装Nginx、配置Nginx、安装PHP及其依赖、设置PHP-FPM、配置环境变量、安装Git和Composer,以及服务管理和日志查看等。
61 0
|
4月前
|
tengine 安全 应用服务中间件
修改Nginx/Tengine版本名称伪装任意WEB SERVER
修改Nginx/Tengine版本名称伪装任意WEB SERVER
|
4月前
|
tengine 应用服务中间件 nginx
既然Tengine比Nginx更强大,为什么Tengine没有取代Nginx呢?
既然Tengine比Nginx更强大,为什么Tengine没有取代Nginx呢?
109 0
|
12月前
|
tengine 移动开发 网络协议
Nginx之Tengine主动健康检查解读
Nginx之Tengine主动健康检查解读
|
5月前
|
tengine 应用服务中间件 nginx
Tengine有没有非开源的支持nginx的steam quic协议?
【1月更文挑战第15天】【1月更文挑战第75篇】Tengine有没有非开源的支持nginx的steam quic协议?
94 10
|
16天前
|
缓存 前端开发 JavaScript
终极 Nginx 配置指南(全网最详细)
本文详细介绍了Nginx配置文件`nginx.conf`的基本结构及其优化方法。首先通过删除注释简化了原始配置,使其更易理解。接着,文章将`nginx.conf`分为全局块、events块和http块三部分进行详细解析,帮助读者更好地掌握其功能与配置。此外,还介绍了如何通过简单修改实现网站上线,并提供了Nginx的优化技巧,包括解决前端History模式下的404问题、配置反向代理、开启gzip压缩、设置维护页面、在同一IP上部署多个网站以及实现动静分离等。最后,附上了Nginx的基础命令,如安装、启动、重启和关闭等操作,方便读者实践应用。
206 84
终极 Nginx 配置指南(全网最详细)
|
5天前
|
JavaScript 应用服务中间件 开发工具
vue尚品汇商城项目-day07【53.nginx反向代理配置】
vue尚品汇商城项目-day07【53.nginx反向代理配置】
16 4
|
5天前
|
缓存 应用服务中间件 nginx
nginx如何配置?配置项都是什么意思?
nginx如何配置?配置项都是什么意思?
16 1
|
8天前
|
应用服务中间件 nginx Docker
docker应用部署---nginx部署的配置
这篇文章介绍了如何使用Docker部署Nginx服务器,包括搜索和拉取Nginx镜像、创建容器并设置端口映射和目录映射,以及如何创建一个测试页面并使用外部机器访问Nginx服务器。
|
2月前
|
应用服务中间件 nginx Docker
本地通过域名访问虚拟机上nginx的服务、搭建域名访问环境一(反向代理配置)
这篇文章介绍了如何通过域名在本地访问虚拟机上的nginx服务,包括创建nginx容器、修改配置文件、修改本地host文件以及进行访问测试的详细步骤。文章提供了具体的Docker命令来创建并配置nginx容器,展示了配置文件的修改示例,说明了如何在本地系统的hosts文件中添加虚拟机IP和自定义域名,以及如何通过浏览器进行测试访问。
本地通过域名访问虚拟机上nginx的服务、搭建域名访问环境一(反向代理配置)
下一篇
无影云桌面