LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-15-2011, 05:20 PM   #1
alain1988
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Rep: Reputation: Disabled
Lightbulb Squid Block a website using a file


i have set up a squid proxy now i want to block sites using a text file like this
/etc/squid/block_social_sites.txt

all the websites in the files should be blocked

this is my squid configuration

PHP Code:
#Turn logging to it's lowest level
debug_options ALL,1

#defines a group (or Access Control List) that includes all IP
#addresses
acl all src 0.0.0.0/0.0.0.0

#allow all sites to use connect to us via HTTP
http_access allow  all

#allow all sites to use us as a sibling
icp_access  allow  all

cache_effective_user nobody nogroup 
thanks in advance
 
Old 10-15-2011, 05:38 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Welcome to LQ!!!

Here is the link which will help you out: http://www.cyberciti.biz/faq/squid-c...r-block-files/
 
Old 10-15-2011, 07:21 PM   #3
alain1988
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
thanks for the fast reply
 
Old 10-16-2011, 06:38 AM   #4
alain1988
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
debug

i have run sqduid in debug mode and i get this error

PHP Code:
root@dccontroller:/home/alain# squid -NCd10
WARNINGCannot write log file: /var/log/squid/cache.log
/var/log/squid/cache.logPermission denied
         messages will be sent to 
'stderr'.
2011/10/16 03:19:13WARNINGClosing open FD    2
2011
/10/16 03:19:13Starting Squid Cache version 2.7.STABLE7 for i386-debian-linux-gnu...
2011/10/16 03:19:13Process ID 2805
2011
/10/16 03:19:13With 1024 file descriptors available
2011
/10/16 03:19:13Using epoll for the IO loop
2011
/10/16 03:19:13Performing DNS Tests...
2011/10/16 03:19:13Successful DNS name lookup tests...
2011/10/16 03:19:13DNS Socket created at 0.0.0.0port 44775FD 6
2011
/10/16 03:19:13Adding nameserver 195.130.130.5 from /etc/resolv.conf
2011
/10/16 03:19:13Adding nameserver 195.130.131.5 from /etc/resolv.conf
2011
/10/16 03:19:13Adding domain telenet.be from /etc/resolv.conf
2011
/10/16 03:19:13Adding domain telenet.be from /etc/resolv.conf
2011
/10/16 03:19:13User-Agent logging is disabled.
2011/10/16 03:19:13Referer logging is disabled.
2011/10/16 03:19:13Unlinkd pipe opened on FD 10
2011
/10/16 03:19:13Swap maxSize 102400 8192 KBestimated 8507 objects
2011
/10/16 03:19:13Target number of buckets425
2011
/10/16 03:19:13Using 8192 Store buckets
2011
/10/16 03:19:13Max Mem  size8192 KB
2011
/10/16 03:19:13Max Swap size102400 KB
2011
/10/16 03:19:13Local cache digest enabledrebuild/rewrite every 3600/3600 sec
2011
/10/16 03:19:13logfileOpenopening log /var/log/squid/store.log
FATAL
Cannot open '/var/log/squid/store.log' for writing.
        
The parent directory must be writeable by the
        user 
'nobody'which is the cache_effective_user
        set in squid
.conf.
Squid Cache (Version 2.7.STABLE7): Terminated abnormally.
CPU Usage0.000 seconds 0.000 user 0.000 sys
Maximum Resident Size
14240 KB
Page faults with physical i
/o0
Afgebroken
root
@dccontroller:/home/alain
do you have any idees how to fix them
 
Old 10-16-2011, 08:20 AM   #5
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Type the following command and that should fix:

1.
Code:
chown nobody:nobody /var/log/squid
2.
Code:
chmod -R 770 /var/log/squid
 
Old 10-20-2011, 06:28 AM   #6
alain1988
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by T3RM1NVT0R View Post
Type the following command and that should fix:

1.
Code:
chown nobody:nobody /var/log/squid
2.
Code:
chmod -R 770 /var/log/squid

ok i got ik fixed i just had to modify the user the specefied user did not have the rights
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 server how to block https:www.website.com aliabbass Linux - Server 4 10-01-2011 01:45 PM
How to Block(deny) perticuler website in certain times of the day , by using squid ? linuxcolor Linux - Server 7 07-04-2009 09:55 PM
unable to block all website except www.onlinesbi.com in squid nirmal1100 Linux - Newbie 0 03-30-2009 04:53 AM
block *.* file download using squid soumalya Linux - Security 6 12-21-2006 02:51 AM
How to block a Website in Squid winxlinx Linux - Networking 1 02-21-2006 04:40 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration