LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-04-2007, 01:03 PM   #1
mallangong
LQ Newbie
 
Registered: May 2007
Distribution: Debian, Ubuntu
Posts: 9

Rep: Reputation: 0
No leading period (.) in downloaded squid acl


Hi, I've got squid up and running on my home server and I've successfully set up black and white lists of sites I want to block and allow. I'd also like to have an acl that uses a downloaded, updated, list. However, I can't seem to find a list that includes the leading '.' for each line which means that Squid doesn't block any of the sites in the list.

Here's the relevant portion of squid.conf:
acl adult url_regex -i "/etc/squid/shalla_adult.acl"
http_access deny adult

The file shalla_adult.acl is from the shalla list which a Cron job downloads and extracts. The problem is, each line looks like
website.com
instead of
.website.com

Any ideas how I can get round this?

Thanks.
 
Old 09-04-2007, 02:01 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

Code:
sed -i 's/^/./' shalla_adult.acl
will add a '.' to the beginning of every line in the file.

Dave
 
Old 09-04-2007, 06:56 PM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Moved: This thread is more suitable in Linux - Software and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 09-07-2007, 03:54 PM   #4
mallangong
LQ Newbie
 
Registered: May 2007
Distribution: Debian, Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
Brilliant, thank you Dave, I added that to my script and it worked like a charm. Unfortunately, Squid has taken a dislike to the acl file.

With the following in my squid.conf
Code:
acl bad url_regex -i "/etc/squid/blacklist.acl"
http_access deny bad
acl adult url_regex -i "/etc/squid/shalla_adult.acl"
http_access deny adult
I get the following message when trying to start Squid

Code:
bird:~# /etc/init.d/squid start
Starting Squid HTTP proxy: squid/etc/init.d/squid: line 74:  4460 Killed                  
start-stop-daemon --quiet --start --pidfile $PIDFILE --chuid $CHUID --exec $DAEMON -- $SQUID_ARGS </dev/null
 failed!
If I comment out the shalla acl then it works and squid blocks the sites in blacklist.acl.
As soon as I uncomment the adult acl I get the above error.

I can't see any difference between the two files apart from their size. They both have the same permissions. I'm guessing I've done something stupid!

Thanks in advance.
 
Old 09-07-2007, 04:32 PM   #5
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi again.

I'm not an expert on squid, so I can't really comment on the error.

You mention that you added the sed line to your script, though. If that sed line is run on the file repeated times, it will keep adding '.' to the start of each line, so maybe that's why it's failing.

Dave
 
Old 09-08-2007, 05:33 AM   #6
mallangong
LQ Newbie
 
Registered: May 2007
Distribution: Debian, Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
I don't think so, the script downloads the latest shalla list and over-writes the acl file with said list, then it runs the sed line so it's always running on a new file with no '.'s.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
squid acl bypassing shakeeb_linux Linux - Newbie 3 04-01-2007 11:03 AM
Squid acl help cgelectek Linux - Networking 3 11-10-2005 11:04 PM
do i need to ACL in squid.conf... razan Linux - Security 2 04-20-2005 06:42 AM
SQUID: ACL question razametal Linux - Software 1 09-18-2003 07:18 AM
Squid ACL zeroability Linux - Networking 2 01-13-2003 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration