Category Archives: Plesk

I love Plesk – it’s a work of art that makes my life easier. Rather than a “programme” as such, it’s a web interface that takes control of several thousand services on a web server and makes administering domains and hosting a breeze.

Since 2012 I’ve been a certified Parallels Plesk Automation Technician.

Redirecting a secure domain in Plesk

There are several ways to make two domains resolve to the same content in Plesk. The easiest option is to setup a Domain Alias. That way, domain1.com and domain2.com both serve the same content from the same subscription.

This worked great for non-SSL domains, but if you have a secured domain, the redirection will be detected by modern browsers and a certificate warning appears. Not what we want.

Another way to achieve the same thing is to create a separate subscription in Plesk, then change the Hosting Settings to Forwarding. This will result in a search engine friendly 301 redirect, but again we have that certificate issue to deal with. Since the redirected domain no longer has its own file structure, the Let’s Encrypt extension is unable to issue a separate certificate for the second domain. Not good either.

The solution, it appears, is a manual addition of a piece of code to the NGINX directives. This will only work if NGINX is enabled in your Plesk setup (it is by default as of Plesk Onyx). Let’s see how to do it.

Step by Step Instructions

Create a new subscription for the domain you’d like to redirect. In our example, let’s use new-domain.com as the current domain that has a subscription, but you’ve got another domain you want to redirect to the above. Let’s call that one old-domain.com. This domain needs its own subscription in Plesk. Don’t worry about adding any content there.

Once setup, head over to Websites and Domains is the subscription and select Apache and NGINX Settings.

Towards the bottom of this ever so slightly intimidating list we’ll find an empty field into which we can add our own code, under Additional NGINX Directives.

We’ll add the following to this box, replacing old-domain.com with the domain you’d like to redirect to. In essence, this is telling NGINX to use the location in brackets for the top level location of our current domain. Here’s a cut-and-paste friendly version:

And that’s it! Now your new domain will redirect to the old domain, while retaining all SSL properties. There’s no need for a new certificate either, and search engines will make a note when the bot comes crawling the next time. Furthermore, all deep links will be retained that way too.

Thanks to Nikita Nikushkin from Plesk for bringing this to my attention.

How to switch off emails from Anacron in Plesk Onyx

In 2011 I wrote an article about how to avoid emails from Dr. Web. In it I was discussing how to switch off these notifications, which are generated when the Dr. Web service updates itself.

Here’s an example:

Sadly, as of 2018, there is still no way to switch these emails off via a tick box from inside Plesk. It was relatively simple though to redirect the output to /dev/null in Linux, thereby avoiding yet another email in our already overflowing inbox.

In the latest version of Plesk, the earlier approach is no longer working.

Instead, we can tweak the Dr. Web configuration file at /etc/drweb/drweb32.ini. In the Updater section, find the following block of code:

Now change the CronSummary value to no and restart the Dr. Web service. On CentOS it’s called drwebd:

This will ask Dr. Web to not send us an email when he updates himself. The great thing about this solution is that we can still get command line output if we want to run the service manually.

However, if the service is updated in the future, those emails may re-appear because it’s likely that our configuration file may be overwritten. Only time will tell I guess!

How to hide the Promo Box in Plesk Customer View

There’s a small Promo Box on the right hand side in Plesk’s Customer View. This box can be a little confusion for users – especially when it shows products and extensions with highly cryptic names. Here’s an example:

Lucky for us, there’s an easy way to remove it. All we need to do is create a vile called /usr/local/psa/admin/conf/panel.ini and add the following content to it:

 

This file is read by Plesk every time the panel loads, telling Plesk what to display in the admin interface. With the above command, the Promo Box is suppressed.

There’s no need to restart anything, simply reload the page in your web browser and the box will be gone.

How to hide the social links at the bottom of Plesk

By default, Plesk displays several links in its footer. Two of them are links to Plesk’s Facebook and Twitter pages.

Sometimes less is more, and thankfully there’s an easy way to suppress those links if we don’t want to see them anymore.

Simply create a file called /usr/local/psa/admin/conf/panel.ini and add the following content to it:

Plesk reads this file every time the admin interface is displayed, and if it finds the above instructions, those links won’t be printed.

There’s no need to restart anything, simply refresh your Plesk page in the browser and those links are gone.

For more configuration options, take a look at the included /usr/local/psa/admin/conf/panel.ini.sample file.

