免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5724 | 回复: 13
打印 上一主题 下一主题

[proxy] squid不能启动 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-09-10 15:26 |只看该作者 |倒序浏览
squid不能正常启动,日志如下:
2014/09/10 15:14:24| Starting Squid Cache version 3.3.8 for x86_64-redhat-linux-gnu...
2014/09/10 15:14:24| Process ID 18054
2014/09/10 15:14:24| Process Roles: master worker
2014/09/10 15:14:24| With 16384 file descriptors available
2014/09/10 15:14:24| Initializing IP Cache...
2014/09/10 15:14:24| DNS Socket created at [::], FD 5
2014/09/10 15:14:24| DNS Socket created at 0.0.0.0, FD 6
2014/09/10 15:14:24| Adding domain gj.com from /etc/resolv.conf
2014/09/10 15:14:24| Adding domain gj.com from /etc/resolv.conf
2014/09/10 15:14:24| Adding nameserver 8.8.8.8 from /etc/resolv.conf
2014/09/10 15:14:24| Adding nameserver 192.168.1.1 from /etc/resolv.conf
2014/09/10 15:14:24| Logfile: opening log daemon:/var/log/squid/access.log
2014/09/10 15:14:24| Logfile Daemon: opening log /var/log/squid/access.log
2014/09/10 15:14:24| Unlinkd pipe opened on FD 12
2014/09/10 15:14:24| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2014/09/10 15:14:24| Store logging disabled
2014/09/10 15:14:24| Swap maxSize 102400 + 102400 KB, estimated 15753 objects
2014/09/10 15:14:24| Target number of buckets: 787
2014/09/10 15:14:24| Using 8192 Store buckets
2014/09/10 15:14:24| Max Mem  size: 102400 KB
2014/09/10 15:14:24| Max Swap size: 102400 KB
2014/09/10 15:14:24| Rebuilding storage in /var/spool/squid (clean log)
2014/09/10 15:14:24| Using Least Load store dir selection
2014/09/10 15:14:24| Set Current Directory to /var/spool/squid
2014/09/10 15:14:24| Loaded Icons.
2014/09/10 15:14:24| HTCP Disabled.
2014/09/10 15:14:24| Squid plugin modules loaded: 0
2014/09/10 15:14:24| Adaptation support is off.
2014/09/10 15:14:24| Accepting HTTP Socket connections at local=[::]:3128 remote=[::] FD 15 flags=9
2014/09/10 15:14:24| Done reading /var/spool/squid swaplog (0 entries)
2014/09/10 15:14:24| Store rebuilding is 0.00% complete
2014/09/10 15:14:24| Finished rebuilding storage from disk.
2014/09/10 15:14:24|         0 Entries scanned
2014/09/10 15:14:24|         0 Invalid entries.
2014/09/10 15:14:24|         0 With invalid flags.
2014/09/10 15:14:24|         0 Objects loaded.
2014/09/10 15:14:24|         0 Objects expired.
2014/09/10 15:14:24|         0 Objects cancelled.
2014/09/10 15:14:24|         0 Duplicate URLs purged.
2014/09/10 15:14:24|         0 Swapfile clashes avoided.
2014/09/10 15:14:24|   Took 0.02 seconds (  0.00 objects/sec).
2014/09/10 15:14:24| Beginning Validation Procedure
2014/09/10 15:14:24|   Completed Validation Procedure
2014/09/10 15:14:24|   Validated 0 Entries
2014/09/10 15:14:24|   store_swap_size = 0.00 KB
2014/09/10 15:14:25| storeLateRelease: released 0 objects

论坛徽章:
0
2 [报告]
发表于 2014-09-11 08:33 来自手机 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
3 [报告]
发表于 2014-09-11 08:52 |只看该作者
配置如下 :
#
# Recommended minimum configuration:
#


#基本信息
visible_hostname zhuaquserver1
cache_effective_user squid
cache_effective_group squid

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8        # RFC1918 possible internal network
acl localnet src 172.16.0.0/12        # RFC1918 possible internal network
acl localnet src 192.168.0.0/16        # RFC1918 possible internal network


