Tengine编译记录,tengine编译


以前一直使用apache进行服务器部署,从未考虑过什么,直到最近我发现了一个东西,nginx,这个东西引发了我的兴趣,容易的扩展和强大的性能吸引着我去一探究竟。
我选择了淘宝的开源项目Tengine 因为我比较信任能抗住双十一这种并发级别的能力。
废话不多说,上主菜。

/××
×环境CentOS7.0 64位 
×/

首先下载必要的支持包

tengine
http://tengine.taobao.org/download/tengine-2.0.3.tar.gz
pcre-8.32
http://jaist.dl.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.zip
openssl-1.0.1g
https://www.openssl.org/source/openssl-1.0.2j.tar.gz
nginx-hmux-module-1.3
https://github.com/wangbin579/nginx-hmux-module.git
nginx_tcp_proxy_module-0.4.5 
https://github.com/yaoweibin/nginx_tcp_proxy_module.git
nginx_cache_purge-2.3
http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz
需要自行确定是使用wget还是git clone

依赖库下载
yum install gc gcc gcc-c++ pcre-devel zlib-devel make wgetopenssl openssl-devel ncurses ncurses-develibxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools gperftools-devel libatomic_ops-devel perl-ExtUtils-Embed dpkg-dev libpcrecpp0 libgd2-xpm-dev libgeoip-dev libperl-dev lua-devel libxslt-devel libxml2 libxml2-dev geoip-devel geoip libatomic_ops libatomic_ops-devel openssl openssl-devel gd gd-devel libunwind-devel libunwind -y

nginx所需依赖库十分多,我甚至多安装了一个gperftools来保证依赖库,我甚至已经忘了我到底用的什么依赖库了,先全列上去保证能编译,之后我再删除多余的库

为了可以使用tcp代理,我们需要下载主角Tengine 然后下载nginx_tcp_proxy_module-0.4.5 解压后在tengine目录中打入补丁

patch -p1 < ../nginx_tcp_proxy_module-master/tcp.patch

确认以上所有支持库都下载并解压好后,进入Tengine的主目录准备编译

./configure --prefix=/usr/local/nginx \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid \
--error-log-path=/data/logs/nginx/error.log \
--http-log-path=/data/logs/nginx/access.log \
--user=nobody \
--group=nogroup \
--with-pcre=../pcre-8.32 \
--with-pcre-opt=-fPIC \
--with-openssl=../openssl-1.0.1g \
--with-openssl-opt=-fPIC \
--with-backtrace_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_concat_module=shared \
--with-http_sysguard_module=shared \
--with-http_limit_conn_module=shared \
--with-http_limit_req_module=shared \
--with-http_split_clients_module=shared \
--with-http_footer_filter_module=shared \
--with-http_geoip_module=shared \
--with-http_sub_module=shared \
--with-http_access_module=shared \
--with-http_upstream_ip_hash_module=shared \
--with-http_upstream_least_conn_module=shared \
--with-http_referer_module=shared \
--with-http_rewrite_module=shared \
--with-http_memcached_module=shared \
--with-http_upstream_session_sticky_module=shared \
--with-http_addition_module=shared \
--with-http_xslt_module=shared \
--with-http_image_filter_module=shared \
--with-http_user_agent_module=shared \
--with-http_empty_gif_module=shared \
--with-http_browser_module=shared \
--with-google_perftools_module \
--with-http_map_module=shared \
--with-http_userid_filter_module=shared \
--with-http_charset_filter_module=shared \
--with-http_trim_filter_module=shared \
--with-http_lua_module=shared \
--without-http_fastcgi_module \
--without-http_uwsgi_module \
--without-http_scgi_module \
--without-select_module \
--without-poll_module \
--add-module=../nginx-hmux-module-1.3 \
--add-module=../nginx_tcp_proxy_module-0.4.5 \
--with-ld-opt='-ltcmalloc_minimal' \
--http-client-body-temp-path=/data/nginx_temp/nginx_client \
--http-proxy-temp-path=/data/nginx_temp/nginx_proxy \
--http-fastcgi-temp-path=/data/nginx_temp/nginx_fastcgi

编译完成后make test检查是否有错误,无则直接make && make install
享受nginx带来的便利吧,nginx的使用记录我之后体验过后写

如果有错误请指出

相关内容

    暂无相关文章