首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当指定包含Conf文件时,Apache conf失败。

当指定包含Conf文件时,Apache conf失败。
EN

Server Fault用户
提问于 2010-01-25 23:59:17
回答 1查看 584关注 0票数 1

我有一个drupal多站点安装,工作很好。自从我设置它,这一直困扰着我,我正在努力找出为什么这不工作。

当我重新加载apache时,当我没有注释的"Include con.d/ip.conf“行时,我会得到以下错误:

代码语言:javascript
复制
allow not allowed here
   ...fail!

如果我指定IP地址如下(他们现在被评论),它工作!

任何建议或帮助都将是非常感激的(显然这些IP地址不是我使用的)。

代码语言:javascript
复制
<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看起来是这样的:

代码语言:javascript
复制
Allow from 123.123.123.123
Allow from 222.222.222.222
Allow from 555.555.555.555
EN

回答 1

Server Fault用户

发布于 2011-12-25 18:12:46

造成此问题的原因是apache2.conf正在加载con.d(包括con.d/*)中的所有文件,这意味着ip.conf加载到了错误的位置。这意味着在上下文之外处理的allow from语句。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/106258

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档