Linuxtrent: Re: Squid

  • From: Diaolin (Natali Giuliano) <diaolin@xxxxxxxxxxx>
  • To: linuxtrent@xxxxxxxxxxxxx
  • Date: Tue, 25 Sep 2001 23:19:36 +0200

Il 23:04, martedì 25 settembre 2001, Mattia Martinello con un sussurro che 
toglie il fiato scrive:
> Ho fatto così...
> Se metto (per prova) una direttiva "http_access allow sex" tutto funziona,
> ma se metto la direttiva (che è quella che effettivamente mi serve)
se metti una direttiva http_access allow sex non funziona un tubo perche' in 
pratica ti serve il contrario.
>
> deny_info ERR_NO_PORNO porno
> http_access deny porno
>
> quando cerco di accedere ad un indirizzo che contiene una delle parole che
> ho specificato mi dà errore 403...
va beh ma hai creato un file che identifica ERR_no_PORNO?
Tratto dalle FAQ di squid
############################
10.24 I want to customize, or make my own error messages. 

You can customize the existing error messages as described in Customizable 
Error Messages. You can also create new error messages and use these in 
conjunction with the deny_info option. 

For example, lets say you want your users to see a special message when they 
request something that matches your pornography list. First, create a file 
named ERR_NO_PORNO in the /usr/local/squid/etc/errors directory. That file 
might contain something like this: 
<p>
Our company policy is to deny requests to known porno sites.  If you
feel you've received this message in error, please contact 
the support staff (support@xxxxxxxxxxxxxxxx, 555-1234).


Next, set up your access controls as follows: 
acl porn url_regex "/usr/local/squid/etc/porno.txt"
deny_info ERR_NO_PORNO porn
http_access deny porn
(additional http_access lines ...)
############################
Continua................

19.10 Customizable Error Messages 

Squid-2 lets you customize your error messages. The source distribution 
includes error messages in different languages. You can select the language 
with the configure option: 
        --enable-err-language=lang
Furthermore, you can rewrite the error message template files if you like. 
This list describes the tags which Squid will insert into the messages: 

%B
URL with FTP %2f hack 
%c
Squid error code 
%d
seconds elapsed since request received 
%e
errno 
%E
strerror() 
%f
FTP request line 
%F
FTP reply line 
%g
FTP server message 
%h
cache hostname 
%H
server host name 
%i
client IP address 
%I
server IP address 
%L
contents of err_html_text config option 
%M
Request Method 
%p
URL port \# 
%P
Protocol 
%R
Full HTTP Request 
%S
squid signature from ERR_SIGNATURE 
%s
caching proxy software with version 
%t
local time 
%T
UTC 
%U
URL without password 
%u
URL without password, %2f added to path 
%w
cachemgr email address 
%z
dns server error message 
#############################################
Altro non so, comunque, la direttiva url_regex funziona o no?
Diaolin


-- 
Computers are the logical consequence of mans development:
Intelligence without morality. - John Osborne 




-- 
PROSSIMA ASSEMBLEA: venerdi` 28 settembre 2001 20:30 a Madrano di Pergine.

Per iscriversi  (o disiscriversi), basta spedire un  messaggio con SOGGETTO
"subscribe" (o "unsubscribe") a mailto:linuxtrent-request@xxxxxxxxxxxxxxxxx


Other related posts: