憧憬博客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月前
|
tengine 安全 应用服务中间件
修改Nginx/Tengine版本名称伪装任意WEB SERVER
修改Nginx/Tengine版本名称伪装任意WEB SERVER
|
2月前
|
tengine 应用服务中间件 nginx
既然Tengine比Nginx更强大,为什么Tengine没有取代Nginx呢?
既然Tengine比Nginx更强大,为什么Tengine没有取代Nginx呢?
49 0
|
10月前
|
tengine 移动开发 网络协议
Nginx之Tengine主动健康检查解读
Nginx之Tengine主动健康检查解读
|
10月前
|
tengine 应用服务中间件 Linux
【Linux环境】如何在Nginx(或Tengine)服务器上安装ssl证书----介绍nginx服务器类型证书的下载与安装操作
【Linux环境】如何在Nginx(或Tengine)服务器上安装ssl证书----介绍nginx服务器类型证书的下载与安装操作
422 0
|
3月前
|
tengine 应用服务中间件 nginx
Tengine有没有非开源的支持nginx的steam quic协议?
【1月更文挑战第15天】【1月更文挑战第75篇】Tengine有没有非开源的支持nginx的steam quic协议?
70 10
|
7天前
|
负载均衡 应用服务中间件 API
Nginx:location配置模块的用法(一)
Nginx:location配置模块的用法(一)
51 2
|
4天前
|
Web App开发 应用服务中间件 网络安全
如何在 Apache 和 Nginx 上配置 OCSP Stapling
如何在 Apache 和 Nginx 上配置 OCSP Stapling
21 8
|
4天前
|
jenkins 应用服务中间件 持续交付
如何配置 Nginx 作为 Jenkins 的反向代理并启用 SSL 加密
如何配置 Nginx 作为 Jenkins 的反向代理并启用 SSL 加密
22 8
|
4天前
|
存储 Ubuntu 应用服务中间件
如何在 Ubuntu VPS 上配置 Nginx 的日志记录和日志轮转
如何在 Ubuntu VPS 上配置 Nginx 的日志记录和日志轮转
10 4
|
3天前
|
负载均衡 应用服务中间件 网络安全
NGINX配置详解
NGINX配置详解