This is the third part of our Plesk Tutorial Series. If you're configuring a new VPS we recommend starting with part 1.
Our pre-installed version of Plesk comes with CentOS 7 as the underlying operating system. CentOS 7 makes standard use of older versions of software (though with recent security updates) because it prefers stability over new features.
Plesk automatically installs updates and is delivered completely up-to-date. In addition, Plesk supplies many of their own packages that are geared to the use of Plesk. This means that (at the time of writing) PHP 5.4.16, 5.6.35, 7.0.29, 7.1.16 and 7.2.4 have already been pre-installed on your VPS for example (MySQL is behind, but we are updating this below). You manage these software (packages) from Plesk.
No further action is required for the update process on your part and we therefore focus on the following things in this part:
- Adjusting the PHP version & settings
- Adjusting the SQL database version
- Plesk's automatic updates
- Manually checking for updates
Perform all steps that involve code as root user, or user with sudo rights, unless indicated otherwise.
- Changing the PHP version and settings
The PHP version defaults to 5.4.16 (the default configuration of CentOS 7) and is adjusted per domain as follows:
Log in to Plesk and navigate to 'Websites & Domains' > 'PHP Settings'.
Change the PHP version to a version of your choice and at the bottom of the page click on 'Apply'> 'Ok'.
You are free to adjust the PHP settings on this page. However, we recommend that you leave / turn PHP-FPM via Nginx and not use FastCGI as FPM is faster. Additionally, as of Plesk 17.8 PHP-FPM with Nginx new caching mechanics are introduced. These mechanics will provide a significant performance gain for the loading of your websites' static objects and reduce CPU usage.
You may have noticed that some hard limits have been set, such as a Memory Limit of 128MB. Many CMS systems need more memory. To adjust this, go to 'Tools & Settings'> 'PHP Settings'.
You will see an overview of the PHP handlers (a handler is a function that performs a specific task). Click on the number that you set under step 2.
Click on the 'php.ini' tab. You will now see an overview of PHP settings for your selected PHP handler. Look for the hardcoded limit you want to look up (for example ctrl + f > memory_limit = 128M) and adjust the limit to the desired value. Then click on 'Ok'
If you now return to 'Websites & Domains' > 'PHP Settings' you can adjust the value of the customized option. Note that you have to enter this manually (in this example the memory_limit to 512M, though for most websites 128MB or 256MB is sufficient). Then click on 'Apply' to process the changes.
- Updating the SQL database
Plesk uses the MySQL service that comes with the OS. In the case of CentOS 7 (with which our Plesk images are supplied), this means that, at the time of writing, your VPS comes with MariaDB 5.5.56. In this manual we will update MariaDB to 10.2. MariaDB 10.2 largely corresponds to MySQL 5.7 (see this page for similarities and differences).
plesk db dump --all-databases > /var/backup/backup.sql
You're welcome to change the location and file name. Should your desired directory not exist yet, you can use the mkdir command, for example:
Next, stop MariaDB:
systemctl stop mariadb
Navigate to the MariaDB repository setup page and select the (Stable) version you want to use. Then copy the content under 'Here is your custom MariaDB YUM repositotry entry' to /etc/yum.repos.d/MariaDB.repo. For example, for MariaDB 10.2 this looks like this:
Then paste the copied content so that the file you just opened looks like this:
# MariaDB 10.2 CentOS repository list - created 2018-04-09 13:03 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
Your VPS now knows where to get the installation files for the new version of MariaDB. Install the new version of MariaDB with the command:
yum update mariadb
Next, start MariaDB again with the command:
systemctl start mysql
As an extra check you can check the version of MySQL that is used with the command:
- Plesk automatic updates
Updates are meant to give your VPS more stability, better functionality and security. Plesk updates are performed automatically (usually during the evening) and include the following components by default:
- Plesk packages and services developed by Plesk (e.g. Plesk Health Monitor and Plesk extensions).
- Packages of your operating system
- Third-party components such as MySQL, PHP, etc.
The settings of the automatic updates can be found under 'Tools & Settings'> 'Update & Upgrade Settings'.
You will then see the overview below of the update settings. A complete overview of all packages that are automatically updated can be found under the 'All Packages' tab. There are + - 900 packages at the time of writing.
You may have noticed that under 'General' the option 'Automatically install system package updates' is turned off and may wonder what the differences are between the Plesk updates and the system package updates.
- The Plesk updates include Plesk packages and services developed by Plesk (e.g. Plesk Health Monitor and Plesk extensions). Optionally you can also install third-party components such as PHP, Apache and Dovecot along. This option is on by default.
- The system package updates include all packages for your operating system, but also the above mentioned third-party components.
- Updating Plesk manually
Plesk itself and components that do not fall under automatic updates (e.g., new PHP interpreter versions, Webalizer, etc.) can only be manually updated from Plesk using the steps below. We advise you to check this with some regularity and to keep your VPS up-to-date as much as possible.
In Plesk go to 'Tools & Settings'> 'Updates and Upgrades'.
If there are updates available, you will see an orange exclamation mark 'Component updates are available'. Click on 'Update Components' at the top right.
Select the components you want to update (usually all) and click on 'Continue'.
Please note that the components you see may differ from those in the example above.
Your VPS is now not only safe, but also completely up-to-date and you're ready to link a domain! Click here to continue to Part 4: Linking Domains and Subdomains.
Should you have any questions left regarding this article, do not hesitate to contact our support department. You can reach them via the ‘Contact Us’ button at the bottom of this page.
If you want to discuss this article with other users, please leave a message under 'Comments'.