LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Timed access to squid (https://www.linuxquestions.org/questions/linux-server-73/timed-access-to-squid-606210/)

espiya7 12-12-2007 12:51 AM

Timed access to squid
 
Gud afternoon guys! I just installed squid and I've been doin' a lot of experiments on it lately coz I find it really interesting. However, I stumble upon a really cool feature, that is, squid's timed access to users. I am assigned to maintain the proxy server that is setup here in our school and I think, this feature would really help.

The problem is I tried using this code, hoping it would deny connections to the sites inside "timed_sites.txt" from mon-sat 8:30-12:00 and mon-fr 13:30-17:00....

acl timed_sites url_regex "/etc/squid/timed_sites.txt"
acl office_hours_am time MTWHFS 8:30-12:00
acl office_hours_pm time MTWHF 13:30-17:00

http_access deny timed_sites office_hours_am
http_access deny timed_sites office_hours_pm


but it doesn't work... :(

gilead 12-12-2007 06:02 PM

The syntax of your acl and http_access statements is the same as I'm using on a box here - so that shouldn't be the problem. Have you checked the location and format of /etc/squid/timed_sites.txt? The sites should be listed one per line.

Also, the order of the http_access statements is important. Do you have any statements prior to those in your squid.conf file that could already have allowed access?

espiya7 12-21-2007 07:57 PM

my squid rules worked when i used this line

acl timed_sites url_regex "/squid/etc/timed_sites.txt"
acl office_hours time M T W H F S 8:30-12:00 1:30-5:00

http_access deny office_hours timed_sites


however, when i changed the rules so that users will be allowed to access the sites on Saturday afternoon. I used this code:

acl office_hours_am time M T W H F S 8:30-12:00
acl office_hours_pm time M T W H F 13:30-5:00

http_access deny timed_sites office_hours_am
http_access deny timed_sites office_hours_pm

and then did /squid/sbin/squid -k reconfigure

but squid allowed access to timed_sites. Could this be a bug on the side of squid? Btw, these lines were placed on top of other http_access lines so that it would be evaluated first.

espiya7 12-21-2007 08:00 PM

follow-up msg:

I placed the original code back:

acl timed_sites url_regex "/squid/etc/timed_sites.txt"
acl office_hours time M T W H F S 8:30-12:00 1:30-5:00

http_access deny office_hours timed_sites


but still the same thing happened, it still allowed access to timed_sites.

prasanta 12-22-2007 05:35 AM

Quote:

Originally Posted by espiya7
however, when i changed the rules so that users will be allowed to access the sites on Saturday afternoon. I used this code:

Saturday should have been 'A' instead of 'S'.

--
Prasanta


All times are GMT -5. The time now is 11:05 AM.