httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JM Fraser" <...@cybertrex.co.uk>
Subject Re: [users@httpd] How to create a "hosts deny" list for Apache
Date Thu, 13 Jan 2005 12:27:51 GMT
This is exactly what I intend. Can I also port this over to a Mysql
database which would be easier to update?


On 12:18:36 January 13, 2005 Dick Davies <rasputnik@hellooperator.net> wrote:
> * JM Fraser <jmf@cybertrex.co.uk> [0113 11:13]:
> >  Eric, could I have a .htaccess file with:
> >
> >  Order deny,allow
> >  Allow From All
> >  Deny From /tmp/hosts_deny
> >
> >
> >  For example. This way all hosts listed in this "hosts_deny" file
> >  will be denied access but everyone else will get thru? Will I have
> >  to setup a specific directive around this?
> >
>
> Why don't you just put the ranges you're going to specify in
> /tmp/hosts_deny into the .htaccess (prefixed by 'Deny From', of
> course)?
> Apache will read a .htaccess for each request (that's the point of
> them), so you can just edit the .htaccess file to add/remove
> changes without needing to restart apache (I'm assuming thats why you
> want a separate file).
>
> >  On 11:05:31 January 13, 2005 Grand Apeiron <Grand.Apeiron@gmx.net>
> > >  wrote: On Thu, 2005-01-13 at 10:38 +0000, JM Fraser wrote:
> > > >   Eric, do you have an example script that I could modify, or a
> > > >   site where I could get info? I don't want to end up
> > > >   terminating all httpd requests in error!
> > >
> > >  You only need a script if you want to modify the access list in
> > >  an automatic way.
> > >  The basic thing to deny/allow access to your site is the
> > >  .htaccess file itself.
> > >
> > >  To deny access to everyone by default and only allow access for
> > >  some specific hosts/subnets your .htaccess file would look like:
> > >
> > >  Order deny,allow
> > >
> > >  Deny From All
> > >  Allow From x.x.x.x
> > >  Allow From x.x.x.x
> > >
> > >
> > >  So, one "Allow From" line for every host or subnet you want to
> > >  allow your site.
> > >
> > >  You may read the documentation for the <Directory> directive in
> > >  the apache2 docs.
> > >
> > >
> > >  Grand Apeiron
> > >
> > >  --
> > >  If I would be a tapeworm, I would prefer penguins.
> > >
> > >
> > >  -----------------------------------------------------------------
> > > ----
> > >  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
> > >
> >
> >
> >  -------------------------------------------------------------------
> > --
> >  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
> >
>
> --
> 'With that big new contract, I've been able to make those government
> mandated upgrades you've all been suing me about.'
>         -- Prof. Farnsworth
> Rasputin :: Jack of All Trades - Master of Nuns
>
> ---------------------------------------------------------------------
> 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
>


---------------------------------------------------------------------
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


Mime
View raw message