憧憬博客Nginx到Tengine的迁移
憧憬博客Nginx到Tengine的迁移
Tengine
是由淘宝网发起的 Web
服务器项目。它在 Nginx
的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。据说 Tengine
的 IO
性能比 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;
- 微信快速开发框架(六)-- 微信快速开发框架(WXPP QuickFramework)V2.0版本上线--源码已更新至github
- 数据结构之数组
- Android资源动态加载以及相关原理分析
- 微信快速开发框架(七)--发送客服信息,版本更新至V2.2 代码已更新至github
- 微信快速开发框架(八)-- V2.3--增加语音识别及网页获取用户信息,代码已更新至Github
- 微信公众平台快速开发框架 For Core 2.0 beta –JCSoft.WX.Core 5.2.0 beta发布
- Android系统层Watchdog机制源码分析
- 算法之插入排序
- Android Studio环境下搭建ReactNative
- Android实现两个ScrollView互相联动,同步滚动的效果
- 一个可以拖动的自定义Gridview代码
- android图片加载库Glide
- 密码最短长度为7,其中必须包含以下非字母数字字符1 完美解决方案
- android开发性能分析
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- CentOS7使用dnf安装mysql的方法
- Linux中crontab定时任务不执行的原因
- Linux系统为什么要吃掉我的“内存”
- 教你如何修改Linux远程登录欢迎提示信息
- 详解linux 定时任务 crontabs 安装及使用方法
- 解决Centos7安装nginx后提示“Welcome to nginx on Fedora!”,conf.d目录下无default.conf文件
- 详解Linux中PostgreSQL和PostGIS的安装和使用
- 检测ip和port是否可连接的方法
- Linux关机时执行指定脚本功能实现
- 适用于稀疏的嵌入、独热编码数据的损失函数回顾和PyTorch实现
- CentOS7下实现终端输入中文设置详解
- CentOS 7.2搭建VNC远程桌面服务的方法
- Ubuntu挂载3T硬盘或大于2T磁盘的方法
- linux chroot命令详解
- Linux中如何查询运行文件的全路径的方法