代理服务器的Squidconfiguration

可能重复:
代理服务器的Squidconfiguration

我有一个10 ip的服务器,我想通过身份validation给一些朋友的访问,但我卡在鱿鱼的configuration文件。

假设我的服务器上有这些IP:

212.77.23.10 212.77.1.10 68.44.82.112 

我想把它们中的每一个分配给不同的用户,如下所示:

 212.77.23.10 goes to user manilodisan using password 123456 212.77.1.10 goes to user manilodisan1 using password 123456 68.44.82.112 goes to user manilodisan2 using password 123456 

我设法添encryption码和身份validation工作好,但我该怎么做,以限制一个用户的可用IP之一?

我有一个从互联网上find的不同位的基本设置,但似乎没有任何工作。 这里是我的squid.conf(所有评论被删除,使其更轻):

 acl ip1 myip 212.77.23.10 acl ip2 myip 212.77.1.10 tcp_outgoing_address 212.77.23.10 ip1 tcp_outgoing_address 212.77.1.10 ip2 http_port 8888 visible_hostname weezie auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid-passwd acl ncsa_users proxy_auth REQUIRED http_access allow ncsa_users acl all src 0.0.0.0/0.0.0.0 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 # https acl SSL_ports port 563 # snews acl SSL_ports port 873 # rsync 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 Safe_ports port 631 # cups acl Safe_ports port 873 # rsync acl Safe_ports port 901 # SWAT acl purge method PURGE acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access allow purge localhost http_access deny purge http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost http_access deny all icp_access allow all hierarchy_stoplist cgi-bin ? access_log /var/log/squid/access.log squid acl QUERY urlpath_regex cgi-bin \? cache deny QUERY refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern . 0 20% 4320 acl apache rep_header Server ^Apache broken_vary_encoding allow apache extension_methods REPORT MERGE MKACTIVITY CHECKOUT hosts_file /etc/hosts forwarded_for off coredump_dir /var/spool/squid 

为什么不只是允许通过IP访问您的鱿鱼服务器?

如果你有webmin,你可以尝试下面的方法:

(本教程假定您已经成功地在您的服务器上安装了Webmin和Squid)

一旦你login了Webmin,在左边你会看到“Servers”。点击它,然后点击“Squid Proxy Server”。你可能需要填写一些信息,比如你的Squid安装的正确path。 一旦你完成了,你将能够通过WebminconfigurationSquid。

点击“Ports and Networking”,注意Squid将使用哪个端口(默认:3128)。 这是您需要在浏览器中input以使用Squid的端口。 然后返回到Squid模块索引,并点击“访问控制”button。

在底部有一个名为“创build新ACL”的button。在点击该button之前,从button旁边的下拉框中select“客户端地址”。 现在点击button。 在这个页面上,您将要填写以下信息: – ACL名称:home_network(您可以任意命名,无空格) – 从IP:允许使用Squid的第一个IP。 例如,您可以input192.168.1.0,这将允许所有以192.168.1开头的IP。 – 到IP:input允许的最后一个IP,或者您可以再次使用192.168.1.0 – networking掩码:input您的子网掩码(255.255.255.0)

点击保存。 这将返回到访问控制屏幕。 点击顶部的“代理限制”。 现在点击添加代理限制。 单击“操作”旁边的允许button,然后突出显示“home_network”,或者上面命名ACL的任何内容。 点击保存。

您现在将在列表底部看到您的新条目。 在右侧点击向上箭头将新的ACL移动到动作为“拒绝”的行的上面,ACL是全部。 (应该是一个动作)在屏幕的最顶端点击“应用更改”,然后返回到主要的Squid代理服务器页面。 点击Stop Squid,让它停止,然后点击Start Squid。

您现在已经完成了服务器上Squid的设置。 我们现在需要让你分配给Squid的端口通过你的防火墙。 如果您使用的是iptables,请将以下行添加到您的iptables中:-A INPUT -p tcp -dport 3128 -j ACCEPT