---恢复内容开始---

据说淘宝的Tengine很牛X,所以我们今天也来玩玩,我们这里是某开放云的vps,现在已经安装好了nginx,现在我们要平滑切换到安装Tengine。

  • 下载Tengine,解压进入文件夹:

wget http://tengine.taobao.org/download/tengine-2.1.0.tar.gz

tar xvfz tengine-2.1.0.tar.gz

cd tengine-2.1.0

  • 查看一下当前的nginx版本:

nginx -V

运行结果如下:

nginx version: nginx/1.6.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
TLS SNI support enabled
configure arguments: –prefix=/etc/nginx –sbin-path=/usr/sbin/nginx –conf-path=/etc/nginx/nginx.conf –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –pid-path=/var/run/nginx.pid –lock-path=/var/run/nginx.lock –http-client-body-temp-path=/var/cache/nginx/client_temp –http-proxy-temp-path=/var/cache/nginx/proxy_temp –http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp –http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp –http-scgi-temp-path=/var/cache/nginx/scgi_temp –user=nginx –group=nginx –with-http_ssl_module –with-http_realip_module –with-http_addition_module –with-http_sub_module –with-http_dav_module –with-http_flv_module –with-http_mp4_module –with-http_gunzip_module –with-http_gzip_static_module –with-http_random_index_module –with-http_secure_link_module –with-http_stub_status_module –with-http_auth_request_module –with-mail –with-mail_ssl_module –with-file-aio –with-ipv6 –with-http_spdy_module –with-cc-opt=’-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables’

然后我们复制一下下面的编译参数 configure arguments:开始一直到最后。

  • 开始编译Tengine,运行代码:

./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables'

结果错误,如下图所示:

./configure: error: C compiler cc is not found

主要是我们系统里面没有C语言,现在补上gcc编译环境:

yum install gcc

重新运行编译命令,依然报错:

./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.

缺少pcre,安装pcre:

yum install pcre-devel

再次编译,结果如下图,缺少openssl:

./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.

 

安装openssl:

yum -y install openssl openssl-devel

再次编译成功,返回:

Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
+ jemalloc library is disabled

nginx path prefix: “/etc/nginx”
nginx binary file: “/usr/sbin/nginx”
nginx configuration prefix: “/etc/nginx”
nginx configuration file: “/etc/nginx/nginx.conf”
nginx pid file: “/var/run/nginx.pid”
nginx error log file: “/var/log/nginx/error.log”
nginx http access log file: “/var/log/nginx/access.log”
nginx http client request body temporary files: “/var/cache/nginx/client_temp”
nginx dso module path: “/etc/nginx/modules/”
nginx http proxy temporary files: “/var/cache/nginx/proxy_temp”
nginx http fastcgi temporary files: “/var/cache/nginx/fastcgi_temp”
nginx http uwsgi temporary files: “/var/cache/nginx/uwsgi_temp”
nginx http scgi temporary files: “/var/cache/nginx/scgi_temp”

MAKE,命令行里直接打make就行了,如下图:

make

make成功,则如下图所示:

  • nginx停止运行:

/etc/init.d/nginx stop

  • 迁移文件:

复制objs目录下的nginx文件到/usr/sbin/nginx目录,覆盖前记得备份原来文件:

cp /usr/sbin/nginx /usr/sbin/nginx.bak
cp objs/nginx /usr/sbin/

  • 测试一下nginx:

nginx -t

the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful

  • 启动nginx服务:

service nginx start

Starting nginx:                                            [  OK  ]

测试Tengine 是否成功:

我们这里输入一个不存在的页面看看报错就知道了,如下图所示:

Tegine 是兼容nginx配置文件的,所以我们原先配置好的东西就不用再麻烦去修改啦。

---恢复内容结束---