Testing Incremental Backups in Plesk Onyx

From time to time I get crazy ideas, and last week that crazy ideas was to test how well incremental backups can be restored in the latest version of Plesk. Specifically I wanted to know how Plesk would react in times of a crisis, which usually happens at the worst of times.

Up until recently I’ve always done full backups – but incremental backups are a lot more space saving on the target device, plus it reduces the load on the server and data traffic significantly. Let’s see what these incremental backups are all about.

Wikipedia suggests that after a full backup, each increment needs to be available to make a restore.  This would indicate that deleting one backup in the middle (simulating a failed backup) would mean the restore would fail.

But how does Plesk work, and how would it react if we’d take away an increment in the middle? Would it indeed need all incremental parts to rebuild a backup? Or would it always refer to the full backup and write its increments accordingly? Let’s find out!

I’m using a test system on a CentOS 7.5 server, with Plesk Onyx 17.8 installed. I have a test domain with a default WordPress instance, but it’s not doing much at the moment and could probably do with a quick facelift if anything.  Continue reading Testing Incremental Backups in Plesk Onyx

How to remove the Promo Box in Plesk Service Provider View

A few years ago, when Plesk started supporting Extensions, I gave a talk together with Any Kugaevskiy from at Parallels Summit in New Orleans. My part was about how to get started with Plesk Extensions in general.

As a demo project, I removed the big blue promo box in Plesk Service Provider View – and only last week I remember that I’ve never made that project public. It’s about time I thought, and quickly created a GitHub repo to share it with the world.

But then I thought, I best make a video to show people how to use this thing – so here it is. In the above screencast I’ll show you how to install the extension in Plesk Onyx 17.2 and how it looks with and without it. You can download the Extension here:

All you need is the ZIP file that’s part of the repo. Upload it to your Plesk Server (under Extensions – My Extensions), then enable it and enjoy an promo free home screen experience.

If you want to try your hand at writing your own Plesk extension, have a look at my article from 2014 (as mentioned in the video):

The presentation Andy and I gave at Parallels Summit that year can be found here:

Enjoy!

How to unlock subscriptions in Plesk Onyx

When parameters for a subscription in Plesk have been modified, Plesk may lock them. This means that when a change is made to the service plan itself, locked subscriptions are not updated by default.

To unlock subscriptions and re-integrate them into the service plan, head over to the subscription in question (from the Subscriptions list in Service Provider View), then on the right hand side find the widget that reads Account.

At the bottom, there’s an “unlock and sync” option. Click that and the subscription will be unlocked and synced with the service plan it was once part of.

Why are subscriptions locked in the first place?

Good question! One example is this: imagine you had a specific version of PHP as the default on your service plan. Say PHP 7.2. But then, some subscriptions use content that’s not compatible with that version of PHP and instead require version 5.6. No trouble, you’ll just change it in that particular subscription and all is well.

Until you decide that some other parameter needs to be changed on that service plan – say the amount of webspace or the number of databases. If you were to sync all subscriptions on that plan with the new default parameters, then the default version of PHP would also be synced and set to 7.2 – which would break the subscription’s content and make one of your customers unhappy.

Locking a subscription means this subscription is “exempt” from syncing, which means all other subscriptions can get the new parameter, leaving you to deal with the locked subscription individually (and – more importantly – without breaking it).

How to reset the admin password in Plesk Onyx

It’s not pretty when it happens, but it happens to the best of us: you forget the admin password for your Plesk Onyx installation.

In previous versions there was an option to retrieve this password via the command line, but that special command has been removed in Onyx for security reasons.

So what can we do? Well luckily it’s relatively easy to reset the password to something else, or gain temporary access to the server quickly. Let me show you how. Continue reading How to reset the admin password in Plesk Onyx

How to install a free SSL Certificate in Plesk Onyx

In this episode I’ll explain how to add a free SSL Certificate for web traffic in Plesk Onyx.

First we’ll enable the Let’s Encrypt extension in Plesk, then we’ll create the certificate and prepare our subscription for SSL traffic. And finally, we’ll tweak two values in the WordPress database so that all requests will be directed to https rather than http.

Note that Let’s Encrypt SSL Certificates can only be used to encrypt web traffic between your server and a client’s browser. They cannot currently be used to secure email or Plesk itself (but who knows what the future holds).

Enjoy!