找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 116|回复: 16

centos vps架设简单的squid反向代理服务器

[复制链接]

9

主题

314

回帖

731

积分

高级会员

积分
731
发表于 2010-8-12 16:05:07 | 显示全部楼层 |阅读模式
先去掉apache[ol]
  • yum -y remove httpd[/ol]复制代码然后下载安装squid3.0[ol]
  • wget http://people.redhat.com/jskala/squid/squid-3.0.STABLE25-1.el5/i386/squid-3.0.STABLE25-1.el5.i386.rpm
  • rpm -i squid-3.0.STABLE25-1.el5.i386.rpm[/ol]复制代码修改配置文件/etc/squid/squid.conf的内容为[ol]
  • acl localhost src 127.0.0.1/255.255.255.255
  • acl to_localhost dst 127.0.0.0/8
  • http_port 80 vhost
  • cache_peer 你的上级web服务器的ip parent 80 0 no-query originserver name=yourfirstdomain.com
  • cache_peer_domain yourfirstdomain.com .yourfirstdomain.com
  • cache_peer 你的上级web服务器的ip parent 80 0 no-query originserver name=yourotherdomain.com
  • cache_peer_domain yourotherdomain.com .yourotherdomain.com
  • http_access allow all
  • cache_mem 64 MB
  • emulate_httpd_log on
  • visible_hostname buyvmvps
  • cache_mgr webmaster@example.com
  • access_log /var/log/squid/access.log squid
  • refresh_pattern .               0       20%     4320
  • acl apache rep_header Server ^Apache
  • coredump_dir /var/spool/squid[/ol]复制代码设置开机启动,启动squid[ol]
  • chkconfig --level 2345 squid on
  • service squid start[/ol]复制代码
  • 回复

    使用道具 举报

    11

    主题

    327

    回帖

    715

    积分

    高级会员

    积分
    715
    发表于 2010-8-12 16:21:28 | 显示全部楼层
    反向代理最近好像很时髦,有机会试一下
    回复

    使用道具 举报

    173

    主题

    1301

    回帖

    3167

    积分

    论坛元老

    积分
    3167
    发表于 2010-8-12 16:28:42 | 显示全部楼层
    不错。收藏了
    回复

    使用道具 举报

    426

    主题

    1万

    回帖

    2万

    积分

    论坛元老

    积分
    26628
    发表于 2010-8-12 20:26:39 | 显示全部楼层
    楼主是转载的,还是实测过的?
    回复

    使用道具 举报

    9

    主题

    314

    回帖

    731

    积分

    高级会员

    积分
    731
     楼主| 发表于 2010-8-12 20:40:46 | 显示全部楼层
    实际安装后整理的步骤
    回复

    使用道具 举报

    34

    主题

    124

    回帖

    396

    积分

    中级会员

    积分
    396
    发表于 2010-8-12 20:54:14 | 显示全部楼层
    谢谢!等一下试试看!
    回复

    使用道具 举报

    203

    主题

    6116

    回帖

    1万

    积分

    论坛元老

    积分
    13027
    发表于 2010-8-12 20:58:10 | 显示全部楼层
    可惜squid不支持smp,acl多了,流量大了后CPU占用比较厉害,不过做为反向代理还是很不错的。
    另外一个不错的选择就是nginx
    回复

    使用道具 举报

    52

    主题

    4001

    回帖

    8310

    积分

    论坛元老

    积分
    8310
    发表于 2010-8-12 21:14:28 | 显示全部楼层
    貌似不够详细啊,,,可能是我太小白了
    回复

    使用道具 举报

    329

    主题

    3710

    回帖

    8445

    积分

    论坛元老

    积分
    8445
    发表于 2010-8-13 02:27:02 | 显示全部楼层
    收藏 接下来 怎么新建反向代理?
    回复

    使用道具 举报

    0

    主题

    1

    回帖

    4

    积分

    新手上路

    积分
    4
    发表于 2010-8-15 15:11:23 | 显示全部楼层
    弄下来只是访问主页有代理么同问?
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-4-20 11:16 , Processed in 0.023519 second(s), 4 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表