设为首页 收藏本站
查看: 871|回复: 0

[经验分享] Installing Squid 3.2 on CentOS 5.3(转)

[复制链接]

尚未签到

发表于 2018-12-27 11:30:08 | 显示全部楼层 |阅读模式
Squid for those who do not know is a proxy server.
Proxys can be used for many things, but one great thing if you have a thinner connection to the Internet, you can use this to speed things up a bit. What it does is when you surf the web, the things you download are actually first downloaded to the proxy, and then your browser downloads it automagically from the proxy. If you afterwards browse to the same page the proxy should provide you with a cached copy and not re-download the whole page again.

Downloading/compiling
It’s a good idea to not run any service as root.

  • Download it from http://www.squid-cache.org/ there are many options to chose from. Stable, unstable, 3.2, 3.1 etc. I just took a recent developer build from the 3.2 chain – squid-3.2.0.6.
  • Untar this somewhere, doesn’t matter where. Move directory and:
To get the program to install itself in a location where you have access, you need to specify that while running the configure check.
You do this with:
./configure –prefix=/home/user/bin/squid-install
or wherever you want to put it. I just put it directly in /home/user/squid-inst.
If that completes without errors next step is to: make; make install. This will compile and then install it in the directory you specified above. After that completes sucessfully you can delete/hide the directory. I hide it just in case I want to change something in the configure or whatever.
Then it’s time to configure!
Now proxy servers you need to put some kind of authentication on. Unless you want a hoard of unwanted visitors.
There are a gazillion of different settings in the squid.conf.documented.
Configuration is done via ~/squid-inst/etc/squid.conf
  cache_dir ufs /usr/local/squid/cache 100 16 256
The value 100 denotes 100MB cache size. This can be adjusted to the required size.
  http_port 3128
This is the port you will be connecting to. Make sure you do not set one that other services on the machine uses. Might be a good idea to use a non-standard as well, to prevent some from “stumbling” onto it and trying to brute-force it.

Starting squid

  • create cache directories with ~/squid-inst/sbin/squid -z
  • run it in debug ~/squid-inst/sbin/squid -NCd1
If everything is working fine, then your console displays: “Ready to serve requests”.
You can now surf to your http://host:port
However, you cannot use it as a cache yet.
You need to set up the http_access part. The ACL – access list.
This can be complicated.
See here for some examples of that: http://wiki.squid-cache.org/SquidFaq/SquidAcl
However, all you “need” is as below. First, find out your IP-address. Let’s say it’s 12.24.48.96 for the fun of it. You can see what it is by surfing to www.ripe.net
add this somewhere on top near the other “acl” entries:
  acl me src 12.24.48.0/24
Then a bit further down
  http_access allow me
Now if you want to you can be more tight with the security, and you probably should.
The setting above means that everybody on that subnet can use your proxy server.
For example you might want to change it to only your IP – if you have a static one.

  acl me src 12.24.48.96/32
If you change something in the configuration, you can do this to stop squid:
  ~/squid-inst/sbin/squid -k kill
  ~/squid-inst/sbin/squid &
is used to start it in a daemon mode (keeps running after you log off your shell).
There are other ways to set up password checks (used to be with .htpasswd) but I have no need for this today. I’ll have a look into it some other day DSC0000.gif Squid 3.2 on CentOS 5.3(转)" />
  Also this proxy is transparent – meaning if you connect somewhere, people can see that you are indeed connecting through a proxy.

But first you need to set your browser to use the proxy, you do this under network settings.
Happy proxying!




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-656440-1-1.html 上篇帖子: Squid做的一些小改进 下篇帖子: Debian/Ubuntu命令方式快速安装squid
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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