squid for windows 配置代理服务器
来源:互联网 发布:淘宝评价管理登录 编辑:程序博客网 时间:2024/06/05 20:31
首先,单击[开始],选择“运行”,输入 cmd 打开Windows的“命令提示符” 窗口,在命令提示符窗口内输入以下命令:
C:\>cd c:\squid\etc
C:\squid\etc>copy squid.conf.default squid.conf
C:\squid\etc>copy mime.conf.default mime.conf
下面,我们可以使用任意文本编辑器对squid.conf(配置文件)进行编辑,修改squid的配置语句,文件中的#后的文本表示注释。
首先,我们找到TAG: acl段,这里是定义访问Squid的IP地址及其对应的名称
我们在此段acl Safe_ports port 777 #multiling http后增加一个新行,写 “acl 名称 src IP地址”
示例:acl name1 src 192.168.100.0 #定义所有来自192.168.100.*的机器对应的名称为name1
然后我们找到TAG: http_access段,这里是定义允许访问squid的列表
我们在此段http_access deny CONNECT !SSL_ports后增加一个新行,写“http_access allow/deny 名称”,allow表示允许访问,deny表示拒
绝访问。
示例:http_access allow name1 #定义所有标识为name1(192.168.100.*)的机器允许访问squid代理服务器
并且在后面再增加一行 http_access deny all。
任何一个网络应用都会对应一个或N个端口,squid的默认端口是3128,如果要更改,找到 #http_port 3128 这里,删掉前面的#号,并且修改
后面的端口号。
示例:http_port 7777 #将squid的服务端口改为7777
由于Squid是基于Cache(缓存)的代理服务器,所以设置缓存的大小对优化服务器的性能是有必要的,下面来看一下如何设置cache的大小。
找到#cache_mem 8 MB这句 删掉前面的#号 将默认的8修改到需要的大小,这里的数值应视具体的机器可用内存而定,应在内存允许的情况下尽
量地设置的大一些以提高代理服务器性能,但不能让代理服务器的缓存大小影响本机器的性能。
示例:cache_mem 200 MB #设置squid使用200MB的内存当做代理服务器缓存
最后我们还要有一个步骤,否则在启动squid服务的时候会报错,那就是配置TAG: visible_hostname段,找到此段,再后面添加
visible_hostname 机器名(随便起) 这么一行,就搞定了。
示例:visible_hostname supersrv #将hostname设置为supersrv
至此,可以保存squid.conf并且退出文本编辑器了,简单的Squid for Windows的配置已经完成。
下面我们回到命令行,输入以下命令:
c:\>cd c:\squid\sbin
C:\squid\sbin>squid -i
C:\squid\sbin>squid -z
C:\squid\sbin>net start squid
配置文件的主要内容具体如下:
……
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
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
acl webpage dstdomain .pps.tv .baidu.com
#urlpath_regex
acl dfile urlpath_regex
#acl baduser src ip地址或ip段
acl normal src ip地址或ip段
#http_access deny baduser
http_access allow normal
http_access deny !normal
http_access deny webpage
http_access deny dfile
acl deny_msn src c:\squid\etc\denymsnuser.txt
acl msn_app rep_mime_type application/x-msn-messenger
http_reply_access deny msn_app deny_msn
http_reply_access allow all
acl safe_ports port 80 21 443
acl ssl_ports port 443
acl connect method CONNECT
#这里写入要使用QQ者的IP,一行一个
acl dl_qq src c:\squid\etc\allowqquser.txt
#禁止qq登录端口
acl qq_ports port 4000-4020
acl qq_ports port 8000-8020
http_access deny dl_qq qq_ports
http_access deny qq_ports
#禁止qq登录
#这里面写入要QQ登录服务器的IP地址
acl qqip dst c:\squid\etc\qqip.txt
http_access deny !dl_qq qqip
http_access deny qqip
#这句话必须要写,即对前面的没有限定的所有ip(acl all src 0.0.0.0.0/0.0.0.0)的设置
http_access deny all
……
端口的主要配置:
#http_port 3128
# Squid normally listens to port 3128
# 服务器代理配置
# @hujunqi
# 端口
http_port 服务器的内网卡的ip:6688
# 服务器管理者的电子邮件,当错误发生时,该地址会显示在错误页面上
# 便于用户联系
cache_mgr xx@qq.com
# 缓存可以使用内存大小
cache_mem 600 MB
# 缓存文件目录路径、大小、目录结构
cache_dir ufs D:/cache 10240 16 256
# 在错误页面中显示的服务器名称
visible_hostname www.hujunqi.com
主要的配置也就这些,其他的细节注意一下就好了
- squid for windows 配置代理服务器
- SQUID FOR WINDOWS配置
- SQUID FOR WINDOWS配置
- windows下简单配置squid反向代理服务器
- Windows下配置Squid反向代理服务器
- Squid代理服务器配置文档
- squid代理服务器安装配置
- Squid 代理服务器配置
- 使用squid配置代理服务器
- Squid For Windows 安装配置(转)
- Squid代理服务器之一基本配置
- ubuntu用squid配置代理服务器
- 使用Squid配置反向代理服务器
- linux下配置squid代理服务器
- fedora8 下配置squid 代理服务器
- Squid透明代理服务器的配置
- squid和squidGuard配置代理服务器
- Squid代理服务器配置与部署
- 解决linux系统在虚拟机VM的报警声(报错发出的“嘟嘟”声)
- 守护进程
- ORA-32004 obsolete or deprecated parameter(s) specified for RDBMS instance
- HDU-2035
- 安卓开发-函数总结
- squid for windows 配置代理服务器
- 37、自定义字体
- http://beyondvincent.com/2013/07/18/resources-for-mac-and-ios-developers/
- HDU-2036
- 中国软件领域院士及其成就
- linux/eclipse/c++ 动态库的创立与调用
- python多线程+队列下载资源
- HDU-2039
- 输出HTML的Servlet