快速业务通道

RHCE253--架设Squid服务器

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-13
max-conn=30 cache_peer 192.168.2.12 parent 80 0 originserver weight=5 max-conn=30 cache_peer 192.168.2.13 parent 80 0 originserver weight=5 max-conn=30 cache_peer 192.168.2.14 parent 80 0 originserver weight=1 max-conn=8 cache_peer Web服务器地址 服务器类型 http端口 icp端口 [可选项] 2、验证反向代理的实施效果 在上游Web服务器(192.168.2.11~192.168.2.14)中开启httpd服务 在Internet中的客户机(218.29.30.29)中访问反向代理服务器主机(http://218.29.30.31), 应能够看到实际由上游Web服务器提供的网页内容,查看反向代理服务器的访问日志信息 [root@localhost ~]# tail -1 /var/log/squid/access.log (我所处的特殊网络环境,该试验无法对结果进行验证) 八、实现代理服务器的身份认证和安装代理日志分析软件 1、linux系统的代理支持认证方式有ncsa,smb,ldap,shadow,pam 通过编辑主配置文件: vim /etc/squid/squid.conf 275 auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid.passwd 276 auth_param basic children 5 277 auth_param basic realm Squid proxy-caching web server 278 auth_param basic credentialsttl 2 hours 279 auth_param basic casesensitive off 580 acl password proxy_auth REQUIRED //设置认证的访问列表 648 http_access allow password time1 //允许正确用户在上网时间访问 649 http_access allow mynet time1 2、添加用户: htpasswd -c /etc/squid/squid.passwd xx1 htpasswd /etc/squid/squid.passwd xx2 //不用-c选项啦 然后重新加载squid配置文件参数service squid reload 通过浏览器代理上网比认证通过了~!~ 3、代理日志分析软件sarg的安装使用: [root@mail ftp]# tar -zxf sarg-2.2.5.tar.gz -C /opt/ [root@mail ftp]# cd /opt/sarg-2.2.5/ [root@mail sarg-2.2.5]# mkdir /var/www/html/sarg [root@mail ftp]# ./configure --enable-bindir=/usr/bin--enable-sysconfdir=/usr/local/sarg/ --enable-htmldir=/var/www/html/sarg --enable-mandir=/usr/share/man/man1/ [root@mail ftp]# make [root@mail ftp]# make install [root@mail sarg]# vim /usr/local/sarg/sarg.conf 37 access_log /var/log/squid/access.log 138 temporary_dir /tmp 144 output_dir /var/www/html/sarg [root@mail sarg]# vim /etc/httpd/conf.d/sarg.conf <Directory "/var/www/html/sarg"> Options Indexes MultiViews AllowOverride authconfig Order allow,deny Allow from 192.168.101.0/24 authtype basic authname "aadfajsldf" authuserfile /var/www/html/.htpasswd require user admin </Directory> [root@mail sarg]# htpasswd -c /var/www/html/.htpasswd admin New password: Re-type new password: Adding password for user admin [root@mail sarg]# sarg SARG: Records in file: 142, reading: 100.00% SARG: Successful report generated on /var/www/html/sarg/2010Aug23-2010Sep02 http://x.x.x.x/sarg 就可以通过帐号admin登陆使用了 这里有一点要注意的:

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多
的内容动态改变的行高
  • J2ME 3D编程——第一个3D程序(附源代码) - 编程入门网
  • Media Services用户身份管理技巧详解
  • Photoshop教程:为玫瑰花添加漂亮的喷溅效果
  • Linux进程 捕获信号
  • 记录:linux下安装mysql5
  • Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

    地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

    电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

    《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号