• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 重新編譯Squid筆記

    發表于:2007-07-04來源:作者:點擊數: 標簽:
    (一) 從http://www.squid-cache.org 下載Squid TAR安裝包squid-2.5.STABLE9.tar.gz (二) unload Squid rpm -e squid (三) 編譯Squid tar -zxvf squid-2.5.STABLE9.tar.gz cd squid-2.5.STABLE9 export CFLAGES='-02 -mcpu=pentium3' ./configure --prefix=/u

    (一)
    從http://www.squid-cache.org下載Squid TAR安裝包squid-2.5.STABLE9.tar.gz
    (二)
    unload Squid
    rpm -e squid
    (三)
    編譯Squid
    tar -zxvf squid-2.5.STABLE9.tar.gz
    cd squid-2.5.STABLE9
    export CFLAGES='-02 -mcpu=pentium3'
    ./configure --prefix=/usr/local/squid \

    --sysconfdir=/etc/squid --enable-arp-acl --enable-cache-digests --enable-err-language="Traditional_Chinese" --enable-default-err-language="Traditional_Chinese" --enable-kill-parent-hack --enable-linux.netfilter --enable-snmp --enable-underscores --enable-gnuregex --enable-async-io=80 --enable-icmp --enable-poll --disable-ident-lookups
    make && make install
    (四)
    設置/etc/squid/squid.conf
    參考原RPM版本的squid.conf
    只是Squid的log等按默認值處理,如下
    http_port 172.16.3.2:3128
    icp_port 3130
    udp_outgoing_address 255.255.255.255
    hierarchy_stoplist cgi-bin ?
    acl QUERY urlpath_regex cgi-bin \?
    no_cache deny QUERY
    cache_mem 32 MB
    cache_swap_low 90
    cache_swap_high 95
    maximum_object_size 8192 KB
    ipcache_size 1024
    ipcache_low 90
    ipcache_high 95
    fqdncache_size 1024
    cache_dir ufs /usr/local/squid/var/cache1 3000 16 256
    cache_dir ufs /usr/local/squid/var/cache2 4000 16 256
    emulate_httpd_log on
    client_netmask 255.255.255.255
    dns_nameservers 202.96.134.133 202.96.128.166
    auth_param basic children 5
    auth_param basic realm Squid proxy-caching web server
    auth_param basic credentialsttl 2 hours
    auth_param basic casesensitive off
    refresh_pattern ^ftp: 1440 20% 10080
    refresh_pattern ^gopher: 1440 0% 1440
    refresh_pattern . 0 20% 4320
    acl all src 0.0.0.0/0.0.0.0
    acl manager proto cache_object
    acl localhost src 127.0.0.1/255.255.255.255
    acl to_localhost dst 127.0.0.0/8
    acl SSL_ports port 443 563
    acl CONNECT method CONNECT
    http_aclearcase/" target="_blank" >ccess allow manager localhost
    http_access deny manager
    http_access deny !Safe_ports
    http_access deny CONNECT !SSL_ports
    http_access allow all
    http_reply_access allow all
    icp_access allow all
    cache_mgr root
    cache_effective_user nobody
    cache_effective_group nobody
    visible_hostname ADSLserver
    httpd_accel_host 172.16.3.2
    httpd_accel_port 80
    httpd_accel_with_proxy on
    httpd_accel_uses_host_header on
    coredump_dir /usr/local/squid/var/cache
    (五)
    建立cache
    mkdir /usr/local/squid/var/cache1
    mkdir /usr/local/squid/var/cache2
    chown -R nobody.nobody /usr/local/var
    /usr/local/squid/sbin/squid -z
    #正常情況顯示2005/05/14 13:24:10| Creating Swap Directories
    (六)
    啟動Squid
    su nobody -c "/usr/local/squid/bin/RunCache &"
    顯示如下:
    [root@ADSLserver sbin]# su nobody -c "/usr/local/squid/bin/RunCache &"
    bash: /root/.bashrc: 拒絕不符權限的操作
    [root@ADSLserver sbin]# Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
    /usr/local/squid/bin/RunCache: line 20: /usr/local/squid/var/squid.out: 沒有此一檔案或目錄
    /usr/local/squid/bin/RunCache: line 22: /usr/local/squid/var/squid.out: 沒有此一檔案或目錄
    Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
    解決:
    touch /usr/local/squid/var/squid.out
    chown nobody.nobody squid.out
    再次運行RunCache
    顯示如下
    [root@ADSLserver sbin]# /usr/local/squid/bin/RunCache: line 35: 30860 已經終止 squid -NsY $conf >>$logdir/squid.out 2>&1

    [root@ADSLserver sbin]# Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
    /usr/local/squid/bin/RunCache: line 35: 30872 已經終止
    查看/usr/local/squid/var/logs/cache.log顯示如下
    2005/05/14 17:42:10| Starting Squid Cache version 2.5.STABLE9 for i686-pc-linux-gnu...
    2005/05/14 17:42:10| Process ID 3602
    2005/05/14 17:42:10| With 1024 file descriptors available
    2005/05/14 17:42:10| Performing DNS Tests...
    FATAL: ipcache_init: DNS name lookup tests failed.
    Squid Cache (Version 2.5.STABLE9): Terminated abnormally.
    CPU Usage: 0.010 seconds = 0.010 user + 0.000 sys
    Maximum Resident Size: 0 KB
    Page faults with physical i/o: 277
    這時您的Squid應該是正常了,只不過ADSL還沒有撥號,所以為顯示此錯誤,
    adsl-start
    之后正常
    關于上面的說明:
    啟動squid: squid -D
    squid的站點維護了一份很詳細的FAQ,基本上你需要問的問題都有答案,比如你可以先用squid -NCd1來以debug模式啟動,這樣如果有錯誤會報出來,一般如果是ADSL撥號的,那么在沒有撥號之前就啟動squid的話是會出錯的(FATAL: ipcache_init: DNS name lookup tests failed),因為squid啟動時會去檢查一些常用的DNS,但是這時候你并沒有接入internet,自然就出錯了,所以我們需要在啟動的時候不檢查DNS,這就需要用加上-D選項來啟動squid
    (七)
    修改Sarg的配置
    vi /usr/local/sarg/sarg.conf
    只是修改如下
    access_log /usr/local/squid/var/logs/access.log
    #access_log /var/log/squid/access.log
    (八)
    全部正常,只是很多功能還要再作研究,只是現在可以上網了
    其它如iptable和NAT的設置參照我之前寫的文章

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>