• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Step by step guide to install and integrate Varnish with Plesk 12.x

elemental.tm

Basic Pleskian
Hi,

I have searched this forum and the internet in general and have been unable to find a definitive guide on how to install, configure and integrate Varnish with Plesk 12.x, Nginx, Apache, PHP-FPM and APC.
Do Virtual Hosts Settings need to be configured Using Configuration Templates?

It would be great if someone from Parallels or a super users could create an 'official guide' for the perfect solution in a step by step guide.

I'm using Debian 7.6 but I assume any guide would be fairly universal.

Any takers?, thanks in advance.
 
Last edited:
Plesk uses per-domain .php template files to generate the full '/etc/nginx/nginx.conf' and '/etc/httpd/conf/httpd.conf' server configurations files. If you follow the instructions contained in @IgorG's link, you'll probably run into a situation where your direct edits to the nginx.conf or httpd.conf files will conflict with the directives coming from the per-domain .php template includes.

You may want to consider editing the .php templates directly. The default templates for httpd.conf and ngnix.conf are:
  1. /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php,
  2. /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php
Do not edit the original .php files that already exist in the /usr/local/psa/admin/conf/default/domain/ folder. Instead, create a directory path that looks like this: /usr/local/psa/admin/conf/custom/domain. Duplicate the specific .php file(s) that you need to edit and copy it to the /custom/domain/ folder.

The two template files are available online as well:
http://autoinstall.plesk.com/PSA_11.0.9/microupdates/MU9/common/nginxDomainVirtualHost.php
http://autoinstall.plesk.com/PSA_11.0.9/microupdates/MU15/common/default/domainVirtualHost.php

You have to figure out the conditional logic so that the template will produce the correct output for the specific vhost that you are trying to configure. Make sure that you run a '

php -l /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php' to check the edited .php template for errors.

Once you have confirmed that there are no errors in the template, you can then run '
/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain your.domain.tld' to rebuild the configuration for your domain.

The output of the template will be visible in either of these two files:

  1. /var/www/vhosts/system/your.domain.tld/conf/last_nginx.conf
  2. /var/www/vhosts/system/your.domain.tld/conf/last_httpd_ip_default.conf
If you need to undo the custom configuration, then you can rename or remove the duplicated .php files inside the /custom/domain/ folder. Then run the '/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain your.domain.tld' command again. The httpdmng will default back to the original .php templates to rebuild the server configuration.
 
Last edited:
which Cache module does plesk support??
We will officially support APC module and Zend OPcache module in next Plesk 12.1 version. You will be able use (enable/disable) it per domain.
 
We will officially support APC module and Zend OPcache module in next Plesk 12.1 version. You will be able use (enable/disable) it per domain.

Alright, good news then. Sorry to ask but is it possible to use Nginx only? Instead of as a reverse proxy
 
Sorry to ask but is it possible to use Nginx only? Instead of as a reverse proxy
No way. A lot of Plesk webhosting features related to Apache and can be used in scope of Nginx only.
 
Plesk uses per-domain .php template files to generate the full '/etc/nginx/nginx.conf' and '/etc/httpd/conf/httpd.conf' server configurations files. If you follow the instructions contained in @IgorG's link, you'll probably run into a situation where your direct edits to the nginx.conf or httpd.conf files will conflict with the directives coming from the per-domain .php template includes.

You may want to consider editing the .php templates directly. The default templates for httpd.conf and ngnix.conf are:
  1. /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php,
  2. /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php
...
.

Sean_MacInnes do you have a manual, how to fix this problem with Plesk 12?

I try intergate Plesk with the Varnish cache, with no luck... my problem is, all domains contain the same website from the file: /var/www/index.php instead from /var/www/vhost/domain......./.../

Please advise
 
Back
Top