On Sat, 2003-12-20 at 20:29, Randal L. Schwartz wrote:
> >>>>> "Fred" == Fred Moyer <[EMAIL PROTECTED]> writes:
>
> Fred> < =head2 Blocking IP Addresses
> Fred> <
> Fred> < The following rewrite code blocks IP addresses:
> Fred> <
> Fred> < RewriteCond /web/site/var/blocked/REMOTE_ADDR-%{REMOTE_ADDR} -f
> Fred> < RewriteRule .* http://YOUR-HOST-BLOCKED-FOR-EXCESSIVE-CONSUMPTION
> Fred> [redirect,last]
> Fred> <
> Fred> < To block IP address 10.1.2.3, simply touch
> Fred> <
> Fred> < /web/site/var/blocked/REMOTE_ADDR-10.1.2.3
> Fred> <
> Fred> < This has an advantage over Apache parsing a long file of addresses in
> Fred> that the OS is better at a file lookup.
>
> Hey, that looks familiar. Do I get credit? :)
I'm not familiar with the protocol regarding credit for the mod_perl
documentation but this updated patch gives credit to the contributors :)
1656,1659d1655
< Example code for using mod_rewrite with mod_perl application servers. Several
examples were taken from the mailing list.
<
< =head2 Rewriting Requests Based on File Extension
<
1693c1689
< =head2 Internet Exporer 5 favicon.ico 404
---
> More examples:
1699,1700d1694
< =head2 Hiding Extensions for Dynamic Pages
<
1705,1706d1698
< =head2 Serving Static Content Locally and Rewriting Everything Else
<
1749,1777d1740
< =head2 Upgrading mod_perl Heavy Application Instances
<
< Contributed to the mailing list on 12/18/03 by Rob Nagler
< When using a light/heavy separation method one of the challenges of running a
production environment is being able to upgrade to newer versions of mod_perl or your
own application. The following method can be used without having to do a server
restart.
<
< Add the following rewrite rule to your httpd.conf file:
<
< RewriteEngine On
< RewriteMap maps txt:/etc/httpd.maps
< RewriteRule ^(.*) http://${maps:appserver}$1 [proxy]
<
< Create the file /etc/httpd.maps and add the following entry:
<
< appserver foo.com:9999
<
< Mod_rewrite rereads (or checks the mtime of) the file on every request so the change
takes effect immediately. To seamlessly upgrade your application server to a new
version, install a new version on a different port. After checking for a quality
installation, edit /etc/httpd.maps to point to the new server. After the file is
written the next request the server processes will be redirected to the new
installation.
<
< =head2 Blocking IP Addresses
<
< Contributed to the mailing list on 12/18/03 by Randal L. Schwartz
< The following rewrite code blocks IP addresses:
<
< RewriteCond /web/site/var/blocked/REMOTE_ADDR-%{REMOTE_ADDR} -f
< RewriteRule .* http://YOUR-HOST-BLOCKED-FOR-EXCESSIVE-CONSUMPTION [redirect,last]
<
< To block IP address 10.1.2.3, simply touch
<
< /web/site/var/blocked/REMOTE_ADDR-10.1.2.3
<
< This has an advantage over Apache parsing a long file of addresses in that the OS is
better at a file lookup.
<
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html