百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>服务器> Centos下Proxy代理服务器配置
分享文章到:

Centos下Proxy代理服务器配置

发布时间:01/15 来源: 浏览: 关键词:
代理服务器(Proxy Server)是一种重要的服务器安全功能,它的工作主要在开放系统互联(OSI)模型的会话层,从而起到防火墙的作用。代理服务器大多被用来连接INTERNET(国际互联网)和INTRANET(局域网)。


安装套件

yum -y install squid*
cp /etc/squid/squid.conf /etc/squid/squid.conf.bak
vi /etc/squid/squid.conf

#请视使用人数和硬碟状况加大 cache 资料夹容量
cache_dir ufs /var/spool/squid 1000 16 256

#限制允许连线范围,请依自己学校状况修改
acl hostname src 192.168.1.0/24

http_access deny all
http_access allow localhost
http_access allow hostname

#Recommended minimum configuration:
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 563
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443 563     # https snews
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

#限制允许连线范围,请依自己学校状况修改 111cn.net

service squid restart

 
 
NAT 与 Proxy :transparent proxy 加快网路传输
#Fedora core 7 新的 squid 版本 Transparent Proxy 设定简化,整合到 http_port 的 option 内了。


vi /etc/squid/squid.conf

http_port 3128 transparent
httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

service squid restart

--------------------------------------------
#Fodora Core 6 以前的版本 squid Transparent Proxy 设定在 squid 设定档内加上如下四行
vi /etc/squid/squid.conf


httpd_accel_host ha.shsps.kh.edu.tw
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有5人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板