You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Leonardo M. Ramé" <ma...@yahoo.com> on 2011/11/06 22:16:10 UTC
Re: [users@httpd] Blocking referer problem
>________________________________
>From: Yehuda Katz <ye...@ymkatz.net>
>To: users@httpd.apache.org; Leonardo M. Ramé <ma...@yahoo.com>
>Sent: Saturday, October 29, 2011 11:44 PM
>Subject: Re: [users@httpd] Blocking referer problem
>
>
>2011/10/29 Leonardo M. Ramé <ma...@yahoo.com>
>
>
>>Knowing this, I found by googling, that I can block referers by adding this to my .htaccess file:
>>
>>RewriteEngine on
>>RewriteCond %{HTTP_REFERER} st\.ac\.th [NC,OR]
>>RewriteCond %{HTTP_REFERER} clubmedia-ent\.com [NC,OR]
>>RewriteCond %{HTTP_REFERER} multidicona\.com [NC]
>>RewriteRule ^ - [F]
>>
>>
>Your RewriteRule does not match any requests. Try
>RewriteRule .* - [F]
>
>After changing it, I did a "apachectl restart".
>>
>You do not need to restart after changing the htaccess.
>
Hi, after replacing the rule by your suggestion, I stopped checking my error logs, until today. It seems the rule is not blocking the referers I need to.
This is an extract of the site-error_log of one site:
[Sat Nov 05 21:11:05 2011] [error] [client 176.14.112.166] File does not exist: /usr/local/www/apache22/data/site/gallery2, referer: http://clubmedia-ent.com/film/contact.html
[Sat Nov 05 22:46:37 2011] [error] [client 95.27.181.153] File does not exist: /usr/local/www/apache22/data/site/gallery2, referer: http://multidicona.com/
[Sun Nov 06 12:07:29 2011] [error] [client 95.26.196.133] File does not exist: /usr/local/www/apache22/data/site/gallery2, referer: http://multidicona.com/
[Sun Nov 06 12:07:53 2011] [error] [client 95.25.98.97] File does not exist: /usr/local/www/apache22/data/site/gallery2, referer: http://www.multidicona.com/electronica.html
I want to get rid of the attacks from "clubmedia-ent.com" and "www.multidicona.com", how can I block these?.
This is the .htaccess for the site:
RewriteEngine on
RewriteCond %{HTTP_REFERER} st\.ac\.th [NC,OR]
RewriteCond %{HTTP_REFERER} clubmedia-ent\.com [NC,OR]
RewriteCond %{HTTP_REFERER} multidicona\.com [NC]
RewriteRule .* - [F]
Thanks in advance,Leonardo M. Ramé
http://leonardorame.blogspot.com
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Blocking referer problem
Posted by Michael Prieß <ma...@googlemail.com>.
Hello,
maybe this project is interesting for you.
http://www.fail2ban.org/wiki/index.php/Main_Page
Cheers,
Michael
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Blocking referer problem
Posted by Yehuda Katz <ye...@ymkatz.net>.
2011/11/6 Leonardo M. Ramé <ma...@yahoo.com>
> >________________________________
> >From: Yehuda Katz <ye...@ymkatz.net>
> >To: users@httpd.apache.org; Leonardo M. Ramé <ma...@yahoo.com>
> >Sent: Saturday, October 29, 2011 11:44 PM
> >Subject: Re: [users@httpd] Blocking referer problem
> >
> >
> >2011/10/29 Leonardo M. Ramé <ma...@yahoo.com>
> >
> >
> >>Knowing this, I found by googling, that I can block referers by adding
> this to my .htaccess file:
> >>
> >>RewriteEngine on
> >>RewriteCond %{HTTP_REFERER} st\.ac\.th [NC,OR]
> >>RewriteCond %{HTTP_REFERER} clubmedia-ent\.com [NC,OR]
> >>RewriteCond %{HTTP_REFERER} multidicona\.com [NC]
> >>RewriteRule ^ - [F]
> >>
> >>
> >Your RewriteRule does not match any requests. Try
> >RewriteRule .* - [F]
> >
> >After changing it, I did a "apachectl restart".
> >>
> >You do not need to restart after changing the htaccess.
> >
>
>
> Hi, after replacing the rule by your suggestion, I stopped checking my
> error logs, until today. It seems the rule is not blocking the referers I
> need to.
>
> This is an extract of the site-error_log of one site:
>
> [Sat Nov 05 21:11:05 2011] [error] [client 176.14.112.166] File does not
> exist: /usr/local/www/apache22/data/site/gallery2, referer:
> http://clubmedia-ent.com/film/contact.html
> [Sat Nov 05 22:46:37 2011] [error] [client 95.27.181.153] File does not
> exist: /usr/local/www/apache22/data/site/gallery2, referer:
> http://multidicona.com/
> [Sun Nov 06 12:07:29 2011] [error] [client 95.26.196.133] File does not
> exist: /usr/local/www/apache22/data/site/gallery2, referer:
> http://multidicona.com/
> [Sun Nov 06 12:07:53 2011] [error] [client 95.25.98.97] File does not
> exist: /usr/local/www/apache22/data/site/gallery2, referer:
> http://www.multidicona.com/electronica.html
>
> I want to get rid of the attacks from "clubmedia-ent.com" and "
> www.multidicona.com", how can I block these?.
>
> This is the .htaccess for the site:
>
> RewriteEngine on
> RewriteCond %{HTTP_REFERER} st\.ac\.th [NC,OR]
> RewriteCond %{HTTP_REFERER} clubmedia-ent\.com [NC,OR]
> RewriteCond %{HTTP_REFERER} multidicona\.com [NC]
> RewriteRule .* - [F]
>
At a glance those look correct.
This site has several examples:
http://www.javascriptkit.com/howto/htaccess14.shtml
If you have access to the vhost config to turn on RewriteLog, that might
help you see why the pattern is not working.