Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been able to install squid on my Ubuntu Server with basic authentication and everything works perfectly. Recently the boss asked to block facebook access and I did it with no problems. Now it looks that he wants to give the users possibility to access during lunchtime...

Any ideas?

share|improve this question
up vote 10 down vote accepted

Taken from my configfile:

# When is Facebook allowed?
acl allowfacebooktime time MTWHF 12:15-13:45
# Facebook ACL
acl facebookdotcom  dstdomain
# Only allow Facebook as described by allowfacebooktime
http_access allow facebookdotcom allowfacebooktime
# Else block facebook
http_access deny facebookdotcom
share|improve this answer

Squid supports time-base ACLS

Something like this should work:

acl FACEBOOK dst
acl LUNCH time MTWHF 12:30-1:30

http_access allow FACEBOOK LUNCH
http_access deny FACEBOOK

The "FACEBOOK" acl is probably wrong, I'm just making this up as I go :). The above says to allow access to whatever matches the FACEBOOK acl, during the time period matched by the LUNCH acl. It then says to deny access to the FACEBOOK acl as a fall back. Rules are matched in order, so the lunchtime rule has priority.

Squid Wiki page on time ACLS

share|improve this answer

Hello friends my boss called and ordered me deny face facebook in working hours and allowed only in morning 08:00-09:00 so used this acl and apply

acl facebooktime time MTWHF 09:00-10:00
acl FBDomain  dstdomain
http_access allow FBDomain facebooktime
http_access deny  FBDomain

This works properly..

share|improve this answer
Uhhh, your times don't quite match and what does your answer add to the accepted answer? – HBruijn Aug 21 '14 at 13:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.