centos 下 yum 安装 nginx 平滑切换安装到 Tengine的更多相关文章

  1. centos下redis和nginx软件的安装

    我们这章以redis和nginx软件为例,介绍一下centos下软件的安装. 需要软件包(可以先下载好复制到centos指定目录下,也可直接用wget命令获取): nginx-1.7.9.tar re ...

  2. centos 下yum 安装nginx

    centos 下yum 安装nginx 1. 直接yum install nginx不行,要先处理下源: rpm -ivh http://nginx.org/packages/centos/6/noa ...

  3. centos下yum安装lamp和lnmp轻松搞定

    centos下yum安装lamp和lnmp轻松搞定.究竟多轻松你看就知道了.妈妈再也不操心不会装lamp了. 非常辛苦整理的安装方法,会持续更新下去.凡无法安装的在评论里贴出问题来,会尽快解决.共同维 ...

  4. centOS下yum安装配置samba

     centOS下yum安装配置samba 2010-03-29 15:46:00 标签:samba yum centOS 安装 休闲 注意:本文的原则是只将文件共享应用于内网服务器,并让将要被共享的目 ...

  5. centos下yum安装crontab+mysql自动备份

    参考博文: centos下yum安装crontab yum install vixie-cron crontabs      //安装 chkconfig crond on               ...

  6. centos下 yum安装ngix

    1.CentOS 6,先执行:rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6. ...

  7. [转载]centos下yum安装samba及配置

    centos下yum安装samba及配置 在我们使用 Windows 作为客户机的时候,通常有文件.打印共享的需求.作为Windows 网络功能之一,通常可以在 Windows 客户机之间通过Wind ...

  8. CentOS下Docker与.netcore(一) 之 安装

    CentOS下Docker与.netcore(一) 之 安装 CentOS下Docker与.netcore(二) 之 Dockerfile CentOS下Docker与.netcore(三)之 三剑客 ...

  9. CentOS下yum命令详解

    CentOS下yum命令详解 Yum: 即Yellowdog Update Modifier,是一种基于rpm的包管理工具 yum命令使用示例 显示yum仓库 显示所有仓库 yum repolist ...

随机推荐

  1. Vim 的补全模式加速器,轻松玩转全部 15 种自动补全模式

    1. 关于 Vim 补全模式    ---- Vim 一共提供了 15 种自动补全的模式(:help ins-completion).其中有两种的补全列表内容与另外两种相同,只是排序不同,这 15 种 ...

  2. Navicate DataModel 注册码

    注册信息: 姓    名:ttrar.com 组    织:(空) 序列号:NAVD-6CLM-6BKA-5TXK 内容来自: 可视化数据库设计工具(Navicat Data Modeler)1.0. ...

  3. SqlServer2005安装错误解决方法

    前段时间在安装数据库SQL Server2005时,在系统检测这一步计算机报了一个错误,提示“性能监视器计数要求(错误)”,使得安装无法继续进行,于是在网上找了些方法来解决,其中有一个方法最有效,在这 ...

  4. .net 文件操作

    一.DotNet文件目录常用操作: DiveInfo:提供了对逻辑磁盘的基本信息访问的途径.(只能查看信息,不能做任何修改.) System.Environment:用来枚举驱动器.(不能获取驱动器的 ...

  5. -exec和|xargs

    注意xargs会被空格割裂,所以遇到带有空格的文件名就不好办了,解决方法是使用-print0 例如:删除.目录下30天之前的.png文件 -type f -name rm 或者使用-exec:删除.目 ...

  6. Webbrowers控件的小技巧

    我最近接触webbrowers 这个控件比较多,感觉用起来比较顺手吧.可以做很多操作. 貌似很多网络模拟有时候都内置这个控件或者类似的控件,但这样子速度就不能跟那些单纯用API 构建数据包比了. 我一 ...

  7. Java 三大主流框架概述

    Struts.Hibernate和Spring是我们Java开发中的常用关键,他们分别针对不同的应用场景给出最合适的解决方案.但你是否知道,这些知名框架最初是怎样产生的? 我们知道,传统的Java W ...

  8. javascript Date类型 学习笔记

    1 创建一个新的日期对象,如果不带参数,则对象自动获得当前的日期和时间 var d = new Date() 2 如果需要指定特定的日期,则可以通过Date.parse() 或者 Date().UTC ...

  9. Mysql的联合查询

    联合查询 union联合查询 语法:     select 语句 union [all|distinct] select 语句; 示例: 特点:     条件:两表的查询出来的字段数目必须相同     ...

  10. ubuntu lua安装

    #解压 tar -xzvf lua5.2.2.tar.gz #进入lua5.2.2文件夹 cd lua5.2.2 #执行make sudo make linux #提示如下错误: #lua.c:67: ...