Thursday, October 10, 2013

redhat proxy

www.unixbabuforum.inmy pc have a redhat 4 as,how i can create proxy for internet restrictions in my company.if i have 100 user. i need 20 user on full access and 20 is some access site and 60 not allow, how i can create plz tell me of squid steps


www.unixbabuforum.inAt first we have to check whether the squid package is 
installed or not. To do so, we can use the following command. 


rpm -qa | grep squid* 

If 
squid is installed the command will show a line containing "squid". If squid is 
not installed, we have to install the squid package. We can do this by 
the following command: 


rpm -ivh squid* 

This installation will create a directory /etc/squid. 
To configure the proxy server we have to edit the file /etc/squid/squid.conf . Change the configuration as follows. 

http_port 3128 
icp_port 3130 

cache_mem 8 MB 

cache_dir 
ufs /var/spool/squid 100 16 256 

cache_log 
/var/log/squid/cache.log 

cache_store_log 
/var/log/squid/store.log 

acl all src 192.168.0.1/255.255.255.0 

http_access 
allow all 

You must 
have to write the last line before the line http_access deny all. 

And then 
you have to start the service with the following command: 

Service squid start 



Now, you are telling that you have 100 workstations. Among 
them 20 will get full access, 20 will get restructed access and the other 6o 
wont get access. 

So, for 20 get full access I am creating an acl named full 

acl full src 192.168.0.129/27 

and provide them full access by following http_access 

http_access allow full 

Now for next 20 I am creating an acl restrictedip, 

acl restrictedip 
src 192.168.0.1/27 

We can create a file contained allowed sites. 

#Allowed Sites 
www.cnn.com 
www.news.google.com 
www.bbc.co.uk 

and create an acl allowedsites with the following line. 

acl AllowedSites dstdomain "/usr/local/squid/etc/allowed-sites" 

now, 

http_access allow restrictedip AllowedSites 

And finally deny all others, 
http_access deny all 
www.unixbabuforum.inCentos 5 is just like RHEL 5. Here you will face a little bit difference. 
Suppose while installing the package you have to write the command 
# yum install squid 
And to start the service you have to write the following command: 
# /etc/init.d/squid start 
All the configuration at /etc/squid/squid.conf are same
www.unixbabuforum.inuse http://www.cyberciti.biz/tips/howto-rhel-centos-fedora-squid-installation-configuration.html

0 comments:

Post a Comment

 
Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM