В squid.conf добавил две строчки:
Код:
url_rewrite_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard.conf
url_rewrite_children 3
SquidGuard.conf:
Код:
dbhome /usr/local/squidGuard/db
logdir /usr/local/squidGuard/log
time workhours {
weekly mtwhfas 00:00 - 23:59
}
src admin {
ip 127.0.0.1 192.168.1.2
}
dest good {
}
dest local {
}
dest adult {
domainlist adult/domains
urllist adult/urls
}
dest porn {
domainlist porn/domains
urllist porn/urls
expressionlist porn/expressions
}
acl {
admin {
pass !porn any
}
default {
pass local none
redirect http://admin.foo.bar.de/cgi/blocked?client...group=%t+url=%u
}
}
лог SquidGuard
Код:
bash-3.2$ sudo /usr/local/bin/squidGuard -d
Пароль:
2009-04-11 13:47:41 [13540] New setting: dbhome: /usr/local/squidGuard/db
2009-04-11 13:47:41 [13540] New setting: logdir: /usr/local/squidGuard/log
2009-04-11 13:47:41 [13540] destblock good missing active content, set inactive
2009-04-11 13:47:41 [13540] destblock local missing active content, set inactive
2009-04-11 13:47:41 [13540] init domainlist /usr/local/squidGuard/db/adult/domains
2009-04-11 13:47:41 [13540] loading dbfile /usr/local/squidGuard/db/adult/domains.db
2009-04-11 13:47:41 [13540] init urllist /usr/local/squidGuard/db/adult/urls
2009-04-11 13:47:41 [13540] loading dbfile /usr/local/squidGuard/db/adult/urls.db
2009-04-11 13:47:41 [13540] init domainlist /usr/local/squidGuard/db/porn/domains
2009-04-11 13:47:41 [13540] loading dbfile /usr/local/squidGuard/db/porn/domains.db
2009-04-11 13:47:41 [13540] init urllist /usr/local/squidGuard/db/porn/urls
2009-04-11 13:47:41 [13540] loading dbfile /usr/local/squidGuard/db/porn/urls.db
2009-04-11 13:47:41 [13540] init expressionlist /usr/local/squidGuard/db/porn/expressions
2009-04-11 13:47:41 [13540] squidGuard 1.4 started (1239418061.656)
2009-04-11 13:47:41 [13540] Info: recalculating alarm in 36679 seconds
2009-04-11 13:47:41 [13540] squidGuard ready for requests (1239418061.658)
Лог Squid
Код:
bash-3.2$ sudo squid -d2
bash-3.2$ 2009/04/11 13:50:42| Starting Squid Cache version 2.7.STABLE6 for i686-pc-linux-gnu...
2009/04/11 13:50:42| Process ID 13658
2009/04/11 13:50:42| With 1024 file descriptors available
2009/04/11 13:50:42| Using poll for the IO loop
2009/04/11 13:50:42| Performing DNS Tests...
2009/04/11 13:50:42| Successful DNS name lookup tests...
2009/04/11 13:50:42| DNS Socket created at 0.0.0.0, port 36497, FD 5
2009/04/11 13:50:42| Adding nameserver 192.168.1.1 from /etc/resolv.conf
2009/04/11 13:50:42| helperOpenServers: Starting 10 'squidGuard' processes
2009/04/11 13:50:42| User-Agent logging is disabled.
2009/04/11 13:50:42| Referer logging is disabled.
2009/04/11 13:50:42| logfileOpen: opening log /var/log/squid/access.log
2009/04/11 13:50:42| Unlinkd pipe opened on FD 20
2009/04/11 13:50:42| Swap maxSize 3072000 + 102400 KB, estimated 0 objects
2009/04/11 13:50:42| Target number of buckets: 12209
2009/04/11 13:50:42| Using 16384 Store buckets
2009/04/11 13:50:42| Max Mem size: 102400 KB
2009/04/11 13:50:42| Max Swap size: 3072000 KB
2009/04/11 13:50:42| storeDigestCalcCap: have: 0, want 236307 entries; limits: [1, 236307]
2009/04/11 13:50:42| cacheDigestInit: capacity: 236307 entries, bpe: 5; size: 147692 bytes
2009/04/11 13:50:42| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2009/04/11 13:50:42| logfileOpen: opening log /var/log/squid/store.log
2009/04/11 13:50:42| Rebuilding storage in /home/cache/ (CLEAN)
2009/04/11 13:50:42| Using Least Load store dir selection
2009/04/11 13:50:42| Set Current Directory to /var/cache/squid
2009/04/11 13:50:42| Loaded Icons.
2009/04/11 13:50:42| Accepting proxy HTTP connections at 0.0.0.0, port 3128, FD 22.
2009/04/11 13:50:42| Accepting ICP messages at 0.0.0.0, port 3130, FD 23.
2009/04/11 13:50:42| Accepting HTCP messages on port 4827, FD 24.
2009/04/11 13:50:42| WCCP Disabled.
2009/04/11 13:50:42| WCCPv2 Disabled.
2009/04/11 13:50:42| Ready to serve requests.
2009/04/11 13:50:42| Store rebuilding is 58.4% complete
2009/04/11 13:50:42| Done reading /home/cache/ swaplog (7016 entries)
2009/04/11 13:50:42| xrename: renaming /home/cache//swap.state.new to /home/cache//swap.state
2009/04/11 13:50:42| Finished rebuilding storage from disk.
2009/04/11 13:50:42| 7016 Entries scanned
2009/04/11 13:50:42| 0 Invalid entries.
2009/04/11 13:50:42| 0 With invalid flags.
2009/04/11 13:50:42| 7016 Objects loaded.
2009/04/11 13:50:42| 0 Objects expired.
2009/04/11 13:50:42| 0 Objects cancelled.
2009/04/11 13:50:42| 0 Duplicate URLs purged.
2009/04/11 13:50:42| 0 Swapfile clashes avoided.
2009/04/11 13:50:42| Took 0.8 seconds (9278.7 objects/sec).
2009/04/11 13:50:42| Beginning Validation Procedure
2009/04/11 13:50:42| Completed Validation Procedure
2009/04/11 13:50:42| Validated 7016 Entries
2009/04/11 13:50:42| store_swap_size = 70236k
2009/04/11 13:50:42| storeDigestRebuildStart: rebuild #1
2009/04/11 13:50:42| storeDigestCalcCap: have: 7041, want 7041 entries; limits: [5403, 236307]
2009/04/11 13:50:42| storeDigestResize: 236307 -> 7041; change: 229266 (97%)
2009/04/11 13:50:42| storeDigestResize: big change, resizing.
2009/04/11 13:50:42| cacheDigestInit: capacity: 7041 entries, bpe: 5; size: 4401 bytes
2009/04/11 13:50:42| storeDigestRewriteStart: start rewrite #1
2009/04/11 13:50:42| storeDigestRewriteStart: waiting for rebuild to finish.
2009/04/11 13:50:43| storeLateRelease: released 0 objects
2009/04/11 13:50:43| storeDigestRebuildFinish: done.
2009/04/11 13:50:43| storeDigestRewriteFinish: digest expires at 1239421843 (+3600)
2009/04/11 13:51:14| Parser: retval 1: from 0->28: method 0->2; url 4->17; version 19->27 (1/1)
2009/04/11 13:51:14| The request GET http://sex.ru/ is ALLOWED, because it matched 'localnet'
2009/04/11 13:51:14| peerSourceHashSelectParent: Calculating hash for 192.168.1.2
2009/04/11 13:51:14| The reply for GET http://sex.ru/ is ALLOWED, because it matched 'all'
2009/04/11 13:51:15| Parser: retval 1: from 0->64: method 0->2; url 4->53; version 55->63 (1/1)
2009/04/11 13:51:15| The request GET http://pics.rbc.ru/img/grinf/usd_nal_12060_c_1.gif is ALLOWED, because it matched 'localnet'
2009/04/11 13:51:15| clientCacheHit: refreshCheckHTTPStale returned 0
2009/04/11 13:51:15| clientCacheHit: HIT
2009/04/11 13:51:15| The reply for GET http://pics.rbc.ru/img/grinf/usd_nal_12060_c_1.gif is ALLOWED, because it matched 'all'
2009/04/11 13:51:15| clientReadRequest: FD 26: no data to process ((11) Resource temporarily unavailable)
2009/04/11 13:51:15| Parser: retval 1: from 0->55: method 0->2; url 4->44; version 46->54 (1/1)
2009/04/11 13:51:15| The request GET http://pics.rbc.ru/img/grinf/weather1.gif is ALLOWED, because it matched 'localnet'
2009/04/11 13:51:15| clientCacheHit: refreshCheckHTTPStale returned 0
2009/04/11 13:51:15| clientCacheHit: HIT
2009/04/11 13:51:15| The reply for GET http://pics.rbc.ru/img/grinf/weather1.gif is ALLOWED, because it matched 'all'
2009/04/11 13:51:15| clientReadRequest: FD 26: no data to process ((11) Resource temporarily unavailable)
2009/04/11 13:51:16| clientReadRequest: FD 21: no data to process ((11) Resource temporarily unavailable)