Using the Plesk Repair Tool in Plesk 12.1
In the Plesk 12.1 preview, the Plesk team delivered a number of groundbreaking new features and improvements: multiple PHP versions, improved site preview, incremental backups – you name it. However, in this article I would like to bring your attention to a different feature, one that is no less hot, but has not received the attention it deserves: the Plesk repair tool.
The Who, and the What, and the Why
In a nutshell, the Plesk repair tool is a powerful utility that can automatically diagnose and correct a wide range of common issues. The tool is very flexible, and can be used to troubleshoot issues with Plesk itself, as well as those with Plesk services (such as Apache/IIS, DNS, MySQL/MSSQL, and so on). It can be used both on the level of individual objects (subscriptions, domains, mailboxes) and on the server level. On top of that, you can run the utility to merely check for the presence of issues, as well as to fix the detected issues automatically.
The advantage the Plesk repair tool gives you is impossible to underestimate. Plesk is a remarkably robust product, but as with any piece of software, sooner or later an issue is bound to occur. Up until now Plesk administrators have had to deal with these issues the old-fashioned way: that is, by fixing the broken configuration manually. But even if you know what the issue is and how to repair the damage – which is not a given – applying the fix takes time and effort. If you do not, you have to troubleshoot or contact support, losing time and frustrating your customers. Well, luckily for us, these times are coming to an end. The self-repair tool will take care of most issues you run into quickly and efficiently, thus granting you the following benefits:
- Lower support costs.
- Less downtime.
- Improved customer satisfaction.
We’ve got options!
The Plesk repair tool is a command line utility, and it can be run in one of the three modes:
- Interactive mode. Whenever the utility detects an issue or is about to reconfigure a service, it informs you and prompts you for the permission to attempt to resolve the issue or reconfigure the service.
- Diagnostic mode. The utility informs you about any detected issues, but does not resolve them.
- Repair mode. The utility attempts to automatically resolve any issues it detects. It also reconfigures certain services, even if no issues are detected.
You can run the utility to check both Plesk and all its services for issues, or you can pick one of the available aspects, namely:
- Plesk installation. This aspect repairs issues with Plesk itself.
- Plesk database. This aspect checks the Plesk database for consistency.
- Web server configuration. This aspect repairs the IIS/Apache configuration for one or more domains. It can also be used for other tasks, such as re-installing SSL certificates.
- File system. This aspect check the the structure of the home directories of all virtual hosts on the server and updates their configuration, as well as restores the default permissions on the virtual hosts’ directories.
- Mail. This aspect is used to reconfigure the mail service.
- Databases. This aspect checks the MySQL/MSSQL database servers for availability. It also makes sure that all databases and database users present in the Plesk database exist on the database servers, creates them if it is not so, check that all database users can connect to the database server, and resets the password for those that cannot.
- FTP. This aspect checks FTP users and their home directories for consistency.
- DNS. This aspect pushes the DNS zones data stored in the Plesk database to the DNS server zone files.
You use commands and options to set the desired mode and to define the objects and services to be checked. The general usage scenario looks like this:
- You encounter an issue. The issue can be local (that is, affecting a single mailbox, website, database, and so on) or global (affecting all the objects of the corresponding type on the server).
- You run the Plesk repair tool, specifying all necessary options. For example, if a single website experiences issues with its web server configuration, run the tool for the affected website choosing the ‘web’ aspect. If mail fails to be delivered to all mailboxes on the server, you would be best served by selecting ‘mail’ and running the tool server-wide.
It is important to note that running the utility, especially for the first time, can produce an alarming number of warnings and errors. However, that does not mean that your server is broken beyond repair. The Plesk self-repair tool notices any discrepancies, great and small, but not all of those affect your server. In fact, many of the warnings and errors you will see are perfectly harmless. However, to ensure optimal performance and stability, it is recommended to use the self-repair tool to correct them.
Leading by example
To give you a better understanding of the Plesk self-repair tool usage scenarios, here are some examples. Note that they are not meant to cover all possible situations in which the utility is useful, but rather to give you a small taste of what the Plesk self-repair tool can do for you.
Example 1. You are running a Plesk for Linux server, and the domain ‘mydomain.com’ has issues with its web server configuration. Use the following command to diagnose the issue:
# plesk repair web mydomain.com
The tool runs in the interactive mode and prompts you for the confirmation before making any changes.
Example 2. You are running a Plesk for Windows server, and all users on the server are complaining about issues with mail. You want to take care of those issues without wasting any time, so you run the tool like this:
> plesk repair mail -y
The tool runs in the repair mode and resolves the issue automatically.
Example 3. You want to check your Plesk server for potential issues, but do not want to make any changes or reconfigure any services just yet. The following command fits the bill:
# plesk repair all -n
The tool runs in the diagnostic mode and performs a comprehensive check-up of both Plesk and all its services. As an idea, you can add this command to cron and have the output sent to you every morning. This way you will always be on top of the situation and able to preemptively react to any burgeoning issues on the server.
The Plesk self-repair tool is a powerful utility with many commands and options. To make the most of it, you need to learn about those. The utility comes with robust help pages for the utility itself, as well as for any of its aspects. The help pages can be accessed as follows:
# plesk help repair
# plesk help repair web
# plesk help repair mail
Naturally, the utility will be documented in the product guides as well.
Out with the old
Note that the Plesk self-repair tool replaces a number of command line utilities that are currently used to administer Plesk, such as:
Access to the functionality these utilities provide will be made easier and more convenient with the help of the Plesk repair tool.
Plesk 12.1 is nearing its release date, and features like the Plesk self-repair tool are bound to make it a smash hit. Give it a try – install the Plesk 12.1 preview for Linux or for Windows, try out the new features, and let us know what you think in the comments!