Tengine做为阿里巴巴对nginx的分支,在国内外都有很高的声誉,其对nginx的一些功能扩展很是不错,好比jemalloc内存管理和lua语言支持,因此笔者准备在开发环境下使用。linux
下载tengine-2.1.1,pcre-8.3.7,jemalloc
注意,请下载pcre而不是pcre2,二者是彻底不一样的。
还须要一个autoconf来让jemalloc可以生成configure文件,直接下载autoconfnginx
./configure make & make install
进入tengine目录,而后输入如下命令git
./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上才有用的github
最新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最后面dom
- && ./config --prefix=/path/to no-shared no-threads \ + && ./Configure --prefix=/path/to no-shared no-threads darwin64-x86_64-cc \
记录具体 configure 参数lua
./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