ouzhoudijie 发表于 2015-11-19 10:56:31

ubuntu 下的squid安装日志

  ubuntu 9.0.4
  
  1) 安装
  
  wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE20.tar.gztar xzvf squid-3.0.STABLE20.tar.gzcd 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)配置
  在${squid_home}/etc/squid.cof中加入
  #配置 squid 为加速模式http_port 80 accel vhost vport #配置反向代理的服务器 ,originserver 参数指明是源服务器,cache_peer 127.0.0.1 parent 8080 0 no-query originserver   
  
  验证配置
  ${squid_home}/sbin/squid – k parse
  3)生成缓存目录
  ${squid_home}/sbin/squid -z
  默认会在${squid_home}/var/cache下生成一堆目录
  4)启动
  sudo ${squid_home}/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)从页面访问
  http://127.0.0.1
  发现问题:
403
  
  解决:
于是修改配置文件,
将http_access deny all改为
http_access allow all
再次访问ok
  
  6)清除缓存
  bin/squidclient -m PURGE -p 80 "http://127.0.01/"
  发现问题
  403
  
  解决
acl AdminBoxes src 127.0.0.1 acl Purge method PURGEhttp_access allow AdminBoxes Purgehttp_access deny Purge
  
             版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: ubuntu 下的squid安装日志