Tengine编译安装,


背景

Tengine作为阿里巴巴对nginx的分支,在国内外都有很高的声誉,其对nginx的一些功能扩展非常不错,比如jemalloc内存管理和lua语言支持,所以笔者准备在开发环境下使用。

准备

下载tengine-2.1.1,pcre-8.3.7,jemalloc
注意,请下载pcre而不是pcre2,两者是完全不同的。
还需要一个autoconf来让jemalloc能够生成configure文件,直接下载autoconf

./configure
make & make install

编译

进入tengine目录,然后输入以下命令

./configure --user=www-data --group=www-data --with-file-aio --with-ipv6 --with-mail --with-mail_ssl_module --with-pcre=/path/to --with-jemalloc=/path/to
make
make install

注:/path/to指向pcre和jemalloc的源代码目录。
--with-file-aio是只有在linux上才有用的


最新openssl推出的1.0.2更新,明确指出了openssl0.9.8和1.0.0版本已经不再维护,所以OS X编译安装openssl的时候必须自行下载openssl1.0.2的源代码然后自行编译,tengine可以通过--with-openssl命令指定openssl源代码目录,但是tengine只是通过makefile调用./config --prefix=/path/to no-shared no-threads命令来编译openssl,openssl本身在OS X下编译是有问题的,不能使用./config命令配置,必须通过./Configure darwin64-x86_64-cc手动配置,所以想要tengine使用x64的库必须手工修改objs/Makefile最后面

- && ./config --prefix=/path/to no-shared  no-threads \
+ && ./Configure --prefix=/path/to no-shared  no-threads darwin64-x86_64-cc \

记录具体 configure 参数

./configure --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_spdy_module --with-http_v2_module --with-http_realip_module --with-http_addition_module=shared --with-http_sub_module=shared --with-http_dav_module --with-http_flv_module=shared --with-http_slice_module=shared --with-http_mp4_module=shared --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_concat_module=shared --with-http_random_index_module=shared --with-http_secure_link_module=shared --with-http_degradation_module --with-http_sysguard_module=shared --with-http_dyups_module --with-mail --with-mail_ssl_module --with-jemalloc

相关内容

    暂无相关文章