编译工具&依赖库安装
[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 安装常见错误
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