tengine安装与配置(如果提示类似zlib或openssl或pcre找不到往下看)

tengine是淘宝基于nginx的优化版本。

看淘宝的业务量,你就知道个东西不错。

下载包,如下图:

./configure --prefix=/usr/local/Tengine --pid-path=/var/run/nginx.pid --with-poll_module --without-dso --with-http_concat_module --with-pcre=/mnt/software/pcre-8.37 --with-openssl=/mnt/software/openssl-0.9.8zf --with-zlib=/mnt/software/zlib-1.2.8 --with-jemalloc=/mnt/software/jemalloc-3.5.1 --http-proxy-temp-path=/var/tmp/Tengine/proxy_temp --http-fastcgi-temp-path=/var/tmp/Tengine/fastcgi_temp --http-uwsgi-temp-path=/var/tmp/Tengine/uwsgi_temp --http-scgi-temp-path=/var/tmp/Tengine/cgi_temp --http-client-body-temp-path=/var/tmp/Tengine/client_body_temp --http-log-path=/var/log/Tengine/access.log --error-log-path=/var/log/Tengine/error.log
注意:pcre,zlib,openssl,jemalloc都需要指定到源码包里,而不是安装的位置(不需要安装他们)

接着make && make install

配置:

sendfile    on;
    tcp_nopush  on;
    tcp_nodelay on;
 
    keepalive_timeout 65;
 
    client_max_body_size 10M;    # 该值需要大于最大允许上传文件大小的值
 
   
 
    # 开启 GZIP 压缩 #
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_vary on;
    gzip_types text/plain text/css text/javascript application/x-javascript application/javascript text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml application/xml-dtd;
 
    proxy_connect_timeout 60;
    proxy_read_timeout 60;
    proxy_send_timeout 30;
    proxy_buffer_size 16k;
    proxy_buffers 4 64k;
    proxy_busy_buffers_size 128k;
    proxy_temp_file_write_size 128k;
    proxy_temp_path /var/tmp/Tengine/proxy_temp_dir;
    proxy_cache_path /var/tmp/Tengine/proxy_cache levels=1:2 keys_zone=key:2m inactive=1d max_size=1g;
 
    ssi on;
    ssi_silent_errors off;
 
    log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';
 
    access_log  /var/log/Tengine/access.log  access;
另外如果要合并js或css,需要这样配置:

location ~ /style/ {
			concat on; #启用合并
			concat_max_files 20; #最多合并的文件数
			concat_types application/javascript text/css;
		}




草木全
分享到:

安装的是源码包的位置,不知道的还真以为是安装到的位置。


0
共 1 条   当前1/1页

© 2014 究问社区 copyRight 豫ICP备13003319号-1