Forum Moderators: phranque

Message Too Old, No Replies

IP separation in mod_access

How to seperate the specific IP addresses in mod_access

         

dpoperngr

6:36 pm on Jun 28, 2005 (gmt 0)

10+ Year Member



I've never done a mod_access before and need to deny specific IPs access. So, if I want to catalogue them and enter each one into the mod_access how do I separate them, commas?

ie: deny from 000.00.00.0,000.01.00.0,201.200.00.0

jdMorgan

10:48 pm on Jul 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



dpoperngr,

Welcome to WebmasterWorld!

You can use spaces to separate individual IP addresses.


Deny from 000.00.00.0 000.01.00.0 201.200.00.0

And by all means, try to use ranges when possible to combine contiguous IP addresses and keep your filesize smaller.

Jim

dpoperngr

1:51 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



jd, I've tried several syntaxes for the command and don't seem to be able to get it right because its not blocking the IPs. I've tried a continuous string seperated by spaces, stacking the IPs with carraige returns.

Both of these have not worked:

<Files *>
order deny,allow
deny from 24.97.174.130 62.245.231.130 65.165.84.11
</Files>
<Files .htaccess>
deny from all
</Files>

order deny/allow
deny from 24.97.174.130 62.245.231.130 65.165.84.11
allow from all

jdMorgan

7:16 pm on Jul 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about trying the simplest format, one IP at a time?

<Files *>
Order Deny,Allow
Deny from 24.997.174.130
Deny from 62.945.231.130
Deny from 65.965.84.11
</Files>
<Files .htaccess>
deny from all
</Files>

If that does not work, contact your host and ask them if mod_access is loaded and available to you.

Note: IP addresses have been obscured.

Jim

dpoperngr

1:27 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



Thanks JD, your format is simpler in that it doesn't require a long string of IPs separated by spaces.

I'm confused, is the <file> open and closure necessary ie:
<file *>
</file>

jdMorgan

6:19 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The <Files> containers are needed because you have defined two different cases; the ".htaccess file" case and the "all other files" case. Without the containers, mod_access would accept the last directives found, and deny access to all files.

Jim

dpoperngr

2:22 pm on Jul 8, 2005 (gmt 0)

10+ Year Member



jd, the * is a substitute for "all" right?

jdMorgan

7:52 pm on Jul 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check here: [httpd.apache.org...]

Jim