ubuntu 下的squid安裝日誌

2021-08-24 22:03:17 字數 2242 閱讀 3999

ubuntu 9.0.4

1) 安裝

wget tar xzvf squid-3.0.stable20.tar.gz cd squid-3.0.stable20/ ./configure --prefix=/path/to/squid

遇到問題

checking for c++ compiler default output file name...

configure: error: c++ compiler cannot create executables

see `config.log' for more details.

configure: error: ./configure failed for lib/libtrie

解決:sudo apt-get install g++

重新編譯 ok

make &&  make install

2)配置

在$/etc/squid.cof中加入

#配置 squid 為加速模式 http_port 80 accel vhost vport #配置反向**的伺服器 ,originserver 引數指明是源伺服器, cache_peer 127.0.0.1 parent 8080 0 no-query originserver

驗證配置

$/sbin/squid – k parse

3)生成快取目錄

$/sbin/squid -z

缺省會在$/var/cache下生成一堆目錄

4)啟動

sudo $/sbin/squid

發現問題:

squid程序起來了,但很快消失,並有錯誤日誌

fatal: cannot open '/home/pwlazy/dev/squid/var/logs/access.log' for writing.

the parent directory must be writeable by the

user 'nobody', which is the cache_effective_user

set in squid.conf.

解決:sudo chown -r nobody /home/pwlazy/dev/squid/var/logs/access.log

再次啟動,發現問題:

fatal: cannot open '/home/pwlazy/dev/squid/var/logs/store.log' for writing.

the parent directory must be writeable by the

user 'nobody', which is the cache_effective_user

set in squid.conf.

解決:sudo chown -r nobody /home/pwlazy/dev/squid/var/logs/store.log

再次仍然問題

2009/11/14 02:31:38| /home/pwlazy/dev/squid/var/cache/00: (13) permission denied

fatal: failed to verify one of the swap directories, check cache.log

for details. run 'squid -z' to create swap directories

if needed, or if running squid for the first time.

解決sudo chown -r nobody /home/pwlazy/dev/squid/var/cache

上面的問題非常類似,總結一下:

squid起來之後會有乙個父程序,和1個或者多個工作程序,這些工作程序會讀寫access.log和store.log以及cache目錄

而父程序會讀寫cache.log

5)從頁面訪問

發現問題:

403解決:

於是修改配置檔案,

將http_access deny all改為

再次訪問ok

6)清除快取

bin/squidclient -m purge -p 80 ""

發現問題

解決acl adminboxes src 127.0.0.1 acl purge method purge http_access allow adminboxes purge http_access deny purge

ubuntu 下的squid安裝日誌

ubuntu 9.0.4 1 安裝 遇到問題 checking for c compiler default output file name.configure error c compiler cannot create executables see config.log for more d...

ubuntu 下的squid安裝日誌

ubuntu 9.0.4 1 安裝 wget tar xzvf squid 3.0.stable20.tar.gz cd squid 3.0.stable20 configure prefix path to squid 遇到問題 checking for c compiler default ou...

ubuntu 下的squid安裝日誌

ubuntu 9.0.4 1 安裝 wget tar xzvf squid 3.0.stable20.tar.gz cd squid 3.0.stable20 configure prefix path to squid 遇到問題 checking for c compiler default ou...