环境:2个网卡,一个接adsl,一个接内网
把adsl取消后,squid启动失败
 
错误提示:
$SQUID $SQUID_OPTS >>/var/log/squid/squid.out 2>&1
 
最后找原因,应该是IP问题
 
指定一个visible_hostname名字就OK了
编辑squid.conf文件,添加下列实例

#  TAG: visible_hostname
#       If you want to present a special hostname in error messages, etc,
#       then define this.  Otherwise, the return value of gethostname()
#       will be used. If you have multiple caches in a cluster and
#       get errors about IP-forwarding you must set them to have individual
#       names with this setting.
#
#Default:
visible_hostname swm(这一行是没有的,需要自己添加)

但如果您是单IP地址就不会出现这个错误!!
 
再重新启动squid,成功
 
 
注意:如果是单网卡
需要在端口前面加上IP:就可以了
 
 
附:squid编译安装完全命令
./configure --prefix=/var/squid --sysconfdir=/etc --enable-arp-acl --enable-linux-netfilter --enable-pthreads --enable-err-language="Simplify_Chinese" --enable-storeio=ufs,null --enable-default-err-language="Simplify_Chinese" --enable-auth="basic" --enable-baisc-auth-helpers="NCSA" --enable-underscore