Change AllowOverride None to AllowOverride All

2019-09-10 06:39发布

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>

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-09-10 07:13

/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

查看更多
登录 后发表回答