G J Piper
Regular Pleskian
TITLE:
Can't Disable .htaccess Parsing Completely in Apache
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:Plesk Onyx 17.8.11 mu#(any?)
Apache 2.4.6
Nginx 1.13.8 (proxy)
CentOS 7.5.1804
PROBLEM DESCRIPTION:Apache 2.4.6
Nginx 1.13.8 (proxy)
CentOS 7.5.1804
Because the "includes" code in each domain's httpd.conf file falls before the document root declaration for AllowOverride, .htaccess file parsing cannot be prevented through the file system using the GUI.
STEPS TO REPRODUCE:Place this code in the "Additional directives for HTTPS" in "Apache & Nginx Settings" in a domain subscription settings:
Then put an .htaccess file with this code in it in the root directory of the domain:
ACTUAL RESULT:
Code:
<Directory /var/www/vhosts/exampledomain.com/httpdocs>
AllowOverride None
AllowOverrideList None
Options None
</Directory>
Then put an .htaccess file with this code in it in the root directory of the domain:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
A server error is thrown if there is code in the .htaccess file, because Apache is still parsing it and my "AllowOverrideList none" says no code is allowed in .htaccess files. But, my "AllowOverride none" should be preventing Apache from even looking at .htaccess files (according to Apache 2.4 documentation)
The Apache 2.4 AllowOverrideList docs say this, specifically:
"When this directive is set to None and AllowOverride is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem."
EXPECTED RESULT:The Apache 2.4 AllowOverrideList docs say this, specifically:
"When this directive is set to None and AllowOverride is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem."
.htaccess file is ignored, and not even searched for by Apache, due to this code in my settings:
ANY ADDITIONAL INFORMATION:
Code:
<Directory /var/www/vhosts/exampledomain.com/httpdocs>
AllowOverride None
AllowOverrideList None
Options None
</Directory>
The includes directive in the Plesk-generated httpd.conf settings should come after the directory code in this snip from the "/var/www/vhosts/system/exampledomain.com/conf/httpd.conf" file:
This way my AllowOverride directive in the GUI will successfully override the server default (Plesk) settings in the httpd.conf file.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:
Code:
Include "/var/www/vhosts/system/exampledomain.com/conf/vhost_ssl.conf"
<Directory /var/www/vhosts/exampledomain.com>
AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,SymLinksIfOwnerMatch,MultiViews,FollowSymLinks,ExecCGI,Includes,IncludesNOEXEC
</Directory>
This way my AllowOverride directive in the GUI will successfully override the server default (Plesk) settings in the httpd.conf file.
Confirm bug
Last edited: