# Troubleshooting

This chapter describes how to repair malfunctioning Plesk services.

## Repairing Plesk Installation

By using Plesk Reconfigurator, you can check and repair Plesk installation that is malfunctioning due to misconfiguration of one or more of its components.

The following problems can be identified and corrected by using the Repair Plesk Installation option:

- problems with mail delivery caused by user-made changes in DNS server addresses

- misconfigurations of system user accounts or groups used by Plesk to access system objects

- malfunction of Plesk’s services

- misconfigurations in user access permissions for files and folders on server disks and hosting folders

- miscalculations of disk space usage by individual domains and subdomains

To check and repair Plesk installation, follow these steps:

1. Log in to the Plesk-managed server as a user with administrator rights by using Remote Desktop.

2. In the Windows Start menu, select All Programs > Plesk > Plesk Reconfigurator. The Reconfigurator application window opens.

3. Select the Repair Plesk installation option.

4. Select repairing actions that you want to perform by using checkboxes. See the following table for explanation of each check and repair option.

5. Click Check. Reconfigurator automatically performs the following tasks:

   - Corrects the problems with mail delivery caused by the changes made to DNS server addresses.

   - Restores system accounts used by Plesk to manage the server.

   - Checks and corrects Plesk settings and system account used to run and manage various Plesk services.

   - Resets security settings for files and folders.

   - Checks and corrects ownership of files and folders and recalculates disk space usage by individual domains and subdomains accordingly.

### Check & Repair options

Option | Description
--- | ---
Plesk Mail Server | DNS settings from network adapters are applied to mail server; network name `localhost` is added to the relay list.
User Accounts Used by Plesk | During the full repair, Reconfigurator performs the following tasks: checks if Windows user accounts `psaadm`, `tomcat4`, `ASPNET`, and groups `psacln, and` `psaserv` exist and creates them if they do not exist. Restores members of the `psaserv` group but not the members of the `psacln` group. checks if the `psaserv` group includes the accounts: `ASPNET`, `LOCAL SERVICE`, `NETWORK SERVICE`, and `IUSR_` <computer name> (Internet Guest Account) and restores and adds them to the group if they are not. checks Plesk’s system accounts (including Internet accounts for anonymous access to domains) and IIS settings for anonymous domain access.
Plesk File Security | Reconfigurator checks security settings on the following folders: `%plesk_dir%` `%SystemRoot%\temp` `%plesk_vhosts%` `%plesk_vhosts%\default` `%plesk_vhosts%\sqladmin` `%plesk_vhosts%\webmail` `%plesk_vhosts%\.skel` checks security settings for subfolders and files found in the following directories `%plesk_dir%` `%SystemRoot%\temp`
Plesk Services | For each service, Reconfigurator performs the following tasks: checks and, if necessary, corrects the paths to the service binary file check and, if necesary, corrects the user account that is used to start the service registers with the correct paths all unregistered services registered starts all inactive services and changes their startup types to `Automatic` If a service is disabled in Plesk and not registered in the system, it is not registered by Reconfigurator. If Reconfigurator finds the service running on the server, it stops the service and changes its startup type to `Disabled`. It also ensures that the Plesk service uses the `psaadm` account to log on to the system.
Plesk Virtual Hosts Security | For each object, Reconfigurator first checks if the object’s DACL corresponds to the object’s security rules contained in Plesk’s security files. (For detailed information about security rules, see Security Metadata Files and Templates.) If Reconfigurator cannot resolve a SID, it removes all ACEs corresponding to the SID from the DACL. If one or more SIDs specified by the security rules are missing in the DACL or specific access rights in the ACEs do not match those determined by the security rules, Reconfigurator updates the existing DACL.To enable this, Reconfigurator recreates all missing user accounts for which ACEs must be added to the DACL. Depending on the object type, Reconfigurator uses different access rights matching criteria and DACL update methods. For domain and subdomain root folders, after all unresolved SIDs’ ACEs are removed from a DACL, Reconfigurator check if access rights defined in the existing DACL exactly match those defined by the security rules. If a mismatch is found (DACL contains SIDs that are not found in the security rules, required SIDs are missing, or SID’s access rights are different), Reconfigurator compiles a new DACL based on the current Plesk’s security rules and completely overwrites the existing DACL. For objects other than domain and subdomain root folders, after all unresolved SIDs’ ACEs are removed from a DACL, Reconfigurator only checks if all access rights defined by the security rules are found in the DACL. If some access rights are missing from the DACL, Reconfigurator merges the ACEs remaining in the existing DACL with the ACEs defined based on the security rules.
Plesk Database | Reconfigurator cleans up the Repository table of the Plesk’s internal database.
Plesk Quotas | Reconfigurator checks that folders and files in a domain folder have proper ownership - are owned by to the corresponding user account or a web user of the corresponding domain. (If they are owned by other accounts, Plesk may report wrong disk space usage by the corresponding hosting accounts).

## Detecting Newly Installed Components

If you installed a third-party component but Plesk does not recognize it and does not show it in Server Components, you can check the Plesk registry subtree:

HKEY_LOCAL_MACHINESOFTWAREPLESKPSA ConfigConfigPackages

Check if the necessary component is present there. If everything is correct, you need to check whether all required *.dll files are present in the %plesk_bin% folder. You can find the *.dll name in the following key:

HKEY_LOCAL_MACHINESOFTWAREPLESKPSA ConfigConfigPackagespackage.namecomponent.namedll

For example:

HKEY_LOCAL_MACHINESOFTWAREPLESKPSA ConfigConfigPackagesmailservermailenabledll == ‘%plesk_dir%adminbinmailenableproviderw.dll’

If the *.dll is not present in %plesk_bin% you need to locate it and copy to the %plesk_bin% folder. After that, log in to Server Administration Panel and click Tools & Settings > Server Components > Refresh. The component should appear.

## Restoring Mail Configuration

You can restore your mail server functionality in cases when errors appear concerning the mail server misconfiguration or its mismatching with the Plesk’s internal database. This purpose is served by an internal utility `mchk.exe` residing at `%plesk_dir%admin\bin\`. The utility restores the mail server configuration using the Plesk’s database data.

Note

The utility restores only configuration of the mail server selected as default in Server Administration Panel > Tools & Settings > Server Components.

In general, `mchk.exe` matches the mail server configuration with Plesk’s database. In case when you execute `mchk.exe --all --fix-all`, the utility resets the mail server configuration the following way: It deletes all existing configuration files of the mail server (leaving its content) and then creates them according to the Plesk’s database.

Warning

Use `--fix-all` option only if the mail server’s configuration files are so much corrupt that the mail server itself cannot work with them properly and executing mchk.exe with other options does not solve the problem.

Usage: `mchk.exe` [options]

### Available options

Option | Parameter | Action | Example
--- | --- | --- | ---
`--all` |  | Checks and restores server-wide mail settings and mail settings for all domains | `mchk.exe --all`
| `--fix-all` | Resets server-wide and domain’s mail settings | `mchk.exe --all --fix-all`
`--domain` | `--domain-name` | Checks and restores mail settings for a specified domain | `mchk.exe --domain --domain-name=example.com`
`--all-domains` |  | Checks and restores mail settings for all domains | `mchk.exe --all-domains`
`--global-settings` |  | Checks and restores only server-wide mail settings | `mchk.exe --global-settings`

Note

This utility does not have any help reference, and executing it with arguments like `/?` will simply start restoring of mail configuration.

## Reducing Amounts of Notifications from Antivirus

If you receive too many email notifications from Plesk Premium Antivirus, you can switch them off. To do this, perform the following steps:

1. Log in to the database:

       "%plesk_dir%mysql\bin\mysql" -uadmin -p<password> -P8306 psa

Make sure that the record regarding antivirus notifications for administrator is present in the psa.misc table. Find it out with the following SQL query:

    mysql> select val from misc where param = 'AntivirusNotifyAdmin';

1. Notification can be enabled or disabled by switching the parameter using one of the following queries:

   - To enable notifications:

         mysql> update misc set val='1' where param = 'AntivirusNotifyAdmin';

   - To disable notifications:

         mysql> update misc set val='0' where param = 'AntivirusNotifyAdmin';

   - To insert the value if it is not present in the database, issue the following:

         mysql> insert into misc values ('AntivirusNotifyAdmin','0');

## Checking and Correcting Component and Folder Permissions

Plesk sets permissions for all server partitions so as to prevent users from interfering with each other or accessing unknown third-party software. For this reason, Plesk components or third-party applications used with Plesk can have insufficient permissions for proper operation. The Check component and folder permissions option of the Reconfigurator utility can be used to check and correct permissions for files and folders after installing third-party applications on the Plesk-managed server. With this option, you do not have to scan the whole disk, but you can check and correct permissions just for one or several applications, or for a selected partition or directory.

To check and correct permissions for third-party applications, follow these steps:

1. Log in to the Plesk-managed server as a user with administrator rights by using Remote Desktop.

2. In the Windows Start menu, select All Programs > Plesk > Plesk Reconfigurator. The Reconfigurator application window opens.

3. Select the Check component and folder permissions option.

4. Select one or several Plesk components from the list or select the partition where the third-party application is installed in the Path to check field.

5. Click Check.

   View the progress at the bottom of the form. As soon as the check is complete and the permissions are fixed, you are taken back to the main window of Reconfigurator.