Tengine編譯安裝

背景

Tengine做爲阿里巴巴對nginx的分支,在國內外都有很高的聲譽,其對nginx的一些功能擴展很是不錯,好比jemalloc內存管理和lua語言支持,因此筆者準備在開發環境下使用。linux

準備

下載tengine-2.1.1pcre-8.3.7jemalloc
注意,請下載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
相關文章
相關標籤/搜索