
У меня есть многосайтовая установка Drupal, которая отлично работает. С тех пор, как я ее настроил, это меня беспокоит, и я пытаюсь понять, почему это не работает.
При перезагрузке Apache я получаю следующую ошибку, если строка «Include conf.d/ip.conf» не закомментирована:
allow not allowed here
...fail!
Если я укажу IP-адреса, как показано ниже (они сейчас прокомментированы), то все работает!
Буду очень признателен за любой совет или помощь (очевидно, что это не те IP-адреса, которые я использую).
<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 выглядит так:
Allow from 123.123.123.123
Allow from 222.222.222.222
Allow from 555.555.555.555
решение1
Эта проблема была вызвана тем, что apache2.conf загружал все файлы в conf.d (включая conf.d/*), что означало, что ip.conf загружался в неправильном месте. Это означало, что операторы allow from
обрабатывались вне контекста.