Sei sulla pagina 1di 2

Configuring squid proxy server

What is proxy server? A server that sits between a client application, such as a web browser, and a real server. It intercepts all requests to the real server to see if it can fulfill the requests itself. If not, it forwards the request to the real server. Proxy servers can dramatically improve performance for groups of users. This is because it saves the results of all requests for a certain amount of time. They can also be used to filter requests. For example, a company might use a proxy server to prevent its employees from accessing a specific set of Web sites Installation: $sudo apt-get install squid Configuring: $sudo gedit /etc/squid/squid.conf When you hit enter the squid.conf window is opened and thats where we are going to configure all our ACLS and the rules of our proxy server. On that window we have:#INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS Under this statement we write all our rules. The rules we that carry out first are the good websites rules. The following rule is for good sights #INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS acl goodsites dstdomain .google.com.ph .yahoo.com .stcloudstate.edu acl badsites dstdomain .facebook .myspace.com .linkedin.com #This allows all users withing this network acl users src 192.168.0.0/24 #allow good websites from Monday through Sunday from specified times acl goodtimes MTWHFAS 0800-2300 #the following rule redirects all goodwebsites to this proxy server, if not defined then there #would be no limit as what traffic to be redirected thats all traffic would still be active http_access allow users goodsites #blocking access to all bad websites we set the rules as follows acl block_websites dstdomain .facebook.com .myspace.com.linkedin.com http_access deny block_websites.

#blocking everything http_access deny all Testing the Rules Once the rules the rules are done we the run the squid terminal and we use the following command in order to restart after saving the new rules. $sudo gedit /etc/squid/squid.conf *Restarting squid HTTP proxy squid *waiting.... Once done, we tried running all the good websites and they work just fine. When we run the bad websites we have an error ERROR The requested URL could not be retrieved While trying to retrieve the URL: http://www.facebook.com/ The following error was encountered: * Access Denied. Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect. Your cache administrator is webmaster. Generated Fri, 9 Mar 2012 03:56:53 GMT by Ian (squid/2.6.STABLE18) Deny all. Once we apply the rule http_access deny all, all the traffic good and bad is blocked in the proxy server the above errors appears for every instance that we run the acl list of all websites

Potrebbero piacerti anche