• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Where to set AllowOverride for virtualhost

bsssrl

New Pleskian
I need to set .htaccess in a specific folder in order to set Access-Control-Allow-Origin. This .htaccess is ignored. So I've to AllowOverride in apache configuration.
I tried in /etc/apache2/apache2.conf under <Directory /var/www/> and in /var/www/vhosts/system/{myhost}/conf/httpd.conf under <Directory /var/www/vhosts/{myhost}/httpdocs.
I also tried to create custom.conf file in /etc/apache2/ and /var/www/vhosts/system/{myhost}/conf/ with:

<Directory /var/www/vhosts/{myhost}/httpdocs>
AllowOverride All
</Directory>

But it is ignored. Where I can set AllowOverride for a vhost?
 
/etc/apache2/conf.d/ or /etc/httpd/conf.d/ doesn't exist, and creating conf.d and a .conf file inside those folders has no effect.
Under /etc/apache2 exists also apache2.conf. Editing directly this file has no effect.

However in /var/www/vhosts/system/{myhost}/conf/httpd.conf is specified to not directly edit the file, but instead to create /var/www/vhosts/system/{myhost}/conf/vhost.conf and /var/www/vhosts/system/{myhost}/conf/vhost_ssl.conf. So I copied from that kb and pasted into those files:



AccessFileName .htaccess

<Directory "/var/www/vhosts">
Options +All
AllowOverride All
Order allow,deny
Allow from all
</Directory>

But nothing.

On plesk 11 I used to solve similar problems editing /etc/apache2/apache2.conf.

Seeing response from server with plesk 12 seems that http server is not apache but nginx. So the real problem is to properly configure nginx (that I don't know) or to just use apache like on plesk 11.

Solved going under Website and Domains > MyDomain > Web server settings and adding directive:

location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js|html|xhtml)$ {
add_header Access-Control-Allow-Origin "*";
}

Also disabling Smart static files processing is a solution in my case.
 
Last edited:
Back
Top