ann
          冰是沒有未來的,因為它的永恒
          posts - 107,comments - 34,trackbacks - 0

          1. 下載
              1). nginx0.8.2.26
                  wget http://sysoev.ru/nginx/nginx-0.8.26.tar.gz
             
              2). nginx / cache_purge patch
                  wget http://labs.frickle.com/files/nginx-0.8.26-cache_purge-1.0.patch

          2.解壓 nginx
                 sudo tar -zxvf nginx-0.8.26.tar.gz

          3. patch
             cd nginx-0.8.26
             sudo patch -p1 < ../nginx-0.8.26-cache_purge-1.0.patch

          4. 編譯
             1). 添加configure.sh
             
          #! /bin/bash
          VERSION=0.8.26
          NAME
          =nginx
          ./configure --prefix=/usr/local/$NAME --sbin-path=/usr/local/sbin/$NAME.$VERSION --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.8.x.pid --http-log-path=/var/log/nginx/8.x.access.log --error-log-path=/var/log/nginx/8.x.error.log  --user=nginx --group=nginx --with-openssl=/usr/lib/ssl/  --with-http_stub_status_module --with-http_flv_module --with-http_sub_module
             2). 修改configure 權限
                sudo chmod 755 configure
             3)sudo ./configure.sh
             4)sudo make
             5)sudo make install

          5. nginx-test.conf
            
          user www-data;
          worker_processes  
          1;

          error_log  
          /data/nginx_log/8.26.error-test.log;
          #master_process  off;
          #daemon          off; 

          #error_log  logs/error.log  notice;
          #error_log  logs/error.log  info;

          pid      /var/run/nginx-test.pid;


          events {
              worker_connections  
          1024;
          }


          http {
              include       mime
          .types;
              default_type  application
          /octet-stream;

              
          #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
              #                  '$status $body_bytes_sent "$http_referer" '
              #                  '"$http_user_agent" "$http_x_forwarded_for"';


              access_log  
          /data/nginx_log/8.26.test-access.log;
              gzip  on;
              proxy_temp_path 
          /data/nginx-proxy-temp;
              proxy_cache_path 
          /data/nginx_cache/purge_test levels=1:2 keys_zone=purge_test:800m inactive=20d;    

              sendfile        on;
              
          #tcp_nopush     on;

              #keepalive_timeout  0;

              keepalive_timeout  65;

              
          #gzip  on;

              server {
                  
          listen       83;
                  server_name  etch2;
                  location 
          /{
                        allow   
          192.168.1.0/16;
                        allow   
          127.0.0.1/32;
                        deny all;
                        charset utf
          -8;

                        proxy_redirect off;

                        proxy_set_header Host 
          $host:$server_port;
                        proxy_set_header X
          -Real-IP  $remote_addr;
                        proxy_set_header X
          -Forwarded-For $proxy_add_x_forwarded_for;
                        client_max_body_size 50m;
                        client_body_buffer_size 256k;
                        proxy_connect_timeout 
          30;
                        proxy_send_timeout 
          30;
                        proxy_read_timeout 
          60;
                        proxy_buffer_size 16k;
                        proxy_buffers 
          4 32k;
                        proxy_busy_buffers_size 64k;
                        proxy_temp_file_write_size 64k;

                        proxy_cache purge_test;
                        proxy_cache_key test
          $request_uri;
                        proxy_cache_valid 
          200 302 30m;
                        proxy_cache_valid 
          301 1d;
                        proxy_cache_valid any 2m;
                        proxy_cache_min_uses  
          1;
                        proxy_cache_use_stale error timeout invalid_header http_500;
                  
                        expires 12h;  
          # will this put a stamp on the stream from the upstream which does not (yet)

                        proxy_pass http
          ://localhost:8080;

                  }
                 location ~ /purge(/.*){
                        allow   192.168.0.0/16;
                        allow   127.0.0.1/32;
                        allow   222.66.142.229/32;
                        deny all;
          #              set $ppath test$1?$query_string;
          #              proxy_cache_purge  purge_test $ppath;
                         proxy_cache_purge purge_test test$1$is_args$args;

                  }



              }



          }
          (
            
          posted on 2009-11-17 17:45 冰是沒有未來的,因為它的永恒 閱讀(507) 評論(0)  編輯  收藏 所屬分類: nginx

          當下,把心放下 放下如果是可能的,那一定是在當下,
          不在過去,也不在未來。
          當下放下。唯有活在當下,你的問題才能放下。

          主站蜘蛛池模板: 阿荣旗| 霸州市| 尉犁县| 宁化县| 左权县| 沂源县| 隆尧县| 龙海市| 通许县| 旬阳县| 鹿泉市| 南昌县| 池州市| 富裕县| 玉树县| 东乡| 商丘市| 扶沟县| 墨江| 棋牌| 三台县| 龙岩市| 班玛县| 丽水市| 时尚| 全椒县| 永川市| 大安市| 汤阴县| 永福县| 蓝田县| 前郭尔| 稷山县| 闵行区| 丹巴县| 高唐县| 晴隆县| 宝丰县| 连江县| 彰化县| 墨竹工卡县|