• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    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.

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