how to block facebook over https

555 views
Skip to first unread message

Mohit Gupta

unread,
Dec 15, 2011, 5:54:45 AM12/15/11
to Opensource Projects
How to block https://www.facebook.com in squid, please help me.

Richard Hamel-Smith

unread,
Dec 15, 2011, 6:07:23 AM12/15/11
to opensourc...@googlegroups.com
This is what I use. Modify to suit.

http_port 192.168.0.10:3128
http_port 127.0.0.1:3128
udp_incoming_address 192.168.0.10
udp_outgoing_address 0.0.0.0
acl before_work time 0:00-8:00
acl after_work time 16:30-23:00
acl lunch_time time 12:00-13:00
acl blocked_ips src "/etc/squid/blocked-ip-addresses"
acl bad_sites     dstdomain "/etc/squid/blocked-sites"
acl allowed_sites dstdomain "/etc/squid/allowed-sites.squid"
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localsrc src 127.0.0.1 192.168.0.0/255.255.255.0
acl localdst dst 127.0.0.1 192.168.0.0/255.255.255.0
acl SSL_ports port 443 563
acl Safe_ports port 21 70 80 81 119 210 443 563 980 1024-65535
acl CONNECT method CONNECT
acl webdav method PROPFIND TRACE PURGE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK
pid_filename /var/log/squid/squid.pid
logfile_rotate 0
append_domain .myhost.mydomain
cache_mgr ad...@myhost.mydomain
ftp_user nob...@myhost.mydomain
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
http_access deny blocked_ips !allowed_sites
http_access allow blocked_ips allowed_sites
http_access deny localsrc     bad_sites
http_access allow manager localsrc
http_access deny manager
http_access deny CONNECT !SSL_ports
http_access allow localsrc
http_access deny all
httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
icp_access allow all
miss_access allow all
store_avg_object_size 3 KB
always_direct allow webdav


Then, I put in /etc/squid/blocked-sites

facebook.com

Then, restart squid

service squid restart

Hope this helps

Richard
always_direct allow all


On Thu, Dec 15, 2011 at 6:54 AM, Mohit Gupta <mohit...@gmail.com> wrote:
How to block https://www.facebook.com in squid, please help me.

--
You received this message because you are subscribed to the Google Groups "Opensource Projects" group.
To post to this group, send an email to opensourc...@googlegroups.com.
To unsubscribe from this group, send email to opensource-proj...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensource-projects?hl=en-GB.




--
Richard Hamel-Smith
cel: (868) 763-2049
email: richardh...@gmail.com


Linuz Ashu

unread,
Dec 15, 2011, 6:13:06 AM12/15/11
to opensourc...@googlegroups.com
Simple to do!

Add below line in ACL section :
acl facebook  dstdomain .facebook.com

and below in access section :
http_access deny facebook

Both changes will be done in squid.conf.. service restart require after the changes! ;)

~Ashu


On Thu, Dec 15, 2011 at 4:24 PM, Mohit Gupta <mohit...@gmail.com> wrote:
How to block https://www.facebook.com in squid, please help me.

jyotir bhandari

unread,
Dec 18, 2011, 12:41:28 AM12/18/11
to opensourc...@googlegroups.com
Well Ashu is correct, if still finding it difficult to block just create an acl with url_regex with text file

that file can have .facebook. as regex.

It will block facebook from all sorts of search.

Let me know if its useful.

Regards
Jyotir
Reply all
Reply to author
Forward
0 new messages