免费注册 查看新帖 |

Chinaunix

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

配置一个使用用户名和密码认证的代理服务器 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-27 16:47 |只看该作者 |倒序浏览
因为……,所以配置了一台专用的代理服务器。
使用的是squid,为了保证只有授权用户才能使用,服务器使用ncsa_auth进行用户名和密码认证,下面是主配置文件/etc/squid/squid.conf:
=========================================
http_port 111.222.333.444:1234
#IP地址和端口号保留,不公开o(∩_∩)o
cache_mem 1 MB
#用户少,机器内存也小
cache_dir ufs /var/spool/squid 4096 16 256
cache_effective_user squid
cache_effective_group squid
dns_nameservers 555.666.777.888
#我们的域名服务器,保留o(∩_∩)o
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
visible_hostname 111.222.333.444
cache_mgr myname@server
acl all src 0.0.0.0/0.0.0.0
acl conn1 maxconn 3
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic credentialsttl 2 hours
auth_param basic realm MyName's Squid proxy-caching
acl auth_user proxy_auth REQUIRED
http_access allow auth_user
=========================================
用户的密码是用htpasswd生成的:
htpasswd -c /etc/squid/passwd 用户名
如果以后添加新用户,则:
htpasswd /etc/squid/passwd 用户名
现在这个代理可以使用了,如果您发现配置有问题,请告诉我,谢谢。
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/68417/showart_1341662.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP