更改设置AllowOverride无为AllowOverride所有 [英] Change AllowOverride None to AllowOverride All

查看:835
本文介绍了更改设置AllowOverride无为AllowOverride所有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这两个文件里面都有相同的code。

  

的/ etc / apache2的/站点启用/ 000默认

     

的/ etc / apache2的/站点可用/默认

我想改变的的AllowOverride无设置AllowOverride全部。 哪一个文件应该更改?

时所有的的AllowOverride无更改为的AllowOverride全部

 <虚拟主机*:80>

    DocumentRoot的/无功/网络/的Drupal
    <目录/>
        有FollowSymLinks
        设置AllowOverride无
    < /目录>
    <目录/ var / WWW / Drupal的>
        选择了FollowSymLinks指标多视图
        设置AllowOverride无
        订购允许,拒绝
        允许所有
    < /目录>

    的ScriptAlias​​ / cgi-bin目录/ / usr / lib目录/ cgi-bin目录/
    <目录/ usr / lib目录/ cgi-bin目录>
        设置AllowOverride无
        选项​​+ ExecCGI -MultiViews + SymLinksIfOwnerMatch
        订购允许,拒绝
        所有允许
    < /目录>

    错误日志$ {APACHE_LOG_DIR} /error.log

    #可能的值包括:调试,信息,通知,警告,错误,暴击,
    #警觉,EMERG。
    日志级别警告

    的CustomLog $ {APACHE_LOG_DIR} /access.log组合

    别名/ DOC /的/ usr /共享/ DOC /
    <目录的/ usr /共享/ DOC />
        选择多视图索引了FollowSymLinks
        设置AllowOverride无
        订单拒绝,允许
        所有拒绝
        从127.0.0.0/255.0.0.0允许:: 1/128
    < /目录>

< /虚拟主机>
 

解决方案
  

在/ etc / apache2的/站点启用/ 000默认

     

在/ etc / apache2的/站点可用/默认

其实这些都不是 2 文件。一个是另一个的符号链接。所以这就是为什么它们是完全一样的。

在sites- 可用只是表明你的系统上有哪些网站。但sites- 启用显示哪一个的都在使用。

所以才改变原来的站点可用,因为它们是同一个文件。是的使用的AllowOverride全部启用下的.htaccess使用<目录/ var / WWW / Drupal的>

您可以使用命令 a2ensite a2dissite 启用和禁用网站,如果您以后添加更多。下面的链接给出了确切的说明,如果你需要做的是,你不应该因为你的网站是活的。

http://manpages.ubuntu.com/manpages/trusty/ man8 / a2ensite.8.html

These two file have the same code inside.

/etc/apache2/sites-enabled/000-default

/etc/apache2/sites-available/default

I would like to change AllowOverride None to AllowOverride All. Which file should I change?

Is all the AllowOverride None change to AllowOverride All?

<VirtualHost *:80>

    DocumentRoot /var/www/drupal
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/drupal>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

解决方案

/etc/apache2/sites-enabled/000-default

/etc/apache2/sites-available/default

Actually these are not 2 files. One is a symlink of the other. So that is why they are exactly the same.

The sites-available just shows which sites you have on your system. But sites-enabled show which one's are in use.

So just change the original in sites-available because they are the same file. And yes use AllowOverride All to enable .htaccess use under <Directory /var/www/drupal> block.

You can use commands a2ensite and a2dissite to enable and disable sites if you add more later. The link below gives exact instructions if you ever need to do that, which you shouldn't since your site is live.

http://manpages.ubuntu.com/manpages/trusty/man8/a2ensite.8.html

这篇关于更改设置AllowOverride无为AllowOverride所有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