Tengine can be downloaded at [http://tengine.taobao.org/download/tengine.tar.gz](http://tengine.taobao.org/download/tengine.tar.gz). You can also checkout the latest source code from GitHub at [https://github.com/alibaba/tengine](https://github.com/alibaba/tengine)
To install Tengine, just follow these three steps:
$ ./configure $ make # make install
By default, it will be installed to _/usr/local/nginx_. You can use the __'--prefix'__ option to specify the root directory. If you want to know all the _'configure'_ options, you should run __'./configure --help'__ forhelp. ......
使用./configure命令配置安装目录;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ ./configure --help | more
--helpprint this message
--prefix=PATH set installation prefix --sbin-path=PATH set nginx binary pathname
$ ./configure --prefix=/opt/nginx checking for OS + Linux 5.3.0-45-generic x86_64 checking for C compiler ... not found
./configure: error: C compiler cc is not found
经上面提示未找到C语言编译器, 所以还需要安装GCC
1
$ yum install gcc
再次执行./configure --prefix=/opt/nginx, 结果提示:
1 2 3 4 5 6 7 8 9
...... checking for PCRE library in /usr/include/pcre/ ... not found checking for PCRE library in /usr/pkg/ ... not found checking for PCRE library in /opt/local/ ... not found
./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@490de829cb74 tengine-2.3.2]# yum search pcre Loaded plugins: fastestmirror, ovl Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com =========================================== N/S Matched: pcre =========================================== pcre-devel.i686 : Development files for pcre pcre-devel.x86_64 : Development files for pcre pcre-static.x86_64 : Static library for pcre pcre.i686 : Perl-compatible regular expression library pcre.x86_64 : Perl-compatible regular expression library
Name and summary matches only, use "search all"for everything. [root@490de829cb74 tengine-2.3.2]# yum install pcre-devel Loaded plugins: fastestmirror, ovl Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com Resolving Dependencies --> Running transaction check ---> Package pcre-devel.x86_64 0:7.8-7.el6 will be installed --> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================= Package Arch Version Repository Size ========================================================================================================= Installing: pcre-devel x86_64 7.8-7.el6 base 320 k
Total download size: 320 k Installed size: 957 k Is this ok [y/N]: y Downloading Packages: pcre-devel-7.8-7.el6.x86_64.rpm | 320 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : pcre-devel-7.8-7.el6.x86_64 1/1 Verifying : pcre-devel-7.8-7.el6.x86_64 1/1
Installed: pcre-devel.x86_64 0:7.8-7.el6
Complete!
首先使用yum search寻找pcre库, 发现有多个;
而使用yum install pcre-devel时会自动进行匹配
安装结束再次执行./configure --prefix=/opt/nginx, 结果提示:
1 2 3 4 5
...... ./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.