Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a drupal multi-site installation that works great. Since I set it up this has been bugging me and I am trying to work out why this doesnt work.

When I reload apache I get the following error when I have the "Include conf.d/ip.conf" line uncommented:

allow not allowed here
   ...fail!

If I specify the IP addreses as below (they are commented right now) it works!

Any advice or help would be very much grateful (obviously these IP addresses are not the ones I am using).

<Directory "/home/d/r/drupal/web/public_html">
    AllowOverride none

    # Define file limitations on drupal files
    <FilesMatch "(install.php|cron.php|update.php|\.txt)$">
        Order deny,allow
#=================================================================
# THIS DOES NOT WORK? I GET AN ERROR RESTARTING APACHE FOR IP.CONF
        Include conf.d/ip.conf
#=================================================================
# SO I MANUALLY ADD THE IP ADDRESSES HERE:
#Allow from 123.123.123.123
#Allow from 222.222.222.222
#Allow from 555.555.555.555
        Deny from all
    </FilesMatch>

   <FilesMatch "robots.txt">
      Allow from all
   </FilesMatch>

    # Read in Drupal default .htaccess file asif conf - easier CVS management
    Include /home/d/r/drupal/web/public_html/.htaccess

        # Offline mode for multisite setup - see file for more info
        # Uncomment the line below to set sites offline
    # Include conf.d/offline.conf

</Directory>

# Sorry, no svn peeking
<DirectoryMatch "\.svn">
    # Currently pointing back to drupal
    # High traffic sites might want custom
    # error pages, no need to load drupal
    ErrorDocument 403 /index.php
    Order allow,deny
    Deny from all
    Satisfy All
</DirectoryMatch>

# Allow the .htacces files to be used in the sites folder where /files are stored
<Directory "/home/d/r/drupal/web/public_html/sites">
    AllowOverride
</Directory>

ip.conf looks like this:

Allow from 123.123.123.123
Allow from 222.222.222.222
Allow from 555.555.555.555
share|improve this question
    
I found the problem, my apache2.conf was including * files in conf.d which is where I have located the drupal6.conf. This was the reason for the error as it was being loaded by itself! –  belliez Jan 26 '10 at 0:09
1  
Could you please re-post that as an answer and accept it? –  200_success Jun 20 '10 at 13:53

1 Answer 1

This problem was caused because apache2.conf was loading all of the files in conf.d (include conf.d/*) which meant that ip.conf was being loaded in the wrong place. This meant that the allow from statements where being processed out of context.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.