
This tutorial shows, how you can configure your Linux Computer (Redhat/CentOS/Fedora) as a Squid (Proxy) Server, that does not allow to open few restricted sites and files downloads. And how you can configure your client to access Internet via Proxy Server.
1. First install the required package:
yum install *squid*
2. Edit squid configuration file as following:
vim /etc/squid/squid.conf
(save and exit)
3. Now create a file for blocking sites:
vim /usr/local/etc/restricted-sites.squid
www.facebook.comwww.orkut.com
www.naukri.com
www.monster.com
(save & exit)
4. Now create a file for blocking files.
vim /etc/squid/blockedfiles
\.mpg$\.[Mm][Pp]3$
\.[Aa][Vv][Ii]$
\.avi$
(save & exit)
5. Now create a file for Error Message when accessing restricted sites and downloading restricted files.
vim /etc/squid/errors/error_blocked_files
<HTML><HEAD>
<TITLE>ERROR: Blocked file content</TITLE>
</HEAD>
<BODY>
<H1> blocked due to new IT policy</H1>
<p>Please contact helpdesk for more information:</p>
Phone: 555-12435 (ext 44)<br>
Email: abc@alam.com<br>
Caution: Do not include HTML close tags </HTML> </BODY> as it will be closed by squid.
6. Prompting username and password:
touch /etc/squid/squid_passwd
chmod o+r /etc/squid/squid_passwd
htpasswd /etc/squid/squid_passwd www
New password:
Re-type new password:
Adding password for user www
locate ncsa_auth
usr/lib/squid/ncsa_auth7. Finally start Squid service:
service squid start
Client Configuration:
- Go to TCP/IP Configuration and set IP address of Squid Server as Default Gateway, and do not mention DNS Address.
- Set IP Address and Port Number of Proxy Server in your Web Browser.
Important FAQ regarding squid:
hi friends,
previously i asked same question, but i didnt get sufficient information..
so im explaining my requirement clearly..
pls anybody help me in solving this..
i have 128 kbps net connection , in my office now i want
share this connection and using redhat linux i want to restrict bandwidth per
user or system (5 k) how can i do that .
as i know some idea about squid pools but not exactly..
my aim is
1.i want to assign 5k per ip (may windows or linux box)
2.in any time user must not access more than 5k bandwidth
3.*(required but not must) my clients don't like chnage
anything on their browsers and chats (like port nos.etc)
my sys details: redhat 8.0 , p-2 , 256 mb ram, ide hd
Providing that you have a version of squid
compiled with "--enable-delay-pools",
you'll want to add some lines to squid.conf
similar to:
delay_pools 1
delay_class 1 1
delay_parameters 1 625/8000
acl All src 0/0
delay_access 1 allow All
(NB The "625/8000" part is BYTES per second
and not BITS, so 625B/s x 8 = 5000bit/s =
5Kbit/s)
What the above does is wait until the total
bandwidth being used is 8000B/s (64Kbit/s)
and it then limits it down to 5Kbit/s per
IP in the range 0.0.0.0/0
All the users need to have set locally is
the IP of the squid machine set as their
proxy, if you have windoze clients you can
do this via group policy.
You could make your squid proxy the gateway
for the network.
Some links for you:
http://squid-docs.sourceforge.net/latest/book-full.html
http://squid.visolve.com/squid/sqguide.htm





