SQUID一问代理服务器教程
|
| 论文作者:佚名 论文来源:不详 论文发布时间:2006-6-19 18:14:37 论文发布人:chjchjchj |
减小字体
增大字体
摘要:SQUID一问 我用RedHat 9自带的Squid 2.5.STABLE1版本构建二级代理已经成功,但有一个问题总是不知何解?就是我每次启动SQUID服务,总是出现: Starting squid: .................... [FAILED] 但是我用squid status看,结果又是: squid (pid 9283 9280) is running... 而且所有客户端都能正常使用。查看cache.log有如下信息: 2003/06/17 10:24:48| Unlinkd pipe opened on FD 9 2003/06/17 10:24:48| Swap maxSize 5120000 KB, estimated 393846 objects 2003/06/17 10:24:48| Target number of buckets: 19692 2003/06/17 10:24:48| Using 32768 Store buckets 2003/06/17 10:24:48| Max Mem size: 262144 KB 2003/06/17 10:24:48| Max Swap size: 5120000 KB 2003/06/17 10:24:48| Store logging disabled 2003/06/17 10:24:48| Rebuilding storage in /home2/var_squid/cache (DIRTY) 2003/06/17 10:24:48| Using Least Load store dir selection 2003/06/17 10:24:48| Current Directory is /home2/var_squid/logs 2003/06/17 10:24:48| Loaded Icons. 2003/06/17 10:24:48| Accepting HTTP connections at 0.0.0.0, port 6666, FD 10. 2003/06/17 10:24:48| WCCP Disabled. 2003/06/17 10:24:48| Ready to serve requests. 2003/06/17 10:24:48| Done reading /home2/var_squid/cache swaplog (1613 entries) 2003/06/17 10:24:48| Finished rebuilding storage from disk. 2003/06/17 10:24:48| 1579 Entries scanned 2003/06/17 10:24:48| 0 Invalid entries. 2003/06/17 10:24:48| 0 With invalid flags. 2003/06/17 10:24:48| 1574 Objects loaded. 2003/06/17 10:24:48| 0 Objects expired. 2003/06/17 10:24:48| 5 Objects cancelled. 2003/06/17 10:24:48| 27 Duplicate URLs purged. 2003/06/17 10:24:48| 0 Swapfile clashes avoided. 2003/06/17 10:24:48| Took 0.3 seconds (5398.3 objects/sec). 2003/06/17 10:24:48| Beginning Validation Procedure 2003/06/17 10:24:48| Completed Validation Procedure 2003/06/17 10:24:48| Validated 1547 Entries
没有发现什么异常呀。 请教各位大侠,是不是conf文件那里有问题,或者应该如何设置才能解决这个问题? 谢谢大家了!!!
段誉 回复于:2003-06-17 11:05:41在启动之前,应该先停掉squid吧,有相同进程在跑,肯定不行啊。
yeair 回复于:2003-06-17 11:30:42进程我先用squid stop停掉了,也用pkill -u squid杀过,也reboot过,都一样呀,启动前ps -ef看过了,没有的。真的不知了,斑竹帮忙呀!!
yeair 回复于:2003-06-17 13:14:26up
yeair 回复于:2003-06-17 21:49:47 问题终于解决了,原来我在squid.conf中加了 pid_filename /home2/var_squid/logs/squid.pid 本来,squid应该可以自己找到替换默认的,可是我打开 redhat 9的/etc/init.d/squid这个script才发现,它的默认居然是 /var/run/squid.pid 而且不能是别的,因为在下面的程序中有这样的判断: [ ! -f /var/run/squid.pid ] || break 自然对于我的系统,永远都要break,所以failed是肯定的,虽然可以用, 但是pid号对于squid来说永远未知,所以stop也会failed,进程杀不死。 唉,居然这样~~~~~~我重新装了squid 2.5 stable3,那个脚本还是 老样子~~~~所以,只好动手了,现在把新改过的脚本贴出来,希望对大家有点用,不对地方还要多多指教!!!!
#!/bin/bash # squidThis shell script takes care of starting and stopping #Squid Internet Object Cache # # chkconfig: - 90 25 # description: Squid - Internet Object Cache. Internet object caching is \ # a way to store requested Internet objects (i.e., data available \ # via the HTTP, FTP, and gopher protocols) on a system closer to the \ #requesting site than to the source. Web browsers can then use the \ #local Squid cache as a proxy HTTP server, reducing access time as \ #well as bandwidth consumption. # pidfile: /var/run/squid.pid # config: /etc/squid/squid.conf ######## #Update: 06172003, May & Chenzj, VLSI.ZJU, # can set pidfile name in&s;'''/etc/squid/squidof''' # like:&s;'''pid_filename /etc/run/squidi1'''
PATH=/usr/bin:/sbin:/bin:/usr/sbin export PATH
# Source function library. . /etc/rc.d/init.d/functions
# Source networking configuration. . /etc/sysconfig/network
# Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0
# check if the squid conf file is present [ -f /etc/squid/squid.conf ] || exit 0
if [ -f /etc/sysconfig/squid ]; then . /etc/sysconfig/squid fi
#&nbsdn'''t raise an error if the config file is incomplete # set defaults instead: SQUID_OPTS=${SQUID_OPTS:-"-D"} SQUID_PIDFILE_TIMEOUT=${SQUID_PIDFILE_TIMEOUT:-20} SQUID_SHUTDOWN_TIMEOUT=${SQUID_SHUTDOWN_TIMEOUT:-100}
# determine the name of the squid binary [ -f /usr/sbin/squid ] && SQUID=squid [ -z "$SQUID" ] && exit 0
prog="$SQUID"
# determine which one is the cache_swap directory CACHE_SWAP=`sed -e&s;'''s/#/g''' /etc/squid/squid.conf | \ grep cache_dir | awkbp''''{ print $3&s;''''` [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid
# determine which one is the pidfile directory PID_FILE=`sed -ebp''''s/*/'''' /etc/squid/squid.conf | \ grep pid_filename | awns;''''{ print $2bp}''''` [ -z "$PID_FILE" ] && PID_FILE=/var/run/squid.pid
# echo $PID_FILE
RETVAL=0
|
|
|
|
|
|
|
| ∷相关技术评论 |
(评论内容只代表网友观点,与本站立场无关!) [查看发表评论...] | |
|
|
| |
站内广告 |
| |
|
站内搜索 |
| |
栏目导航 |
| |
|
|
本月热门 |
| |
|
|
本日热门 |
| |
|
|
|