Apache AllowOverride None not working

In my system Settings/Server Templates I have created a new template with the following extra to apache:

<Directory ${HOME}/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
# Disable htaccess starting at web root (Should be by default set to None)
AllowOverride None
</Directory>

When I create a virtual server with this template, those options are added automaticaly by virtualmin to the directive and htaccess file is read by apache:

AllowOverride None Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

How can I disable the use .htaccess in apache2?

Thanks in advance.

Michel.

Status: 
Active

Comments

Doesn't AllowOverride None Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch result in no .htaccess directives being used? The Options= part should effectively do nothing.

Hi. Scenario I have created:

  1. Create a new template with this setting in (Directives and settings for new website: ServerName ${DOM}
    ServerAlias www.${DOM}
    DocumentRoot ${HOME}/public_html
    ErrorLog /var/log/virtualmin/${DOM}_error_log
    CustomLog /var/log/virtualmin/${DOM}_access_log combined
    ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
    DirectoryIndex index.html index.htm index.php index.php4 index.php5
    <Directory ${HOME}/public_html>
    Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
    allow from all
    AllowOverride None
    </Directory>
    <Directory ${HOME}/cgi-bin>
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    </Directory>
  2. Those are the directives for apache generated by virtualmin: SuexecUserGroup "#1013" "#1013"
    ServerName dr7.auxe.net
    ServerAlias www.dr7.auxe.net
    ServerAlias webmail.dr7.auxe.net
    ServerAlias admin.dr7.auxe.net
    DocumentRoot /home/dr7/public_html
    ErrorLog /var/log/virtualmin/dr7.auxe.net_error_log
    CustomLog /var/log/virtualmin/dr7.auxe.net_access_log combined
    ScriptAlias /cgi-bin/ /home/dr7/cgi-bin/
    DirectoryIndex index.html index.htm index.php index.php4 index.php5
    <Directory /home/dr7/public_html>
    Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
    allow from all
    AllowOverride None Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
    AddType application/x-httpd-php .php
    AddHandler fcgid-script .php
    AddHandler fcgid-script .php5.6
    AddHandler fcgid-script .php7.0
    AddHandler fcgid-script .php7.1
    FCGIWrapper /home/dr7/fcgi-bin/php7.1.fcgi .php
    FCGIWrapper /home/dr7/fcgi-bin/php5.6.fcgi .php5.6
    FCGIWrapper /home/dr7/fcgi-bin/php7.0.fcgi .php7.0
    FCGIWrapper /home/dr7/fcgi-bin/php7.1.fcgi .php7.1
    </Directory>
    <Directory /home/dr7/cgi-bin>
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
    </Directory>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} =webmail.dr7.auxe.net
    RewriteRule ^(.*) https://dr7.auxe.net:20000/ [R]
    RewriteCond %{HTTP_HOST} =admin.dr7.auxe.net
    RewriteRule ^(.*) https://dr7.auxe.net:10000/ [R]
    RemoveHandler .php
    RemoveHandler .php5.6
    RemoveHandler .php7.0
    RemoveHandler .php7.1
    php_admin_value engine Off
    FcgidMaxRequestLen 1073741824
  3. I have created a file .htaccess in the public_html directory with some text in it (just to get an error if apache read it)
  4. Apache give an error because it was reading the file .htaccess: Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.

    Apache Server at dr7.auxe.net Port 80

So at this point I am asking 2 questions:

  1. Is there a bug in apache that consider a directive AllowOverride with options as it is All instead of None?
  2. Why virtualmin generate a full list of options if not required in the template?

Thank you, Michel.

It seems odd to me that Apache would behave in this way - I'd expect that using None means that nothing is allowed in the .htaccess file, regardless of which specific Option types are allowed.

What do you suggest me to do to resolve this matter?