acl SSL_ports port 443
acl Safe_ports port 80                # http
acl Safe_ports port 21                # ftp
acl Safe_ports port 443                # https
acl Safe_ports port 70                # gopher
acl Safe_ports port 210                # wais
acl Safe_ports port 1025-65535        # unregistered ports
acl Safe_ports port 280                # http-mgmt
acl Safe_ports port 488                # gss-http
acl Safe_ports port 591                # filemaker
acl Safe_ports port 777                # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
#http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
#http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access allow all

# Squid normally listens to port 3128
http_port 3128

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 100 16 256
cache_mem 100 MB
cache_swap_low 90
cache_swap_high 95


# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:                1440        20%        10080
refresh_pattern ^gopher:        1440        0%        1440
refresh_pattern -i (/cgi-bin/|\?) 0        0%        0
refresh_pattern .                0        20%        4320

回复 2# chenzhiquan2000


   

论坛徽章:
0
4 [报告]
发表于 2014-09-11 08:53 |只看该作者
问题是客户端不能通过代理访问 , access.log文件为空

论坛徽章:
26
CU十二周年纪念徽章
日期:2013-10-24 15:41:34技术图书徽章
日期:2014-07-11 16:27:52辰龙
日期:2014-09-04 13:40:43白羊座
日期:2014-09-09 12:51:55双子座
日期:2014-09-26 11:00:042014年中国系统架构师大会
日期:2014-10-14 15:59:00子鼠
日期:2014-10-23 16:48:23巨蟹座
日期:2014-10-27 08:21:10申猴
日期:2014-12-08 10:16:282015年辞旧岁徽章
日期:2015-03-03 16:54:15NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2016-01-29 06:20:00
5 [报告]
发表于 2014-09-11 09:40 |只看该作者
本帖最后由 cryboy2001 于 2014-09-11 09:47 编辑

acl localnet src 192.168.0.0/16        

这个一般是192.168.0.0/24

你的客户端网段是多少,按照改一下。

客户端的ie也要设置

论坛徽章:
0
6 [报告]
发表于 2014-09-11 10:07 |只看该作者
客户端网段是192.168.1.2-192.168.1.254
回复 5# cryboy2001


   

论坛徽章:
26
CU十二周年纪念徽章
日期:2013-10-24 15:41:34技术图书徽章
日期:2014-07-11 16:27:52辰龙
日期:2014-09-04 13:40:43白羊座
日期:2014-09-09 12:51:55双子座
日期:2014-09-26 11:00:042014年中国系统架构师大会
日期:2014-10-14 15:59:00子鼠
日期:2014-10-23 16:48:23巨蟹座
日期:2014-10-27 08:21:10申猴
日期:2014-12-08 10:16:282015年辞旧岁徽章
日期:2015-03-03 16:54:15NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2016-01-29 06:20:00
7 [报告]
发表于 2014-09-11 10:13 |只看该作者
squid -z

squid -k parse

看一下

改成下面一句看看
acl localnet src 192.168.1.0/24

论坛徽章:
0
8 [报告]
发表于 2014-09-11 10:35 |只看该作者
还是一样的。
squid -z 的结果 :

squid -k parse的结果 :

k.png (45.28 KB, 下载次数: 81)

k.png

论坛徽章:
26
CU十二周年纪念徽章
日期:2013-10-24 15:41:34技术图书徽章
日期:2014-07-11 16:27:52辰龙
日期:2014-09-04 13:40:43白羊座
日期:2014-09-09 12:51:55双子座
日期:2014-09-26 11:00:042014年中国系统架构师大会
日期:2014-10-14 15:59:00子鼠
日期:2014-10-23 16:48:23巨蟹座
日期:2014-10-27 08:21:10申猴
日期:2014-12-08 10:16:282015年辞旧岁徽章
日期:2015-03-03 16:54:15NBA常规赛纪念章
日期:2015-05-04 22:32:03IT运维版块每日发帖之星
日期:2016-01-29 06:20:00
9 [报告]
发表于 2014-09-11 13:30 |只看该作者
显示已初始化过了,

防火墙开了没,客户端设好了没

重新

启动squid会出什么现象吗

论坛徽章:
0
10 [报告]
发表于 2014-09-11 14:44 |只看该作者
谢谢楼主。已经改成apache httpd了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP