tengine简单安装_tengine安装指南,关于WEB容器&#x
tengine简单安装_tengine安装指南,关于WEB容器
tengine安装指南
之前小站一直跑在tomcat之上,外层并无其它WEB容器,最近一直想在servlet容器前在挂上一个web容器试试,看看是不是真的在处理静态文件上更有优势。关于WEB容器,选用的是我厂nginx分支tengine。由于之前从来没有安装过这类玩意儿,装的过程中特意记录一下安装步骤,以供有需要的朋友参考。
我的安装方法是缺少什么就去下载安装什么的方式进行的,事后总结起来,安装tengine在我的机器上需要以下依赖:tengine,zlib-dev,openssl,pcre,c++编译环境。除了用yum直接安装外,部分组件的下载地址如下:http://tengine.taobao.org/download/tengine-2.0.3.tar.gz
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
http://www.openssl.org/source/openssl-1.0.1g.tar.gz
yum install zlib-devel
yum install -y gcc gcc-c++
如果上述地址无效,请去官网查询最新的下载地址。将上述所需要的安装组件解压、环境准备好之后,就可以执行以下命令进行安装tengine了:./configure --prefix=/usr/local/nginx --with-http_stub_status_module
--with-pcre=/tmp/tengine-2.0.1/pcre-8.35
--with-openssl=/tmp/tengine-2.0.1/openssl/openssl-1.0.1g
需要注意的是上面的命令中的后两个参数均为相关组件的源码目录。
以下为我的安装过程:
从官网下载tengine到服务器上,我下载的版本是tengine-2.0.1.tar.gz 并直接解压安装[root@xxx tmp]# wget http://tengine.taobao.org/download/tengine-2.0.3.tar.gz
--2014-05-31 16:51:47-- http://tengine.taobao.org/download/tengine-2.0.3.tar.gz
正在解析主机 tengine.taobao.org... 42.121.104.170
正在连接 tengine.taobao.org|42.121.104.170|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1564187 (1.5M) [application/octet-stream]
正在保存至: “tengine-2.0.3.tar.gz”
结果发现有依赖pcre,于是又去下载pcre.我下载的版本是pcre-8.35:[root@xxx tengine-2.0.1]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
--2014-05-29 23:13:33-- ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
=> “pcre-8.35.tar.gz”
正在解析主机 ftp.csx.cam.ac.uk... 131.111.8.115
正在连接 ftp.csx.cam.ac.uk|131.111.8.115|:21... 已连接。
正在以 anonymous 登录 ... 登录成功!
接下来编译一下pcre发现需要c++环境,如下:checking windows.h presence... no
checking for windows.h... no
configure: error: You need a C++ compiler for C++ support.
于是又安装C++环境,如下操作开始安装C++编译环境:[root@xxxx pcre-8.35]# yum install -y gcc gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror-centos.hostingswift.com
* extras: centos-distro.cavecreek.net
* updates: centos.mirror.lstn.net
Setting up Install Process
Package gcc-4.4.7-4.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: libstdc++-devel = 4.4.7-4.el6 for package: gcc-c++-4.4.7-4.el6.x86_64
--> Running transaction check
---> Package libstdc++-devel.x86_64 0:4.4.7-4.el6 will be installed
--> Finished Dependency Resolution
折腾好C++编译环境,我又顺便下载了最新版本的OPENSSL装上,之后又开始安装tengine了,如下所示[root@xxx openssl]# wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
--2014-05-29 23:38:05-- http://www.openssl.org/source/openssl-1.0.1g.tar.gz
正在解析主机 www.openssl.org... 185.9.166.106
正在连接 www.openssl.org|185.9.166.106|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:4509047 (4.3M) [application/x-gzip]
正在保存至: “openssl-1.0.1g.tar.gz”[root@xxx tengine-2.0.1]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-pcre=/tmp/tengine-2.0.1/pcre-8.35 --with-openssl=/usr/bin/openssl
./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=option.
结果安装过程中又报缺少zlib依赖,好吧 又开始安装zlib依赖,如下:[root@xxx tengine-2.0.1]# yum install zlib
[root@xxx tengine-2.0.1]# yum install zlib-devel
Loaded plugins: fastestmirror
再次安装tengine,终于成功装上了:Configuration summary
+ using PCRE library: /tmp/tengine-2.0.1/pcre-8.35
+ using OpenSSL library: /tmp/tengine-2.0.1/openssl/openssl-1.0.1g
+ md5: using OpenSSL library
+ sha1: using 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 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 dso module path: "/usr/local/nginx/modules/"
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"
评论暂时关闭