Linux5.5下安装squid2.7反向代理
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-04-19
wget http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE9.tar.gz tar -zxvf squid-2.7.STABLE9.tar.gz ./configure \ --prefix=/usr/local/squid \ --disable-internal-dns \ --enable-forward-log \ --enable-follow-x-forwarded-for \ --enable-snmp \ --enable-linux-netfilter \ --enable-http-violations \ --enable-delay-pools \ --enable-storeio=diskd,aufs,ufs,coss \ --with-coss-membuf-size=8388608 \ --with-large-files \ --enable-large-cache-files \ --with-maxfd=8192 \ --enable-removal-policies=lru,heap \ --enable-useragent-log \ --enable-referer-log \ --enable-err-languages=Simplify_Chinese \ --enable-default-err-language=Simplify_Chinese make && make install mkdir /usr/local/squid/var/cache chown -R nobody.nobody /usr/local/squid/var/cache chown -R nobody.nobody /usr/local/squid/var/logs vim /usr/local/squid/etc/squid.conf visible_hostname zj.163.com http_port 10.80.11.212:80 vhost vport icp_port 0 cache_mem 1024 MB cache_swap_low 90 cache_swap_high 95 maximum_object_size 20000 KB maximum_object_size_in_memory 4096 KB cache_dir ufs /usr/local/squid/var/cache 10000 16 256 ipcache_size 10240 fqdncache_size 10240 cache_store_log none emulate_httpd_log on logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh pid_filename /usr/local/squid/squid.pid cache_log /usr/local/squid/var/cache/cache.log access_log /usr/local/squid/var/logs/access.log combined cache_mgr yhl@zjhcsoft.com memory_pools off memory_pools_limit none #local mamage acl manager proto cache_object acl localhost src 127.0.0.1 10.80.11.212 http_access allow manager localhost http_access deny manager acl all src 0.0.0.0/0.0.0.0 http_access allow all #deny this file cache
acl QUERY urlpath_regex cgi-bin .jsp .do .php .cgi .avi .wmv .rm .ram .mpg .mpeg .zip .exe cache deny QUERY #acl picurl url_regex -i \.bmp$ \.png$ \.jpg$ \.gif$ \.jpeg$ #acl mystie1 referer_regex -i ct10000 #http_access allow mystie1 picurl #acl nullref referer_regex -i ^$ #http_access allow nullref #acl hasref referer_regex -i . #http_access deny hasref picurl cache_peer 10.80.11.208 parent 80 0 no-query originserver name=web1 cache_peer_domain web1 zj.163.com cache_effective_user nobody cache_effective_group nobody 初始化你在 squid.conf 里配置的 cache 目录 /usr/local/squid/sbin/squid -zX 验证 squid.conf 的 语法和配置 /usr/local/squid/sbin/squid -k parse 前台启动squid,并输出启动过程 /usr/local/squid/sbin/squid -N -d1 出现2010/06/21 15:36:44| Ready to serve requests. 说明启动成功 然后 ctrl c,停止squid,并以后台运行的方式启动它 启动squid在后台运行 /usr/local/squid/sbin/squid -s 停止 squid /usr/local/squid/sbin/squid -k shutdown 要执行两次才能正常关闭squid 重引导修改过的 squid.conf /usr/local/squid/sbin/squid -k reconfigure 可能通过squidclient这个工具来查看squid的运行情况,缓存命中率等 /usr/local/squid/bin/squidclient -h 10.80.11.203 -p 80 mgr:info 可查看各选项的使用说明 /usr/local/squid/bin/squidclient -h 10.80.11.203 -p 80 mgr: 内存使用情况可通过如下选项查看 /usr/local/s |
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: linux FTP本地用户不能登录下一篇: sandwork linux下的安装
关于Linux5.5下安装squid2.7反向代理的所有评论