+ -
当前位置:首页 → 问答吧 → apache 启动问题

apache 启动问题

时间:2010-08-03

来源:互联网

我是新手,准备配置 apache+nagios 系统,现在到了配置文件阶段,apache的httpd.conf文件末尾添加了以下代码后,还有修改apache默认用户为nagios, User  nagios;  Group nagios
添加代码
#setting for nagios
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
     //Cgi文件所在目录
    AuthType Basic
    Options ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "Nagios Access"
    AuthUserFile /usr/local/nagios/etc/htpasswd  //验证文件路径
    Require valid-user

Alias /nagios /usr/local/nagios/share
   //nagios页面文件目录
    AuthType Basic
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "nagios Access"
    AuthUserFile /usr/local/nagios/etc/htpasswd  //验证文件路径
    Require valid-user

再启动httpd 就报错
/usr/local/apache/bin/apachectl start
Syntax error on line 415 of /usr/local/apache/conf/httpd.conf:
AllowOverride not allowed here
/usr/local/apache/bin/apachectl start: httpd could not be started


配置文件里面多处都有诸如上面的AllowOverride  变量类的定义啊,就不知其出错原因了,请大侠们指教。
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "/usr/local/apache/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

<Directory "/usr/local/apache/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

作者: 我不专业   发布时间: 2010-08-03

问题已解决,请版主结贴,谢谢大家的关注。刚学不久,很多知识还不懂,希望在这里可以和那些大侠朋友们多交流

作者: 我不专业   发布时间: 2010-08-05

热门下载

更多