CentOS 7上源码安装Tengine-2.3.2

CentOS 7上源码安装Tengine-2.3.2
Tengine是由互联网巨头淘宝发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。它的性能和稳定性已经在很多大型网站上得到了检验,比如淘宝,天猫等。Tengine不仅开源,而且团队核心成员都来自于淘宝、搜狗等互联网大厂。有着强大的互联网大厂支持和技术团队维护,而且经过多年的实践检验,我们可以放心的使用。下面将介绍如何在CentOS7安装Tengine,步骤如下:

编译工具&依赖库安装

[root@localhost ~]#  yum install gcc-c++
[root@localhost ~]#  yum install pcre
[root@localhost ~]#  yum install pcre-devel
[root@localhost ~]#  yum install pcre
[root@localhost ~]#  yum install zlib
[root@localhost ~]#  yum install zlib-devel
[root@localhost ~]#  yum install openssl
[root@localhost ~]#  yum install openssl-devel

Tengine 下载&解压安装

[root@localhost ~]# wget http://tengine.taobao.org/download/tengine-2.3.2.tar.gz
[root@localhost ~]# tar -zxvf tengine-2.3.2.tar.gz
[root@localhost ~]# cd tengine-2.3.2

Tengine 编译&安装

[root@localhost tengine-2.3.2]#  ./configure
[root@localhost tengine-2.3.2]#  make
[root@localhost tengine-2.3.2]#  sudo make install

说明:默认情况下,tengine会被安装到/usr/local/nginx目录下

Tengine 目录说明

[root@localhost tengine-2.3.2]# cd /usr/local/nginx
[root@localhost nginx]# tree -d
.
├── conf  //配置文件目录
├── html  //静态网页文件目录
├── logs  //日志文件目录
└── sbin  //可执行文件目录

Tengine 启动&测试

[root@localhost tengine-2.3.2]# cd /usr/local/nginx/sbin
[root@localhost sbin]# ./nginx

然后使用浏览器访问测试

http://192.168.100.100

如果看到如下页面,说明安装成功
tengine-index-page

Tengine 安装常见错误

1、如果出现如下错误提示,说明系统中没有安装gcc编译工具,我们只需要安装gcc-c++即可,

[root@localhost tengine-2.3.2]# ./configure 
checking for OS
 + Linux 3.10.0-957.27.2.el7.x86_64 x86_64
checking for C compiler ... not found

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

解决办法:

[root@localhost tengine-2.3.2]# yum install gcc-c++

2、如果出现如下提示,表示缺少PCRE库:

[root@localhost tengine-2.3.2]# ./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.

解决办法:

[root@localhost tengine-2.3.2]#  yum install pcre
[root@localhost tengine-2.3.2]#  yum install pcre-devel

3、如果出现如下提示,表示缺少zlib库:

[root@localhost tengine-2.3.2]# ./configure 
./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.

解决办法:

[root@localhost tengine-2.3.2]# yum install zlib 
[root@localhost tengine-2.3.2]# yum install zlib-devel

the end

热门文章