ways to apply a directory restriction to multiple IP addresses; aliases in httpd.conf?

Giganews Newsgroups
Subject: ways to apply a directory restriction to multiple IP addresses; aliases in httpd.conf?
Posted by:  Rahul (nospam@nospam.invalid)
Date: Fri, 3 Jul 2009

Is there a way to set an alias for a group of IP addresses rather than
list them explicityly each time?

Here's my situation:

I need to restrict access to only allow a list of specific IP addresses
to access a set of directories. Currently this (see below for a snippet
from http.conf) is how I do it for two directories and *the same set* of
4 IP addresses. But it gets tedious to copy the block of IP addresses
each time (and more error prone for uptating).

Is there a better metaphor?

Alternatively is there a way to apply a directory block to multiple
directories together?

<Directory /home/foouser/public_html/wiki>
    <Limit GET POST OPTIONS>
        order deny,allow
        deny from all
        allow from 128.154.x.34
        allow from 128.134.143.35
        allow from 128.124.138.19
        allow from 128.166.176.234
    </Limit>
</Directory>

<Directory /home/foouser/public_html/similie_mit/galaxy_nodes>
    <Limit GET POST OPTIONS>
        order deny,allow
        deny from all
        allow from 128.154.x.34
        allow from 128.134.143.35
        allow from 128.124.138.19
        allow from 128.166.176.234
    </Limit>
</Directory>

--
Rahul

Replies