squid3配置与使用

来源:互联网 发布:课表安排软件 编辑:程序博客网 时间:2024/05/18 02:18

squid代理服务器加密码

在配置文件中加入

auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/squid_passwd

其中squid_passwd使用passwd产生的密码文件。

acl ncsa_users prox_auth REQUIRED

http_access allow ncsa_users

这样就可以了


我遇到的一个问题

在某些机器上就是不能连接代理,但是个别机器又可以使用。

squid3 -s 提示警告

 WARNING: (B) '::/0' is a subnetwork of (A) '::/0'
 WARNING: because of this '::/0' is ignored to keep splay tree searching predictable

 WARNING: You should probably remove '::/0' from the ACL named 'all'

编辑配置注释掉下面的行警告消失,问题得到解决。

acl ncsa_users proxy_auth REQUIRED
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 All src all (注释掉)
http_access allow ncsa_users
#http_access allow All (注释掉)

一些常用命令参数

squid3 -k shutdown (停止服务器)

squid3 -k reconfigure (重新启动装入新的配置)

squid3 -s (后台启动服务器)

squid3 -N -d1 (前台启动并且打印日志)


附资料

http://zyan.cc/book/squid/index.html


0 0