Category Archives: Plesk

Plesk Guides, Articles and Discussion

Migrate Plesk to MariaDB 10.1

Migrating Plesk to MariaDB 10.1 is fairly simple, currently Plesk officially supports up to MariaDB 10 and MySQL 5.6 (since writing 10.1 is now supported), so this is “use at your own risk”. I’ve run Plesk with MariaDB 10.1 on various operating systems, here I’ll show you how to install on Ubuntu 14 LTS from the MariaDB repository…

Please Note: An in place upgrade like this does not work on Ubuntu 16, you need to install MariaDB prior to installing Plesk, though I will be coming back to this issue when I have time.

Preperation

1. Import the key

2. Add the repository

3. Now update apt…

4. Stop the current MySQL/MariaDB process (if you use WatchDog to monitor MySQL/MariaDB stop monitoring first)

And

Installation

5. Install like so…

If prompted to set a password, leave blank to keep your current, and you should over write the my.cnf file with the latest version to make sure you get all the optimizations added for MariaDB, especially if you are coming from MySQL.

Final Stage

6. Now you can start the MySQL service and start Watchdog monitoring…
Stop the current MySQL/MariaDB process (if you use WatchDog to monitor MySQL/MariaDB stop monitoring first)

And

Should you have any problems, please see the notes at the bottom of my post on Migrating Plesk to MariaDB

Moving Plesks Mail Directory

This is an update to a kb article at Plesk KB6312 on How to move the Plesk Mail Directory.
I will use the example folder /var/vmail

1. Edit psa.conf

Changing “PLESK_MAILNAMES_D” to the desired location…

2. Then run the following command which will create the new folder and copy the contents of the qmail directory to the new directory…

3. And change the maildirs in Dovecot…

Adding the following…

4. Run…

This will update the following configuration files

/etc/postfix/main.cf
/etc/postfix/master.cf
/etc/default/spamassassin

with the correct paths to your new MailDir.

5. And one last thing, we need to edit the spamtrain script…

You will see line 8…

Simply change this to…

And you are done.

Secure Redirects in Plesk

More and more sites are only available via https, now with the Let’s Encrypt extension available in Plesk 12.5 it’s even easier to make your site secure. As such I thought it would be a good time to write this guide.

This guide assumes…

  • You have already setup your SSL Certificate in Plesk for your domain,
  • You are using Apache (FastCGI or FPM) and Nginx is serving static files,
  • You want your site to be https only, redirecting all http requests to https
  • You have set preferred domain in Plesk to www.domain.tld

Apache

I’ll start with Apache, browse to your domain in Plesk and click on Additional Apache & Nginx settings. under Additional directives for HTTP use this redirect..

And Additional directives for HTTPS…

If you use Plesk’s built in SEO Safe redirect (preferred domain) from domain.tld to www.domain.tld, you will need to turn this off and add the following in the Additional HTTPS directives…

Nginx

Now onto the Nginx directives…

Notice I’m using $scheme rather than the more common $host, as using the $host rewrite affected ssllabs scores in that domain.tld and www.domain.tld would score differently after adding HPKP and HSTS headers in Apache.

I hope that helps someone.