Plesk Linux Advanced Administration Guide
Plesk Linux Advanced Administration Guide
Parallels Panel
Copyright Notice
Parallels IP Holdings GmbH Global Headquarters
th
Vordergasse 59 500 SW 39 Street, Suite 200
CH-Schaffhausen Renton, WA 98057
Switzerland USA
Phone: +41 526320 411 Phone: +1 (425) 282 6400
Fax: +41 52672 2010 Fax: +1 (425) 282 6445
Preface 6
Typographical Conventions ........................................................................................................... 6
Feedback ....................................................................................................................................... 7
Introduction to Panel 9
Installation and Upgrade Overview ............................................................................................. 12
Ports Used by Panel .................................................................................................................... 13
Licensing ..................................................................................................................................... 14
Services Management 32
DNS ............................................................................................................................................. 33
FTP .............................................................................................................................................. 35
Mail Service ................................................................................................................................. 39
Restoring Mail Configuration ............................................................................................. 40
Installing Custom SSL Certificates for Qmail or Courier-IMAP Mail Servers .................... 41
Outgoing Mail from Exclusive IP Addresses ..................................................................... 45
Mailing Lists Management System .............................................................................................. 46
Configuring a Mailing List to Which only Members Are Allowed to Post .......................... 47
Importing a List of E-mail Addresses into a Mailing List ................................................... 47
Website Applications ................................................................................................................... 47
Multiple Web Apps in a Single Directory ........................................................................... 47
Hiding Commercial Apps ................................................................................................... 48
Spam Protection .......................................................................................................................... 49
Configuring SpamAssassin ............................................................................................... 50
Training SpamAssassin to Work with All Mail Accounts on the Server ............................ 51
Fighting Spam on a Qmail Mail Server ............................................................................. 52
Antivirus Support ......................................................................................................................... 54
Parallels Premium Antivirus .............................................................................................. 55
Kaspersky Antivirus ........................................................................................................... 57
System Maintenance 58
Preface 4
Localization 207
Troubleshooting 218
Cannot Access Panel ................................................................................................................ 219
Cannot Log In to Panel .............................................................................................................. 219
The Administrator's Password Has Been Forgotten ................................................................. 220
Panel in a Virtuozzo Container: Broken Layout ........................................................................ 221
EZ Templates Update Issues in Parallels Virtuozzo Containers ............................................... 222
Postfix Consumes Too Many Resources in a Container ........................................................... 222
Preface
In this section:
Typographical Conventions ............................................................................... 6
Feedback .......................................................................................................... 7
Typographical Conventions
Before you start using this guide, it is important to understand the documentation
conventions used in it.
Feedback
If you have found an error in this guide, or if you have suggestions or ideas on how to
improve this guide, please send your feedback using the online form at
http://www.parallels.com/en/support/usersdoc/. Please include in your report the guide's title,
chapter and section titles, and the fragment of text in which you have found an error.
8 About This Guide
The guide provides step-by-step instructions for performing server management tasks that
require use of Panel functionality other than the GUI and GUI-only tasks that administrators
may need to perform only in rare and specific situations. Administrators can use several
additional tools that are supplied in the standard Parallels Plesk Panel distribution package to
add customized automation tasks, back up and restore data, and repair Panel components
and system settings. The tools include a number of standalone applications, command-line
utilities, and the ability to integrate custom scripting with Parallels Plesk Panel.
Introduction to Panel
Parallels Plesk Panel files can be divided into six major groups responsible for different
aspects of Panel work. The diagram below shows these groups (components of the
Panel) and the connections they have to each other and to external services that Panel
manages.
10 Introduction to Panel
Parallels Plesk Panel for Linux installs its main components into the following directory:
On RPM-based operating systems: /usr/local/psa
On DEB-based operating systems: /opt/psa
This directory (main Panel directory) contains Panel core files, command line utilities,
log files and so on.
In addition, Panel creates files and directories outside the main directory. The list below
contains those that you are likely to use when administering Panel.
The main configuration file containing paths to utilities, services and packages used
by Panel:
/etc/psa/psa.conf
The initialization script for opening and closing services during server startup and
shutdown procedures:
/etc/init.d/psa
Initialization scripts for starting and stopping services with xinetd:
/etc/xinetd.d/smtp_psa
/etc/xinetd.d/smtps_psa
/etc/xinetd.d/poppassd_psa
/etc/xinetd.d/ftp_psa
Find more information on xinetd at http://www.xinetd.org/.
Introduction to Panel 11
Panel database:
/var/lib/mysql/psa/
Backup files:
/var/lib/psa/dumps/
In this chapter:
Installation and Upgrade Overview ....................................................................12
Ports Used by Panel ..........................................................................................13
Licensing ...........................................................................................................14
12 Introduction to Panel
For detailed instructions on how to use Parallels Installer, refer to the Installation,
Upgrade, Migration, and Transfer Guide.
For Linux servers, there is another tool to install Panel - the one-click installer utility.
This allows the latest version of Panel for your operating system and platform to be
installed in one step. For detailed instructions on how to use the Parallels Installer and
one-click installer utilities, refer to the Installation, Upgrade, Migration, and Transfer Guide.
If you operate in the Parallels Virtuozzo Containers (PVC) environment, you can use
application templates for installing Panel on containers.
When the application templates are installed on a PVC hardware node, they allow you
to easily deploy the application on as many containers as required, saving system
resources such as disk space.
For more information on installing Panel on PVC, read the Installation, Upgrade, Migration,
and Transfer Guide, chapter (Advanced) Installation to Parallels Virtuozzo Containers.
If you use Parallels Plesk Panel 9 or earlier and want to upgrade it to Panel 11, you
may encounter problems due to changes in the Panel business model. In particular, it
might be impossible to transfer some settings and business objects.
The list below provides information about services managed through Panel and about
ports on which they should be available for proper interaction with Panel. If you use a
firewall, make sure that the connections to all of these ports are allowed for
corresponding Panel services.
* Warning: If you use Web Presence Builder, do not block inbound connections to
port 8880, otherwise Web Presence Builder will not function.
14 Introduction to Panel
Licensing
After you install Parallels Plesk Panel, a trial license key for 14 days is installed by
default. To continue using Panel after the trial license key expires, you should obtain a
lease license key or purchase a permanent license key.
A leased license means that you pay for a limited time during which you can use Panel,
say, for a couple of months. During the lease period, Panel will perform free monthly
updates of your license key. The lease license includes free upgrades to all major new
versions of Panel.
The permanent license means that you buy a lifetime Panel license. A permanent
license is updated every three months for free. Upgrading a Panel installation with a
permanent license to the next major version requires a separate payment unless you
use Software Update Service (SUS). See http://www.parallels.com/support/sus/ for
more information on SUS.
Panel license keys have a grace period of 10 days before the expiration date. During
the grace period, Panel makes daily attempts to update the license key automatically. If
an automatic update fails, Panel notifies the administrator. If you do not update a
license key during the grace period, it expires and blocks Panel functions until you
install a valid license key.
Panel defines whether it needs to update the license key using the update-keys.php
utility located in the
$PRODUCT_ROOT_D/admin/plib/DailyMaintainance/directory, where the
$PRODUCT_ROOT_D is /usr/local/psa. This utility checks the license grace period
and expiration date and tries to retrieve a new license key or blocks Panel.
Panel runs the utility every day as a part of the daily maintenance script. If you want to
check for license updates, you can run the script manually by executing the command
$PRODUCT_ROOT_D/bin/sw-engine-pleskrun
$PRODUCT_ROOT_D/admin/plib/DailyMaintainance/script.php.
You can retrieve and manage license keys through the Panel GUI. The information
about the current license key and controls for managing license keys are located in
Server Administration Panel > Tools & Settings > License Management.
CHAPTER 2
When you add a site in Panel, you select one of the hosting types to use with it: web
page hosting or forwarding. In terms of Apache, you associate the site with a virtual
host of one of three configurations (website hosting, standard forwarding, and frame
forwarding). To learn the differences between these configurations, see the section
Virtual Hosts and Hosting Types (on page 18).
Sites are linked to virtual hosts, so if you want to add some feature provided by Apache
but not available through the Panel GUI, you should change the virtual host settings
using Apache configuration templates. Based on these templates, Panel partly re-
generates virtual hosts, so you should follow certain rules when modifying the
configuration; otherwise, some of your changes might be lost. Next in this chapter, we
will discuss virtual hosts in more detail and provide guidelines on how to modify them
safely. To learn more on this point, refer to the section Changing Virtual Hosts Settings
Using Configuration Templates (on page 20).
Panel creates virtual hosts for websites based on virtual host templates. These
templates predefine the content that will be included in each new virtual host. Learn
how to change virtual host templates in the section Predefining Virtual Hosts for new Sites
(on page 24).
You can get information on access to each virtual host and Apache errors that have
occurred on the host from Apache logs. Learn more about log files location and rotation
settings in the section Analyzing Access and Errors (on page 31).
The term virtual host refers to the practice of running more than one website on a
single server or IP address. For example, Apache can manage two websites,
example1.com and example2.com, even if they use a single IP address. Each of
these sites is hosted on a separate virtual host.
There are two types of virtual host, each with different methods of requests routing:
IP-based. Each virtual host has a separate IP address. Apache defines the
requested host based on the host IP address.
Name-based. This supposes that several virtual hosts share the same IP address.
To define a requested host, Apache parses the domain name.
16 Virtual Hosts Configuration
Parallels Plesk Panel uses the name-based approach. In addition, Panel provides an
option to allocate separate IP addresses to customers who do not want to share their
IP address with others. To implement this option, there are two types of IP address in
Panel:
Dedicated IP addresses that have a single owner.
Shared IP addresses that you can allocate to any number of customers.
When a client requests a certain domain, Apache parses the requested domain name.
Then Apache searches for the virtual host with the requested domain on the IP address
specified in the request. If the host exists, Apache sends the requested files from this
host to the client.
If the requested virtual host is not found, Panel uses the following entities to resolve the
request:
1. Default domain. This can be created for a specific IP address. If a request to this IP
address contains the name of a non-existent domain, Panel redirects this request to
the default domain.
2. Default virtual host. This accepts all requests to server IP addresses that could not
be directed to any default domain.
Hosting Types
Depending on how you intend to use a domain, for example, to host a site or to forward
HTTP requests to another domain, you can choose from three hosting types that define
the structure of a virtual host created for this domain. The hosting types are the
following:
Website hosting. When you choose this type of hosting, Panel creates a virtual host
(disk space on the local server) for a customer. Customers store their files on a
virtual host and run their websites without having to purchase a server and
dedicated communication lines.
Standard forwarding. In this case Panel creates a reduced virtual host that does not
store its owner's files and directories.This host is used for redirecting requests to
another network resource. When end users try to access the domain, Panel
forwards them to another URL. This URL will be shown in their browsers.
Frame forwarding. In this case Panel creates a reduced virtual host that does not
store its owner's files and directories. Unlike standard forwarding, frame forwarding
virtual hosts show the requested URL in the browser, not the actual URL. Panel
uses the HTML frames to show the pages of another site with the requested URL.
Learn how to change a domain's hosting type in the section Changing Hosting Type (on
page 18).
Virtual Hosts Configuration 17
In this chapter:
Virtual Hosts and Hosting Types ....................................................................... 18
Changing Virtual Hosts Settings Using Configuration Templates....................... 20
Predefining Virtual Hosts for New Sites ............................................................. 24
Applying Custom PHP Settings on Domains with PHP in CGI/FastCGI Mode ... 28
Predefining Values for Customizable PHP Parameters ..................................... 30
Analyzing Access and Errors ............................................................................. 31
18 Virtual Hosts Configuration
ServerAdmin "admin@mailserver.tst"
RedirectPermanent / "http://easytofinddomain.tst/"
</VirtualHost>
Virtual Hosts Configuration 19
Frame forwarding domains have a document root with a single file index.html
with the <FRAMESET> tag that defines the frame and address of the website to
show in the frame. Therefore, the configuration of a frame forwarding virtual host
resembles website virtual host configuration:
<VirtualHost 10.0.69.2:80>
ServerName "FFdomainXX.tst"
ServerAlias "www.FFdomainXX.tst"
ServerAdmin "admin@mailserver.tst"
DocumentRoot "/var/www/vhosts/FFdomainXX.tst/httpdocs"
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
</VirtualHost>
When you create a website inside a subscription in Server Administration Panel, the
domain hosting type is set to website hosting. When you create a domain in Control
Panel, you can set a different hosting type. Domain owners are free to change the
hosting types of their domains whenever they wish.
To change the hosting type of a domain, open Control Panel > Websites & Domains, click
the domain name, and go to the Hosting Type > Change.
Configuration settings of each virtual host are stored in its configuration files in the
/var/www/vhosts/<domain_name>/conf/ directory. Particularly, these files are the
following:
<version>_httpd.include - Apache virtual host configuration.
<version>_nginx.conf - nginx configuration.
Panel lets administrators and domain owners see the history of changes in a virtual
host configuration files by saving each version of these files. <version> here is a unique
number assigned to a certain configuration state that is used now or was used
previously. To let administrators and domain owners easily access the currently used
configuration file, Panel stores the links last_httpd.include and
last_nginx.conf that point to the corresponding files.
The system rewrites the configuration files after each change of virtual host
configuration, for example, changing the hosting type of a domain. Therefore, if you
edit an Apache configuration file manually, your changes will be lost after changing the
virtual host settings in the Panel UI. If you need to add your own directives to a
domain's Apache configuration file, create a separate file called vhost.conf or
vhost_ssl.conf with these directives in the
/var/www/vhosts/<domain_name>/conf/ directory. If you include directives that
already exist in the domain's current httpd.include file, the system will use values
specified in the vhost.conf or vhost_ssl.conf files.
To apply the changes from your configuration files, run the following command:
usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-
name=<domain_name>
20 Virtual Hosts Configuration
If you want to add custom directives for a certain subdomain, create the vhost.conf
or vhost_ssl.conf files with these directives in the directory
/var/www/vhosts/<domain_name>/subdomains/<subdomain-name>/conf/
To reduce the risk of errors during modification of configuration files, Parallels Plesk
Panel provides a mechanism for changing virtual host configuration - configuration
templates. Before 11.0 Panel had templates only for Apache configuration files, but
with adding support for nginx administrators can modify nginx templates as well. Read
more about the how Apache and nginx work together in the Administrator's Guide,
section Improving Web Server Performance with nginx (Linux).
Configuration templates are files based on which Panel re-generates certain web
server configuration files. Other configuration files are generated automatically and
cannot be changed. The hierarchy of configuration files generated by Panel
automatically and from templates is shown in the Appendix A (on page 223).
Web server configuration files support versioning. This allows you to roll back to a
previous configuration if the new one contains errors. Panel adds a file version number
to the name of each configuration file. For example, virtual host configuration files
located in the /var/www/vhosts/<vhost_name> directories have the names like
<version>_httpd.include. To quickly access the currently used configuration file of a
virtual host, use the symbolic link last_httpd.include located in the same
directory.
Important: Do not change the default templates. To introduce your changes to the
configuration, copy the templates you need to the
/usr/local/psa/admin/conf/templates/custom/ directory and modify them,
preserving the directory structure, and then modify these copies. You can create new
templates from scratch and place them in the custom/ directory according to the
default structure.
To remove your changes and restore the default configuration, just delete the custom
template files.
Virtual Hosts Configuration 21
In this section:
Template Execution Context ............................................................................. 22
Example: Changing Default Apache Ports ......................................................... 24
22 Virtual Hosts Configuration
$VAR is an object containing the data model which should be applied to a template.
The variable contains an essential set of parameters defining the content of web server
configuration. The detailed structure of the array is presented in the Appendix C (on
page 228).
The most important function is IncludeTemplate() which is part of the $VAR array. The
function allows including templates one into another, and it is defined as
IncludeTemplate($templateName, $OPT, $metainfo)
where
$templateName - string denoting name of included template. Required
$OPT - an associative array which passes values to a template. Optional
$metainfo - an associative array which defines certain aliases in the template
context. Optional
In cases when the text generated by an included template should depend on the
context, say, when iterating over a set of values, it is possible to pass additional
parameters to the template.
## source: default/server.php
<?php echo $VAR->includeTemplate('service/php.php', array(
'enabled' => false,
)) ?>
Here, we included the service/php.php template and passed the value 'enabled'
=> false to it. In the template being included the passed value is available in the
variable $OPT:
## source: service/php.php
<?php
if ($OPT['enabled']) { // it is required to detect 'enabled'
echo "php_admin_flag engine on\n";
if (!array_key_exists('safe_mode', $OPT) || $OPT['safe_mode']) {
// optional parameter 'safe_mode'
echo "php_admin_flag safe_mode on\n";
} else {
echo "php_admin_flag safe_mode off\n";
Virtual Hosts Configuration 23
}
if(array_key_exists('dir', $OPT) && $OPT['dir']) { // optional
parameter 'dir'
echo "php_admin_value open_basedir {$OPT['dir']}:/tmp\n";
}
} else {
echo "php_admin_flag engine off\n";
}
?>
The code in this sample will generate two different blocks of text depending on which
value of the 'enabled' parameter is passed.
Note that $VAR, which contains the data model, can be used in templates being
included as well. Some values of $VAR are defined using the content of $metainfo.
For details on possible $metainfo content and how it affects a template context, refer
to Appendix C (on page 228). For example, by defining the subDomainId value in the
$metainfo parameter, it is possible to set an exact subdomain model available at
$VAR->subDomain in a template being included:
## source: default/domainVhost.php
<?php
//going through all subdomains of current domain
foreach ($VAR->domain->physicalHosting->subdomains as $subdomain) {
if ($subdomain->ssl) { //if SSL is enabled on a subdomain
//include configuration for subdomain with enabled SSL
echo $VAR->includeTemplate('domain/subDomainVirtualHost.php',
array(
'ssl' => true, // passing $OPT['ssl'] = true
), array(
'subDomainId' => $subdomain->id, // define target
subdomain for which a configuration file is being built
));
}
## source: domain/subDomainVirtualHost.php
ServerName "<?php echo $VAR->subDomain->asciiName ?>.<?php echo $VAR-
>domain->asciiName ?>:<?php echo $OPT['ssl'] ? $VAR->server-
>webserver->httpsPort : $VAR->server->webserver->httpPort ?>"
24 Virtual Hosts Configuration
Example
To make Apache listen to HTTP requests on port 3456, and HTTPS on 4567, make the
changes described above in all templates.
If you want to change the files and directories that are automatically included in new
sites, for example, so as to include some useful scripts or change the error pages, you
can define a custom virtual host template. Later, you can replace, edit or remove files
generated by the template from any site.
In addition, resellers can set separate virtual hosts templates for their customers.
Note: Subdomains have the same status with additional domains and employ the
same directory structure. Thus, they have a separate directory in /var/www/vhosts
and their own configuration files, like php.ini or vhost.conf.
In this section:
Default Structure of Panel Virtual Host .............................................................. 25
Permis Description
Directories Tree User Group
sions
/<VHOST
root root 755
>
psaser Anonymous FTP
/anon_ftp user 750
v files.
26 Virtual Hosts Configuration
Note: This
directory is not
psaser present in new
/httpsdocs user 750
v installations,
only in
upgrades from
previous
versions
Passwords to
psaser
/pd root 750 protected
v
directories.
d..<dir1>@<d
apache apache 400
ir2>
User’s private
/private user root 700
storage.
psaser Statistics
/statistics root 550
v directory
Anonymous FTP
/anon_ftpstat root root 755
statistics.
FTP user
/ftpstat root root 755
statistics.
/logs root root 755 Virtual host logs.
HTTP user
/webstat root root 755
statistics.
HTTPS user
/webstat-ssl root root 755
statistics.
Chroot
/usr root root 755 environment
directory.
psaser Web users
/web_users root 755
v directory.
Virtual Hosts Configuration 27
web_us psaser
/<web_user> 750
er v
HTTP and
HTTPs
/<subdomain psaser documents of a
user 750
> v subdomain
(since Panel
10.0)
Service
directory.
Note: The
psaser directory is
/subdomains root 755 used for
v
compatibility
with earlier
Panel
versions .
28 Virtual Hosts Configuration
The resulting PHP configuration for each domain is defined on two levels: Server-wide
and domain-level. The domain-level configuration is of higher priority and it overwrites
the server-wide configuration. Here are our recommendations on changing PHP
settings in Panel.
Change server-wide settings if you need to change certain PHP settings on all
domains.
The settings file path: /etc/php.ini.
Change domain-level settings if you want the changes to be applied only to a
certain domain. The changes will take effect only on domains with PHP running in
the CGI or FastCGI mode.
The settings file path: /var/www/vhosts/<domain_name>/conf/php.ini,
where <domain_name> is the name of a corresponding domain.
Important: The domain-level changes are not applied automatically. To make Panel
start using the new settings, notify it from the GUI. For this, change the PHP support
option to a different value, save it, and roll back to the original state. To reach PHP
support, go to Websites & Domains and click the domain name, the subject of new PHP
settings.
When you apply settings from your custom file, Panel merges them from these
sources:
Customer's domain-level settings they can toggle from Panel GUI, actually:
The PHP safe mode toggle.
The path to the cgi-bin directory.
Domain-level settings from the /conf/ directory. They override the customer's
settings.
The result is put to /var/www/vhosts/<domain_name>/etc/php.ini for the
further use. Use this file to verify that the results fit your expectations.
Virtual Hosts Configuration 29
If you want to use custom PHP settings for all newly created websites, copy your
custom php.ini file to the conf directory of a virtual host template. For more
information on host templates, refer to the section Predefining Virtual Hosts for New Sites
(on page 24).
30 Virtual Hosts Configuration
Add such line for each value in the preset. For example, if you want Panel users to
choose the value of the memory_limit parameter between 8M and 16M, add the
following lines to panel.ini:
[php]
settings.performance.memory_limit.values[]=8M
settings.performance.memory_limit.values[]=16M
Virtual Hosts Configuration 31
To hide the field that allows entering the custom value for a certain PHP parameter,
add the line of the following type to the [php] section of the panel.ini file:
settings.<parameter_group>.<parameter_name>.custom=false
where
<parameter_group> - a group of a PHP parameter: performance for the
performance PHP settings and general if the parameter is placed in to the
common group. For more information about the groups of PHP parameters,
read the Administrator's Guide,
<parameter_name> - a name of a PHP parameter. Use the same syntax as in
php.ini.
For example, if you do not want Panel users to set custom values to the
memory_limit parameter, add the following line to panel.ini:
[php]
settings.performance.memory_limit.custom=false
To switch the custom value field back on, replace false with true.
To save disk space, Panel rotates Apache logs. Learn how to change log rotation
parameters in the Log rotation (on page 129) section.
CHAPTER 3
Services Management
To enable basic hosting services and functions on a Panel-managed server, the Panel
distribution package includes several third-party software applications that are installed
along with Parallels Plesk Panel. These applications are responsible for providing
various hosting services such as DNS, e-mail, FTP, and others.
All software components shipped with Panel can be installed and updated by means of
Parallels Installer. These components are listed at
http://download1.parallels.com/Plesk/PP11/11.0.0/release-notes/parallels-plesk-panel-
11.0.0-for-linux-based-os.html#4.
You can also install and manage through Parallels Plesk Panel many other third-party
applications that are not included in the Parallels Plesk Panel distribution package. For
the complete list of third-party applications currently supported by Panel, refer to
http://download1.parallels.com/Plesk/PP11/11.0.0/release-notes/parallels-plesk-panel-
11.0.0-for-linux-based-os.html#5.
This chapter provides detailed descriptions of different external components used for
providing hosting services on a Panel server.
In this chapter:
DNS .................................................................................................................. 33
FTP ................................................................................................................... 35
Mail Service....................................................................................................... 39
Mailing Lists Management System .................................................................... 46
Website Applications ......................................................................................... 47
Spam Protection ................................................................................................ 49
Antivirus Support ............................................................................................... 54
Services Management 33
DNS
Parallels Plesk Panel for Linux works in cooperation with the BIND (or named) domain
name server that enables you to run a DNS service on the same machine on which you
host websites.
When you add a new domain name to Panel, it automatically generates a zone file for
this domain in accordance with the server-wide DNS zone template and registers it in
the name server's database, then instructs the name server to act as a primary
(master) DNS server for the zone.
Configuring DNS
You can change the name server settings by editing configuration file /var/named/run-
root/etc/named.conf (/etc/named.conf is a soft link to it). This file consists of the following
parts:
General Settings containing the following sections:
The Options section contains the directory option referring to /var, which is used
as the base directory relative to $ROOTDIR (which is /var/named/run-root by
default) for all other files used below. It also sets the location where named will
store its PID.
The key and control sections define a shared key for managing named with the
rndc utility and access list.
The main part contains several zone sections, one for every direct and reverse
zone in which the server acts as the primary or a secondary name server. As usual,
there is also a root zone section.
The root zone section defines the file with the root zone name servers.
Reverse local loop zone.
A direct zone for every domain and a reverse zone that the server processes as
a name server.
The final part containing the acl section, which defines an access control list of
name server IP addresses where zone transfers are allowed. By default, the
common-allow-transfer ACL is included in every zone section.
Note: If you perform change zone entries in the file manually, Panel will override them
with changes made through the GUI.
34 Services Management
Zone files
By default, zone files for domains are stored in the /var/named/run-root/var directory, as
defined in the /var/named/run-root/etc/named.conf file. Each zone file has a name identical
to the domain name. If you change the zone through the GUI, Panel rewrites the file.
You can change a zone database by adding or deleting resource records as follows:
Using the Panel GUI. In this case, the Panel increases the Serial field value, which
means that the zone transfer operation should be performed to synchronize the
zone content with all secondary name servers.
Manually editing the file. We do not recommend this approach, since Panel
completely rewrites the zone data from the psa database if any changes are made
through the Panel GUI. Do not forget to increase the Serial field in this file.
Otherwise, only this name server will know about the changes made.
Manually editing the psa database. To do this, perform the following steps:
First, you have to insert a corresponding record into the psa.dns_recs table.
mysql> insert into dns_recs (dom_id,type,host,val) values
(2,'A','ws02.domain01.tst.','192.168.1.185');
Query OK, 1 row affected (0.00 sec)
After that, make the Panel reread the domain information from the psa database
in one of the following ways.
Through the command line:
# /usr/local/psa/admin/sbin/dnsmng update <domain_name>
Using the Panel GUI, switch the domain to slave and then back to the master
mode. In this case, you do not have to worry about the Serial field as the
Panel increases its value while restoring the file.
You can restrict the name server to transferring name zones to only the list of explicitly
assigned DNS servers. Do this by inserting the DNS server IP addresses into the misc
table of the psa database with the following command:
mysql> insert into misc (param, val) values ('DNS_Allow_Transfer1',
<dns server>);
for the first DNS server in the list.
mysql> insert into misc (param, val) values ('DNS_Allow_Transfer2',
<dns server>);
for the second DNS server, etc.
To transfer the changes made in the database to the DNS configuration file, use the
following command:
# /usr/local/psa/admin/sbin/dnsmng update <domain_name>
Services Management 35
The command shown above adds DNS server IP addresses to the common-allow-
transfer ACL, which is included in all local name zones. Every domain can have some
additional IP addresses in its ACL. Secondary servers are added to the allow-transfer list
of a domain by the Panel after adding the corresponding NS records to the domain
name zone. In addition, the secondary server must be resolvable and accessible when
it is added to the name zone.
DNS logs
The domain name service writes errors log stored in the /var/log/messages file. The
logrotate utility rotates this log on a daily, weekly, or monthly basis. Learn how to
configure log rotation in the section Log Rotation (on page 129).
FTP
To provide an FTP service, Panel uses the ProFTPD FTP server. Panel includes the
following two packages:
psa-proftpd which contains the main component.
psa-proftpd-xinetd which contains patches and configurations to work with xinetd.
FTP Startup
The ProFTPD is started by the xinetd every time the server receives an FTP request. In
the case of authorized access, the FTP service is started on behalf of the user whose
request is to be processed. For anonymous users, the service is started with the UID of
the psaftp user.
FTP Users
The FTP server allows for document access of authenticated users that are listed in the
/etc/passwd and /etc/shadow files. The first one defines the user name, group
membership, home directory, and active access method. The second one stores
password hash values. Let us look at FTP users created during the virtual hosting
setup procedure. The following are some /etc/passwd lines defining FTP user
parameters.
# grep ftp /etc/passwd
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
psaftp:x:2524:2522:anonftp psa user:/:/bin/false
ftpuser:x:10006:10001::/var/www/vhosts/domain.tst:/bin/false
ftpuser55:x:10010:10001::/var/www/vhosts/domainXX.tst:/bin/false
The first two lines are default FTP users. The psaftp is the user on behalf of whom the
FTP service is started when the Panel server receives an anonymous FTP request.
The last two lines define typical FTP users. The group ID 10001 refers to the psacln
group that contains FTP users. The psacln is added to the /etc/ftpchroot file. For every
FTP user logged into the Panel, a “chroot” procedure is executed, which ensures the
user cannot see files owned by other users.
36 Services Management
Panel stores all FTP user accounts in a single database; therefore, FTP users cannot
have the same names even if they are created for different virtual hosts. Besides, since
the FTP service cannot be name based, only one virtual host on each IP address can
provide anonymous FTP access.
FTP Configuration
The FTP server configuration parameters are stored in the /etc/proftpd.conf file. Here are
some of the parameters. A sample of the proftpd.conf file is displayed below:
DefaultServer on
<Global>
DefaultRoot ~ psacln
AllowOverwrite on
</Global>
DefaultTransferMode binary
UseFtpUsers on
TimesGMT off
SetEnv TZ :/etc/localtime
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
Each virtual host FTP configuration is stored in the /etc/proftpd.include file. The
configurations consist of two sections:
The general section configures FTP for authorized users. It configures the
following:
Virtual server name to IP address binding.
Log file path.
Write permission.
Login access allowed only to the psacln group.
Below is a sample of the general section:
<VirtualHost 192.168.37.101>
ServerName "ftp.swtrn.com"
TransferLog /usr/local/psa/var/log/xferlog
AllowOverwrite on
<Limit LOGIN>
Order allow, deny
AllowGroup psacln
Deny from all
</Limit>
The Anonymous section configures FTP for anonymous users. It configures:
An alias for the psaftp user account.
anon_ftp as the home directory that is inside the domain directory opened for the
authorized domain user.
A log file for anonymous FTP access.
User and group for anonymous FTP access.
Login access and read-only rights for everyone Below is a sample of this section:
UserAlias anonymous psaftp
<Anonymous /var/www/vhosts/domain.tst/anon_ftp>
TransferLog
/var/www/vhosts/domain.tst/statistics/logs/xferlog
PathDenyFilter "^\.quota$"
RequireValidShell off
TransferRate RETR 0.000
User psaftp
Group psaftp
<Limit LOGIN>
AllowAll
</Limit>
<Limit WRITE>
DenyAll
</Limit>
<Directory incoming>
UserOwner ftpuser
Umask 022 002
<Limit STOR>
DenyAll
</Limit>
<Limit WRITE>
DenyAll
38 Services Management
</Limit>
<Limit READ>
DenyAll
</Limit>
<Limit MKD XMKD>
DenyAll
</Limit>
</Directory>
</Anonymous>
For each domain, the ProFTPD service writes statistics for both anonymous and
authorized access to log files located in the
/var/www/vhosts/<domain_name>/statistics/logs/ directory. Once a day, Panel processes
the logs with the statistics utility and separates the statistical data into two parts:
Anonymous access information stored in the statistics/anon_ftpstat subdirectory of
the virtual host directory.
Authorized access information stored in the statistics/ftpstat/subdirectory.
In addition, the statistics utility writes the statistical data to the psa database and calls
the log rotation utility logrotate. For more information on statistics processing and log
rotation, refer to the chapter Statistics and Logs (on page 126).
Services Management 39
Mail Service
To provide a mail service, Parallels Plesk Panel supports two mail transfer agents:
Postfix and qmail.
Panel uses only one mail transfer agent at a time. You can check which of them is
currently enabled on the following page: Server Administration Panel > Tools & Settings >
Services Management. You can also do this by running the mailmng utility located in the
$PRODUCT_ROOT_D/admin/sbin/directory, where the $PRODUCT_ROOT_D is
/usr/local/psa for RPM-based systems or /opt/psa on DEB-based systems:
./mailmng --features | grep SMTP_Server
By default, Panel for Linux uses the Postfix for sending and receiving mail through the
SMTP and SMTPS protocols. You can switch to qmail by running the following
command:
# /usr/local/psa/admin/sbin/autoinstaller --select-release-current --
install-component qmail
To switch to Postfix run the following command:
# /usr/local/psa/admin/sbin/autoinstaller --select-release-current --
install-component postfix
Both Postfix and qmail use the same root directory to store incoming mail. This
directory is defined by the variable $PLESK_MAILNAMES_D in the
/etc/psa/psa.conf configuration file. By default, it is /var/qmail/mailnames.
Storing incoming mail in the same directory allows the messages remain available after
switching between mail agents.
Unlike incoming mail, the mail queue is lost while switching between the mail agents.
Therefore, before switching, we recommend you stop the SMTP service to prevent the
acceptance of email and the delivery of all queued mail. To stop the SMTP service, run
the following command:
# /usr/local/psa/admin/sbin/mailmng --stop-smtpd
To flush the queue, run the command:
for qmail: # kill -ALRM `pidof qmail-send`
for Postfix: # postqueue -f
In this section:
Restoring Mail Configuration ..............................................................................40
Installing Custom SSL Certificates for Qmail or Courier-IMAP Mail Servers .......41
Outgoing Mail from Exclusive IP Addresses .......................................................45
40 Services Management
By default, mchk runs in the background mode. To execute it in the foreground, use the -v
option. For example:
/usr/local/psa/admin/sbin/mchk -v
Note: You may not wish to restore SpamAssassin settings for mail accounts, as it requires
Perl interpreter to be run. To speed up the restore process, use the --without-spam
option.
Services Management 41
To install custom SSL certificates, you need to download the certificates to the Parallels
Plesk Panel server and then replace the installed default SSL certificates for Qmail and
Courier-IMAP servers with the downloaded custom certificates.
This section describes procedures for installing custom SSL certificates for Qmail and
Courier-IMAP servers.
In this section:
Installing an SSL Certificate for Qmail ............................................................... 42
Installing SSL Certificates for the Courier-IMAP Mail Server ............................. 44
42 Services Management
To install a custom SSL certificate for Qmail on a Parallels Plesk Panel server:
1. Create a combined .pem certificate file.
To create a combined .pem certificate file, start your favorite text editor and paste the
contents of each certificate file and the private key in the file in the following order:
a. The private key
b. The primary certificate
c. The intermediate certificate
d. The root certificate
Make sure that you include the begin and end tags of the key and each certificate
including the dash lines. The resulting text should look like this:
-----BEGIN RSA PRIVATE KEY-----
..........
(Your Private Key here)
..........
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
..........
(Your Primary SSL certificate here)
..........
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
..........
(Your Intermediate certificate here)
..........
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
..........
(Your Root certificate here)
..........
-----END CERTIFICATE-----
2. Save the combined certificate file as plesk.pem.
3. Log in to a Parallels Plesk Panel server through SSH as a root user.
4. Download the combined certificate file plesk.pem.
Services Management 43
5. Make a backup copy of the existing default SSL certificate for Qmail.
For example for RedHat or Fedora operating systems, the SSL certificate file that you
need to back up is var/qmail/control/servercert.pem.
Note: For other operating systems, the default certificate file location may be different.
3. Make a backup copy of the existing default SSL certificate for the Courier-
IMAP mail server.
For example for RedHat or Fedora operating systems, you need to back up the following
default SSL certificate files:
/usr/share/courier-imap/imapd.pem - the certificate enables secure data
transfers through the IMAP protocol.
/usr/share/courier-imap/pop3d.pem - the certificate enables secure data
transfers through the POP3 protocol.
Note: For other operating systems, the default certificate file locations may be different.
4. Open a default certificate file using your favorite text editor and replace the
contents of the file, with the content of the SSL certificate file that you want
to install.
For example, the content to be copied from a custom SSL certificate and pasted in lieu of
a default certificate file body should look like this:
-----BEGIN CERTIFICATE-----
MIIB8TCCAZsCBEUpHKkwDQYJKoZIhvcNAQEEBQAwgYExCzAJBgNVBAYTAlJPMQww
............
............
eNpAIeF34UctLcHkZJGIK6b9Gktm
-----END CERTIFICATE-----
In the current Panel version, the problem of domain and mail addresses is resolved, and
Postfix mail server uses customers' IP addresses for sending mail if possible. This targets all
outgoing mail of the Panel mail server sent by PHP mail(), sendmail, an SMTP script or
client. However, if the following conditions are true, your system may send mail from different
IP addresses:
You have Postfix 2.7
Panel is configured to support IPv6
A subscription has only a single IPv4 or IPv6,
The outgoing mail for such subscriptions can be equally sent from either the customer's IP
address or the server-defined IP address of the opposite type (IPv6 for IPv4 and vice versa).
This server-defined IP address is specified in the mail server configuration.
Another part of this feature is the sender's address validation: The system validates the MAIL
FROM header for authenticated users and corrects the header if needed. However, if the
mail is sent without authentication, say, from 127.0.0.1, through the local sendmail, or a
sender is in the white list, the system trusts the MAIL FROM header.
Requirements
This feature is supported on all operating systems which have Postfix 2.7 or later. They are
as follows:
If you independently install Postfix, run the following command to turn on the feature:
/usr/local/psa/admin/sbin/mchk
Read more about the utility in http://kb.parallels.com/944.
Root directory:
Mail lists:
/var/lib/mailman/lists/
Documentation:
/usr/share/doc/mailman-2.1.x/
In this section:
Configuring a Mailing List to Which only Members Are Allowed to Post ............ 47
Importing a List of E-mail Addresses into a Mailing List..................................... 47
Services Management 47
To configure a mailing list that only members are allowed to post to:
1. Log in to the WEB Mailman interface as the list administrator.
2. Enable the Restrict posting privilege to list members option.
Note: By default a mailing list is created with the Posts must be approved by an administrator
option enabled. That means all messages must be approved by the moderator before they
are posted to the list. Therefore, if this option is disabled and unwanted mail is posted to the
list, you can re-enable it and moderate incoming messages.
Website Applications
All earlier Panel versions (before 10.4) prohibited such scenarios as sometimes (in very rare
cases), the installation of two web apps into one directory could lead to the improper
functioning of one of them. If you want to return this restriction back, add the following lines
into /usr/local/psa/admin/conf/panel.ini:
[aps]
unsafePaths=false
Spam Protection
SpamAssassin is a rule-based mail filter that identifies spam. It uses a wide range of heuristic
tests on mail headers and body text to identify spam.
If the message destination address is included in the server-wide ignore list, then all
messages to this address will go directly to the addressed mail directory.
At the server level, you can configure SpamAssassin to mark messages with a special string if
they are recognized as containing spam. At the mailbox level, you can make SpamAssassin
delete or mark the message if it is considered as spam.
Starting from Panel 9.x, the maximum message size to filter is hardcoded in the spam
handler and set to 256KB. This value provides normal server loading. Since the
SpamAssassin service consists of perl modules, they may result in a heavy server load when
processing long messages.
In this section:
Configuring SpamAssassin ............................................................................... 50
Training SpamAssassin to Work with All Mail Accounts on the Server .............. 51
Fighting Spam on a Qmail Mail Server .............................................................. 52
Configuring SpamAssassin
The SpamAssassin configuration is stored in the spamfilter and spamfilter_preferences tables of
the psa database. You can manage it with the $PRODUCT_ROOT_D/admin/bin/spammng utility.
It displays help if started without any options.
6. Look at the message and find the last Received line. This shows where the
message was initially sent from.
If you find something like:
Received: (qmail 19514 invoked by uid 12345); 10 Sep 2008 17:48:22
+0700
it means that this message was sent via a CGI script by user with UID 12345. Use this
UID to find a corresponding domain:
# grep 12345 /etc/passwd
Received lines like:
Received: (qmail 19622 invoked from network); 10 Sep 2008 17:52:36
+0700
Received: from external_domain.com (192.168.0.1)
means that the message was accepted for delivery via SMTP and the sender is an
authorized mail user.
If the Received line contains an UID of an apache user (for example invoked by
uid 48), it means that the spam was sent via a PHP script. In this case you can try to
find the spammer using information from the spam e-mails (from/to addresses,
subjects, etc). But it is usually hard to find the spam source in this case. If you are
sure that a script is sending spam at the current moment (for example, because the
queue is growing very fast), you can use this little script to find out what PHP scripts
are running in real-time:
# lsof +r 1 -p `ps axww | grep httpd | grep -v grep | awk ' {
if(!str) { str=$1 } else { str=str","$1}}END{print str}'` | grep
vhosts | grep php
To try to find out from what folder the PHP script that is sending mail was run, create
/var/qmail/bin/sendmail-wrapper script with the following content:
#!/bin/sh
(echo X-Additional-Header: $PWD ;cat) | tee -a
/var/tmp/mail.send|/var/qmail/bin/sendmail-qmail "$@"
Note, the paths can slightly differ depending on your OS and Parallels Plesk Panel
version.
Create a log file /var/tmp/mail.send and grant it a+rw rights, make the wrapper
executable, rename old sendmail and link it to the new wrapper:
# touch /var/tmp/mail.send
# chmod a+rw /var/tmp/mail.send
# chmod a+x /var/qmail/bin/sendmail-wrapper
# mv /var/qmail/bin/sendmail /var/qmail/bin/sendmail-qmail
# ln -s /var/qmail/bin/sendmail-wrapper /var/qmail/bin/sendmail
Wait for about an hour and revert sendmail back:
# rm -f /var/qmail/bin/sendmail
# ln -s /var/qmail/bin/sendmail-qmail /var/qmail/bin/sendmail
Examine the /var/tmp/mail.send file. There should be lines starting with X-
Additional-Header pointing to domain folders where the script that sends the mail
is located.
54 Services Management
You can see all the folders from which mail PHP scripts were run by using the
following command:
# grep X-Additional /var/tmp/mail.send | grep `cat
/etc/psa/psa.conf | grep HTTPD_VHOSTS_D | sed -e
's/HTTPD_VHOSTS_D//' `
If you see no output from the command above, it means that no mail was sent using
the PHP mail() function from the Parallels Plesk Panel virtual hosts directory.
Antivirus Support
Parallels Plesk Panel for Linux supports the following antivirus software:
Parallels Premium Antivirus based on Dr.Web.
Kaspersky Antivirus.
Both these solutions provide you with real-time mail traffic scanning and malware protection
for customers. In this section you will find detailed information on these antivirus solutions.
In this section:
Parallels Premium Antivirus ............................................................................... 55
Kaspersky Antivirus ........................................................................................... 57
Services Management 55
Directory Structure
Root directory:
/var/drweb/log/drwebd.log
The Dr.Web service is a standalone drwebd daemon (also called engine), which is started
from the /etc/init.d/drwebd script. You can also stop and start it again with the following
command:
# /etc/init.d/psa stopall
# /etc/init.d/psa start
Note: these commands stop and start other Panel services: DNS server, mail server, and so
on
You can also manage it within the Services Management page in the Server Administration
Panel.
The interaction with drwebd is established through the Dr.Web client. It can change antivirus
parameters and start checking files. The client displays a full list of its attributes if run without
attributes. Also, it can extract detailed operational information from the engine. The following
command gives information about the Dr.Web version and virus database.
# /opt/drweb/drwebdc -sv -sb
By default, the virus databases are updated every 30 minutes by means of the cron task:
/opt/drweb/update/update.pl >dev/null 2>&1
Filtering Mail
56 Services Management
Dr.Web substitutes the native qmail-queue filter used for transferring incoming messages to
the qmail queue with its own utility. The utility's configuration settings are stored in the
/etc/drweb/drweb_handler.conf file.
Dr.Web filtering is activated on the mail name level. If enabled it can check incoming,
outgoing or both kinds of messages. The information is stored in the /etc/drweb/users.conf file.
The following is an example of three mail names with different Dr.Web configurations:
# grep domain01 /etc/drweb/users.conf
allow any regex ^admin@domain01.tst$
allow to regex ^user01@domain.tst$
allow from regex ^user02@domain.tst$
In the above configuration, Dr.Web will check viruses in:
Incoming and outgoing messages for admin@domain01.tst
Incoming messages for user01@domain01.tst
Outgoing messages for user02@domain01.tst
Services Management 57
Kaspersky Antivirus
Kaspersky Antivirus is a module that scans incoming and outgoing mail traffic on your server,
and removes malicious and potentially dangerous code from e-mail messages. In order to
use Kaspersky Antivirus with your Parallels Plesk Panel server, you need to install the
Kaspersky Antivirus module, then purchase and install a license key.
System Maintenance
This chapter discusses tasks that administrators may need to perform on an existing
Panel installation. In particular, the chapter provides overviews on how to manage
Panel through the command line and execute scripts or binaries on certain Panel
events. In addition, you will learn how to adjust Panel settings to fit a new network
environment or server configuration, and restart Panel to apply new settings.
In this chapter:
Managing Panel Objects Through the Command Line ...................................... 58
Executing Custom Scripts on Panel Events ....................................................... 59
Changing IP Addresses ..................................................................................... 59
Changing Paths to Services .............................................................................. 60
Restarting Panel................................................................................................ 61
Managing Services from the Command Line and Viewing Service Logs ........... 61
Cloning Panel in Virtual Environment ................................................................ 72
To learn more about Panel command line utilities, refer to Panel 11.0 Command Line
Reference at http://download1.parallels.com/Plesk/PP11/11.0/Doc/en-US/online/plesk-
unix-cli/.
System Maintenance 59
To learn how to track Panel events and set up execution of commands or custom scripts,
refer to Parallels Plesk Panel Administrator's Guide, chapter Event Tracking.
Changing IP Addresses
During the lifetime of a Parallels Plesk Panel server, you may need to change the IP
addresses employed by Panel. Two typical cases when IP addresses may need to be
changed are the following:
Reorganization of the server IP pool. Say, to substitute one IP address with another.
Relocation of Panel to another server. Change all addresses used by Panel (including the
one on which Panel resides) to those on the new server.
Every time the change happens, you should reconfigure all related system services. To help
you do this promptly, we offer the reconfigurator command line utility located in the
following directory:
on RPM-based systems:/usr/local/psa/bin.
on DEB-based systems:/opt/psa/bin.
The reconfigurator replaces IP addresses and modifies Panel and services
configuration to make the system work properly after the replacement. To do this, the utility
requires a mapping file, that includes instructions on what changes to make. Each line of the
file should describe a single change. For example, the following line instructs Panel to
change the IP address 192.168.50.60 to 192.168.50.61:
The utility also helps you with creation of the mapping file. If you call the utility with a new file
name as an option, it will create the file and write all available IP addresses to it. The IP
addresses in the file are mapped to themselves. If you want to perform a change, modify the
change instruction for a certain IP address.
Panel configuration file provides an easy way of reconfiguring Panel if a service is installed
into another directory or migrated from the current partition to another. Note that you can only
modify paths present in this file; other paths are hard-coded in Panel components.
Important: Be very careful when changing the contents of psa.conf. Mistakes in paths
specified in this file may lead to Panel malfunctioning.
System Maintenance 61
Restarting Panel
If you experience problems with Parallels Plesk Panel, for example, malfunctioning of a
service, you can try to resolve them by restarting Panel or the administrative web server sw-
cp-server. Also, a restart is necessary to apply configuration changes that cannot be made
while Panel is running.
SSO
phpMyAdmin
/var/log/sw-cp-server/error_log
/usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/c
onfig.default.php
phpPGAdmin
/var/log/sw-cp-server/error_log
/usr/local/psa/admin/htdocs/domains/databases/phpPgAdmin/conf/config
.inc.php
/var/log/messages
/etc/named.conf
FTP (ProFTPD)
/usr/local/psa/var/log/xferlog
Courier-IMAP
QMail
/etc/init.d/qmail stop
To restart the service through the command line:
/etc/init.d/qmail restart
Log files are located in:
/usr/local/psa/var/log/maillog
Postfix
/usr/local/psa/var/log/maillog
/etc/postfix/
SpamAssassin
/usr/local/psa/var/log/maillog
System Maintenance 65
Dr.Web antivirus
/usr/local/psa/var/log/maillog
/etc/drweb/
Kaspersky antivirus
/etc/kav/5.5/kav4mailservers/
66 System Maintenance
Tomcat
/var/log/tomcat5/
/usr/share/tomcat5/conf/
MySQL
/var/log/mysqld.log
/etc/my.cnf
Postgresql
/var/lib/pgsql/pgstartup.log
/var/lib/pgsql/data/postgresql.conf
System Maintenance 67
xinetd
/var/log/messages/
/etc/xinetd.conf
Watchdog (monit)
Watchdog (rkhunter)
/var/log/rkhunter.log
/usr/local/psa/etc/modules/watchdog/rkhunter.conf
68 System Maintenance
Apache
Mailman
/var/log/mailman/
AWstats
/usr/local/psa/etc/awstats/
System Maintenance 69
Webalizer:
/var/www/vhosts/<domain_name>/conf/webalizer.conf
Backup Manager
/etc/psa/psa.conf
Horde
/var/log/psa-horde/psa-horde.log
Horde configuration:
/etc/psa-webmail/horde/
Atmail
/var/log/atmail/
psa-logrotate
Samba
/var/log/samba/
psa-firewall
psa-vpn
/usr/local/psa/var/modules/vpn/openvpn.conf
72 System Maintenance
The popular and efficient way to start offering Panel services is to install Panel in a cloud and
then seamlessly scale your infrastructure and install more Panel instances as your business
grows. The challenge in this approach is that it is not possible just to copy the same Panel
again and again to different virtual machines because of the following:
Some clouds constantly change allocated IP addresses pools. If a Panel service was
bound to an IP address which was later removed from the system, the service will not be
operable.
Each new Panel should have unique entities, for example, an SSL certificate, and if you
simply keep copying Panel, all the instances will share the same certificate.
The Panel cloning technology solves these and other scaling problems.
Panel cloning is the technology of copying the same Panel instance to different virtual
machines without compromising Panel operability. Two prevailing usage scenarios of the
cloning are:
Fast Panel setup. If you wish to create virtual machines (GoDaddy cloud, Amazon cloud,
KVM, Xen, and so on) with Panel on demand, the easiest way to streamline this process
is to create an image of a virtual machine with specifically prepared Panel and then
create new machines from this preset as many times as needed.
Full backup. Cloning is a recovery solution too because almost all Panel data remain in
cloned instances. Thus, you can first copy a prepared Panel to another virtual machine
and then start the machine if your original machine becomes inoperable.
The application scope of Panel cloning is wider: For example, you can clone Panel and then
safely test new features or configurations on it, but in this section, we will consider only the
given scenarios because others are their extensions or combinations.
Before you start cloning Panel, please contact our sales representatives and provide the
range of IP addresses within which your Panel instances will be installed. Our licensing
system will activate Panel servers from this range only.
System Maintenance 73
If you want to use Panel cloning, you should start with preparing your Panel instance. The
following preparatory steps help you reset all environment- and initialization-specific settings
(like the IP addresses pool) to prevent copying of unique information to other virtual
machines. Omit steps 2 and 3 if your scenario is full backup.
1. (Fast setup, full backup) Instruct Panel to reconfigure its IP pool after restart. After
running the following command, a Panel instance will discover actual IP addresses and
reconfigure its IP pool each time you restart the corresponding virtual machine.
# /usr/local/psa/bin/ipmanage --auto-remap-ip-addresses true
Note: This step is not mandatory if a virtual machine to which you want to copy Panel
uses a static IP address. Moreover, omitting this option will make Panel start faster
because Panel will not reconfigure its IP pool on each startup. However, we highly
recommend to complete this step if you deploy Panel to a cloud.
2. (Fast setup only, optional) Initialize the instance programmatically or from the Panel GUI.
Specify the administrator's information, locale, and other initialization settings using the
init_conf command-line utility or the Panel GUI. Read more about the initialization in
the Post-Installation Setup section of the Installation, Upgrade, Migration, and Transfer Guide.
3. (Fast setup only) Prepare Panel for cloning by resetting some of its data (for example, the
administrator's password, see the full list below) and remove the license key on the next
start. Note that this utility does not perform cloning, it only modifies Panel settings.
# /usr/local/psa/bin/cloning --update -prepare-public-image true -
reset-license true
When preparing a Panel instance for cloning, avoid restarting the psa service and shutting
down the virtual machine on which the instance is installed.
We assume that you have a virtual machine with Panel and you wish to clone this machine.
The cloning procedure consists of three steps:
1. Prepare the Panel instance for cloning using the instructions we provided earlier.
2. Stop (shut down) the virtual machine.
3. Create a virtual machine image (snapshot) by means of virtual machines management
software you use. Refer to the software vendors' documentation for respective
instructions.
Once you have the virtual machine image, you can use it as a preset for new virtual
machines or as a Panel snapshot.
The following list contains the items that are reset by the cloning utility:
IP pool
Panel GUIDs
Administrator's password
74 System Maintenance
SSL certificates (only the default certificate, cloning does not change user-defined
certificates)
(Optionally) License key
The rest of the data remain intact.
CHAPTER 5
In this chapter:
Backing Up Data ............................................................................................... 76
Restoring Data .................................................................................................. 95
Migrating Data ................................................................................................... 125
76 Backing Up, Restoring, and Migrating Data
Backing Up Data
To perform a backup of Panel hosting data, you need to execute the pleskbackup utility
command that does the following:
1. Defines the data that need to be backed up.
2. Defines the way the backup process will be performed.
3. Defines properties of the files that will be contained in the backup.
4. Defines options for exporting the backup as a single file.
Note: Only the first component is obligatory; the others are optional.
The following sections explain the meaning and implementation of each component in detail.
To see a complete list of the pleskbackup commands and options, refer to the section
Backup Utility Commands and Options (on page 91).
If the command execution succeeds, a backup is created in the default server backup
location, or is exported to a file if exporting options were specified. For details on exporting
options, refer to the section Exporting Backup Files (on page 88). If the command execution
fails, a backup is not created.
You can perform advanced configuration of the backup operation through the file
$PRODUCT_ROOT_D/admin/share/pmmcli/pmmcli-rc. For more details, refer to the
section Defining How the Backup Process Is Performed (on page 90).
In this section:
Backup Objects: Hierarchy and Volume ............................................................ 77
Specifying Data for Backing Up ......................................................................... 80
Defining Properties of Files That Compose the Backup ..................................... 86
Exporting Backup Files ...................................................................................... 88
Defining How the Backup Process Is Performed ............................................... 90
Backup Utility Commands and Options ............................................................. 91
Backing Up, Restoring, and Migrating Data 77
You can create either a full or a partial backup. A full backup is the highest-level backup and
includes all data related to a Panel installation. A partial backup includes only the desired
Panel objects of any of the levels. For information on available options when creating a
partial backup, refer to the section Specifying Data for Backing Up (on page 80).
Restoring a backup, in turn, can also be either full or partial. Full restoration recovers all data
contained in a backup, and partial recovers part of this data. For information on available
options when restoring data from backups, refer to the Defining Objects for Restoration (on page
96) section.
server This backup level includes the following: License keys for Panel,
virtual host templates,
Administrator information.
website content, error
Web Presence Builder settings. documents, log files, and
SSO settings. content of mailboxes.
IP addresses.
Database server settings.
DNS settings.
Mail server settings.
Antivirus and spam protection settings.
SSL certificates.
Reseller plans, hosting plans, and add-on
plans.
Information about administrator's subscriptions,
reseller accounts, customer accounts and
websites.
Information about user roles.
Information about auxiliary users who can
access Control Panel.
Information about mail accounts and individual
settings for protection from spam and viruses .
Site isolation settings.
Settings for notification on system events.
reseller This backup level includes the following: Website content, error
documents, log files,
Reseller information.
content of mailboxes.
Reseller's hosting plans.
Resource allotments and permissions for
operations in Panel.
Allocated IP addresses.
Information about customer accounts,
subscriptions, and websites with DNS settings.
Information about user roles.
Information about auxiliary users who can
access Control Panel.
Information about mail accounts and individual
settings for protection from spam and viruses.
Backing Up, Restoring, and Migrating Data 79
customer This backup level includes the following: Website content, error
documents, log files,
Customer information.
content of mailboxes.
Hosting plans to which the customer is
subscribed.
Resource allotments and permissions for
operations in Control Panel.
IP addresses used by customer's
subscriptions.
Information about websites with DNS settings.
Information about user roles.
Information about auxiliary users who can
access Control Panel.
Information about mail accounts and individual
settings for protection from spam and viruses.
subscription This backup level includes the following: Website content, error
documents, log files,
Information about a subscription, its owner and
associated hosting plan. content of mailboxes.
Generally speaking, the data that can be backed up with one call of the pleskbackup utility
are represented by any single cell of the following table.
Server (All)
command: Excluding resellers
server
options:
--exclude-
reseller or
--exclude-
reseller-file
Excluding customers
options:
--exclude-client
or
--exclude-
client-file
Excluding
subscriptions
options:
--exclude-domain
or
--exclude-
domain-file
Backing Up, Restoring, and Migrating Data 81
Excluding customers
options:
--exclude-client
or
--exclude-
client-file
Excluding
subscriptions
options:
--exclude-domain
or
--exclude-
domain-file
Excluding
subscriptions
options:
--exclude-domain
or
--exclude-
domain-file
82 Backing Up, Restoring, and Migrating Data
Example 1: With one call of pleskbackup, you can back up hosting data for several
resellers (rows 5 or 6 in the table, depending on what is more convenient: to list resellers that
should be included or those to be excluded) and restricting the backup data to configuration
of web hosting on sites owned by the resellers or their customers (column 4 in the table).
To define the backup level and select backup objects, the commands of the pleskbackup
utility are used.
Objects that should be excluded from the backup are specified by their usernames (reseller,
customer accounts) or domain names (subscriptions). This can be done as follows:
Command line specification. The backup command takes objects identifiers as values of
the --exclude-<reseller|client|domain> option separated by commas.
File specification. The backup command takes the objects identifiers from the file
specified by the --exclude-<reseller|client|domain>-file option. The file
must be in plain text format, and object identifiers are separated by line breaks (that is,
one identifier per line).
Note: It is acceptable to use both specifications in one command. In such a case, all
specified objects are excluded from the backup.
To back up all reseller accounts except for several selected resellers:
pleskbackup resellers-name --exclude-reseller=<login1>,<login2>[,<login n>]
or pleskbackup resellers-name --exclude-reseller-file=<file>
For example,
pleskbackup --resellers-name --exclude-reseller=johndoe,janedoe
or
pleskbackup --resellers-name --exclude-reseller-file="etc/backup
lists/backup"
For example,
pleskbackup resellers-name johndoe --exclude-
domain=example.com,example.net,example.org
or
pleskbackup resellers-name johndoe --exclude-domain-file="etc/backup
lists/backup"
Restricting backup to only mail content, only hosting content, or only their
configuration
The amount of backup data can be further narrowed to backing up either mail or physical
hosting content and configuration by using the --only-mail or --only-hosting options,
respectively.
Such backups are useful when the objects content is backed up by a third-party system.
To back up mail configuration on subscriptions belonging to a customer:
pleskbackup clients-<name|id> <name|id> --only-mail --configuration
For example,
pleskbackup clients-id 42 --only-mail --configuration
86 Backing Up, Restoring, and Migrating Data
If Panel's log files related to the hosted objects are not required to be backed up, they can be
excluded from the backup by using the --skip-logs option.
Specifying that archives with backup object contents should not be compressed
By default, Panel saves backed up content to compressed .zip archives to save disk
space when the backup is stored. However, restoring backups that contain compressed
archives requires almost twice as much disk space as restoring those with uncompressed
files. If you want to create your backups without compression, use the -z option in your
backup command.
Specifying that a prefix should be added to the names of the backup files
In order to better distinguish files that were created during one backup session from another,
pleskbackup adds a prefix to the backup file name. By default, it is backup, so every
backup file name looks like backup_<file-name>.<ext>. The prefix in names of the files
that compose a particular backup can be customized by using the --prefix option. The
option's value will be added as a prefix to the names of files of the created backup.
For example, to create a backup of the server mail configuration so that all files in the backup
have the prefix mail-friday:
pleskbackup server --only-mail --configuration --prefix="friday"
Backing Up, Restoring, and Migrating Data 87
Specifying that backup files should be split into parts of the specified size
The pleskbackup utility is capable of splitting backup files into parts of a particular size,
which is extremely useful in cases when the file size is critical. Such cases could include the
following:
if backups are burnt to DVDs, file size should not exceed approximately 4 Gbytes
if backups are stored on the FAT32 file system, file size should not exceed approximately
4 Gbytes
if backups are stored on FTP, the FTP server may have its own restrictions on the size of
a single file transferred to the server
To make pleskbackup split the backup files to parts of a particular size, use the -s|--split
option and specify the required size as the option value. For details on how to specify the
size, refer to the section Backup Utility Commands and Options (on page 91). The default value
used by pleskbackup if no custom size is specified is 2 Gbytes. The utility numbers file
parts created as a result of a split by adding numerical suffixes to the file names starting from
.1.
For example, to back up a subscription and split backup files into parts of no more than 700
Mbytes:
pleskbackup domains-name example.com --only-hosting --split=700M
88 Backing Up, Restoring, and Migrating Data
Panel is capable of exporting the created backup as a single .zip file in one of the following
ways:
to stdout
to a local file system
to an FTP server
To export the backup as a single file, use the --output-file option. Each particular export
mode requires specific option values.
Important: After a backup is exported, pleskbackup removes it from the Panel's backup
repository.
The exported file can also be created uncompressed and/or split into parts of a particular
size, just like the files forming the backup in the repository (details (on page 86)).
Exporting to stdout
To export a backup as a file to stdout, use the --output-file option with the stdout
value.
To export a backup as a file to a local file system, use the --output-file option with a
<full-path-to-file>\<file-name> value.
For example, to create a backup of a subscription with ID 1 and export it to the file domain1.tgz
located at /usr/local/irregular-backups/ folder:
pleskbackup domains-id 1 --output-file=/usr/local/irregular-
backups/domain1.tgz
Exporting to FTP server
To export a backup as a file to an FTP server, use either of the following options:
--output-file=ftp://<login>:<password>@<server>/<filepath>
--output-file=ftp://<server>/<filepath> --ftp-login=<ftp login>
--ftp-password=<ftp password>
You may want to use a passive mode FTP connection if a firewall prevents the export. For
this, use the --ftp-passive-mode option.
Backing Up, Restoring, and Migrating Data 89
For example, to create backup of a subscription with ID 1 and export it to an FTP server
example.com to the storage/backups/ directory, using johndoe as login and jjFh6gsm as password:
pleskbackup domains-id 1 --output-
file=ftp://johndoe:jjFh6gsm@example.com/storage/backups
or
pleskbackup domains-id 1 --output-file=ftp://example.com/storage/backups --
ftp-login=johndoe --ftp-password=jjFh6gsm
90 Backing Up, Restoring, and Migrating Data
You can prevent the start of the backup operation if your server has not enough disk space
to complete it. To set the free disk space requirements, change the parameters in the file
$PRODUCT_ROOT_D/admin/share/pmmcli/pmmcli-rc.
There are two ways to prevent the start of the backup operation:
Specify minimal free disk space on your server.
If the server does not have the specified disk space, Panel will not start the backup
operation. Set the minimal free disk space in MB by changing the value of the
FREE_DISK_SPACE parameter. Say, to prevent the backup if free disk space on the
server is less than 100 MB, edit the line in the following way:
FREE_DISK_SPACE 100
Restrict the backup if your server does not have enough free disk space to store the
backup content. If this option is turned on, Panel calculates the future backup size and
compares it with the free disk space on the server. If there is not enough disk space,
Panel will not start the backup operation. Note that this option can significantly increase
the backup time.
To turn this option on, set the CHECK_BACKUP_DISK_SPACE to 1. To turn this option off,
set the parameter to 0. Say:
CHECK_BACKUP_DISK_SPACE 0
Suspending websites
If your backup will include websites, we recommend that you suspend them during the
backup process by using the --suspend option of the backup utility. This will help you avoid
possible errors that may be caused by changes made to the site configuration or content
during the backup.
The suspension is made as short as possible: each site is suspended only for the time it is
being backed up: The site is started automatically as soon as its data are processed.
Backing Up, Restoring, and Migrating Data 91
Usage
pleskbackup <command> [<arguments>] [<options>]
Commands
Exclude Options
Option Description
--exclude- Skips resellers with the specified logins during backup.
reseller[=<login1>,<login2>,..
.]
--exclude-reseller- Skips resellers listed in the specified file during backup.
file[=<file>]
--exclude- Skips customers with the specified logins during backup.
client=[<login1>,<login2>,...]
--exclude-client-file=<file> Skips customers listed in the specified file during backup.
--exclude- Skips domain with the specified names during backup.
domain[=<name1>,<name2>,...]
--exclude-domain-file=<file> Skips domains listed in the specified file during backup.
General Options
Option Description
-v|--verbose Shows more information about the backup process. Multiple -v
options increase verbosity. For the maximum verbosity level, define 5
options.
-c|--configuration Backs up only configurations of Plesk objects, excluding their content.
-s|-- Splits the backup files into parts of the specified size. The parts are
split[=<integer>[K|M| numbered by appending numerical suffixes starting with .1.
G]]
Size is specified in Kbytes, Mbytes or Gbytes. If none is defined, size
is interpreted as being in bytes.
If no argument is specified, a default value of 2 Gbytes is used.
-z|--no-gzip Sets that object content is archived without compressing.
94 Backing Up, Restoring, and Migrating Data
Option Description
--only-mail Backs up only mail configuration and content.
When used with the resellers|clients|domains-login|id
commands, backs up configuration of domain-level mail system, and
content and configuration of mail accounts.
When used with the server command, also backs up server-wide
mail configuration.
Cannot be used with the --only-hosting option.
--only-hosting Backs up only physical hosting configuration and Web site content,
including site applications, databases and subdomains.
Cannot be used with the --only-mail option.
--suspend Suspends domains during backup operation.
-f| --from-file=<file> Backs up resellers|customers|domains listed in the specified file,
ignoring those specified in the command line as arguments.
The file should be in plain text format and should contain a list of
resellers|customers|domains, one per line.
Used only with the resellers-name, resellers-id, clients-
name, clients-id, domains-name, domains-id commands.
Depending on the command, resellers|customers|domains are listed
in the file by either logins or IDs.
--skip-logs Sets that log files are not saved to backup.
--prefix=<string> Adds a specified prefix to the backup file names.
Used to customize backup file name which is created with the backup
prefix by default.
FTP Options
Option Description
--ftp- Specifies FTP login that will be used for uploading backup file to the
login=<ftp_login> FTP server.
--ftp- Specifies password that will be used for uploading backup file to the
password=<ftp_password FTP server.
>
--ftp-passive-mode Specifies that a passive mode FTP connection should be used.
Option Description
--output-file Exports backup as a single file to stdout and removes
backup from Plesk repository.
Backing Up, Restoring, and Migrating Data 95
Option Description
--output- Exports backup as a single file with the specified name to
file=<fullpath/filename> a local file system and removes backup from Plesk
repository.
--output- Exports backup as a single file to the specified FTP
file=<ftp://[<login>[:<passwor server and removes backup from Plesk repository.
d>]@]<server>/<filepath>>
The FTP_PASSWORD environment variable can be used
for setting a password.
The --ftp-login and --ftp-password FTP options
can be used for setting login and password.
Restoring Data
To perform restoration of Panel hosting data, you should execute the pleskrestore utility
command that does the following:
1. Defines the Panel objects to be restored.
2. Defines how the restore process will be performed.
3. Defines conflict resolution rules and policies.
The following sections explain each component in detail.
To see a list of the pleskrestore commands and options, refer to the section Restoration
Utility Commands and Options (on page 124).
In this section:
Defining Objects for Restoration ........................................................................ 96
Defining How the Restore Process is Performed ............................................... 102
Conflict Resolution Rules and Policies .............................................................. 103
Restoration Utility Commands and Options ....................................................... 124
96 Backing Up, Restoring, and Migrating Data
The source backup file defined for restoration can be of one of the following types:
<info>.xml - backup metadata file, when restoring from backup located in Panel's
repository.
<backup>.<zip|tar> - archived backup file, when restoring from an exported backup.
For example, to restore the whole server backup, you choose a <backup repository
root>/<server>.xml file, or an exported server backup file. To restore a client belonging
to a reseller, you choose a <backup repository root>/resellers/<reseller
ID>/clients/<client ID>/<client>.xml file.
Defining the level of restored objects allows you to narrow the amount of restored data
according to your needs. For example, you may want to restore only subscriptions which
belong to a customer or a reseller, skipping all other data not related to subscriptions.
To define the level of restored objects, use the -level option with an appropriate value. The
option is required, so in cases when you do not need any narrowing but just wish to restore
all data from a backup, define the level equal to the level of the file.
Note: When the whole server backup is restored, license keys are not restored by default. To
restore license keys along with other server content, use the -license option in your
restore command.
To perform a more selective restore, use a filter (the -filter option) which selects
particular objects of the specified level (resellers, customers, subscriptions) to be restored.
The objects are specified by their names, which are domain names for subscriptions, and
usernames for resellers and customers. The specification can be done as follows:
Command line specification. The restore command takes object identifiers as values of
the -filter option defined in the following string:
list:<item1>,<item2>,...,<itemN>.
File specification. The restore command takes the objects identifiers from the file
specified as an argument of the -filter option. The file must be in plain text format,
and object identifiers are separated by line breaks (that is, one identifier per line).
In this section:
Backup File Structure ........................................................................................ 98
The repository is structured as follows, starting with the content of the repository root folder
(we omit auxiliary files and folders which are irrelevant for backing up and restoring Panel
data using pleskbackup and pleskrestore utilities).
<info>.xml Metadata files of full and server-level
backups, one per backup, describe
configuration and content of server,
admin, and all their descendants.
Backing Up, Restoring, and Migrating Data 99
Files of each backup are placed in the repository folders according to the described
structure.
f a partial backup is created, its files will be placed according to the location of the backup
objects in the hierarchy. For example, if backing up domain example.com owned by reseller
JaneDoe, its files will be located in the <repository root
directory>/resellers/JaneDoe/domains/example.com/ folder. If backing up
reseller, JohnDoe, who owns a domain joe.info and has one client, DukeNukem, who owns
domain sample.org, the backup files will be located in the following folders:
1. <repository root directory>/resellers/JohnDoe/
2. <repository root directory>/resellers/JohnDoe/domains/joe.info/
3. <repository root directory>/resellers/JohnDoe/clients/DukeNukem/
4. <repository root
directory>/resellers/JohnDoe/clients/DukeNukem/domains/sample.org
/
To distinguish files belonging to different backups of the same object, a specific prefix and
suffix are added to the file names:
the backup is added by default, and, if you like, you can change it to your own on a per-
backup basis
a suffix designating the backup creation date is always added to each backup file, and
the date format is <yymmddhhmm>. For example, the files of a backup created on 6 April
2011, 8:58 PM will have the suffix 1104062058.
Panel is capable of exporting a backup as a single .tgz file. Each archive has the same
structure as the repository, the only difference is that there is only one <info>.xml file on
each level.
If a partial backup is exported, the resulting file structure is reduced from the top so that the
highest level corresponds to the level of the highest backup object. For example, if a backup
of a single customer (called, for example, SandyLee) is exported, the resulting file will have
the following structure:
zip {
<sandy lee info>.xml
<content>.zip
domains/
subscription1/
...
subscription_N/
...
}
102 Backing Up, Restoring, and Migrating Data
Suspending websites
If you are going to restore websites, we recommend that you suspend them during the
restoration by using the -suspend option. This will help you avoid possible errors in the
restored sites that may be caused by changes made to the site configuration or content
during the restoration.
The suspension is made as short as possible: each site is suspended only for the time it is
being restored: The site is started automatically as soon as the data are processed.
1. Non-verbose mode. Default mode. The minimum level, only general errors are displayed,
sauc as, syntax errors (no or wrong command specified, invalid input parameters),
runtime errors and unhandled exceptions, and so on.
2. Verbose mode. Restore runs with verbosity level which additionally includes deployer
errors, information about conflicts (read about restore conflicts in the section Conflict
Resolution Rules and Policies (on page 103)), and so on. Enabled by adding the -verbose
option to the pleskrestore command.
Backing Up, Restoring, and Migrating Data 103
Types of Conflicts
Conflict Resolutions
Overuse. Means that objects are restored even when the resources are overused. Can
be applied only to objects that belong to a reseller who is working in the oversell mode.
Rename. Means that unique resources for the restored domain are reassigned with the
specified name, existing in the system (mapping).
The restoration utility brings a set of default, hard-coded conflict resolution policies, which are
as follows:
for timing conflicts - Overwrite
for common resource usage conflicts - Overuse
for unique resource usage conflicts - Do not restore
for configuration conflicts - Automatic
The default policies are always applied during restoration and cannot be changed or
overridden.
Applying default policies may not resolve all the conflicts that occur. In such cases, the
person performing the restore should define additionally custom rules and/or policies that
resolve the remaining conflicts. Custom rules and policies are defined in an XML format as
described in the section Resolutions Description Format (on page 107).
In this section:
Custom Conflict Resolutions ............................................................................. 105
In this section:
Conflict Description Messages .......................................................................... 105
Resolutions Description Format ......................................................................... 107
Samples of Policy Description ........................................................................... 115
Samples of Conflict Resolution With Rules ........................................................ 115
In this section:
Policies .............................................................................................................. 107
Rules ................................................................................................................. 110
Policies
conflict-resolution-rules
Required. Document root element.
policy
Required. Contains the policy descriptions. Child elements, if present, must be placed in
the order shown on the scheme.
timing
Optional. Contains a description of the policy on resolving timing conflicts. See the
structure below.
Must be present in the document if a timing policy should be used during the restore.
May not be present in the document if no policy is required for timing conflicts.
resource-usage
Optional. Contains a description of the policy on resolving resource usage conflicts.
See the structure below.
Must be present in the document if a resource usage policy should be used during the
restore.
May not be present in the document if no policy is required for resource usage
conflicts.
configuration
Optional. Contains a description of the policy on resolving configuration conflicts. See
the structure below.
Must be present in the document if a configuration policy should be used during the
restore.
May not be present in the document if no policy is required for configuration conflicts.
rule
Optional. Contains the rule descriptions. For details on the node structure, refer to the
Resolutions Description Format: Rules section (on page 110).
The policy elements have the same structure:
resolution
Required. Contains a definition of conflict resolution. Structured as follows:
Backing Up, Restoring, and Migrating Data 109
The resolution element must not be empty, it is required that it contains one, and only
one of its child elements:
do-not-restore
Sets the Do Not Restore resolution, empty value.
proceed-with-current
Sets the Proceed With Current resolution, empty value.
automatic
Sets the Automatic resolution, empty value.
overuse
Sets the Overuse resolution, empty value.
overwrite
Sets the Overwrite resolution, empty value.
rename
Sets the Rename resolution, empty value.
new-name
Required. Makes sense only if defined for configuration conflicts. Specifies the name
of a new configuration that should be assigned to all conflict objects. The value must
be a string.
110 Backing Up, Restoring, and Migrating Data
Rules
conflict-resolution-rules
Required. Document root element.
policy
Required. Contains the policy descriptions. For details on the node format, refer to the
section Resolutions Description Format: Policies.
The element content must reflect the conditions under which the conflicts were
detected.
rule
Optional. Contains a rule description.
Must be present in the document when defining conflict resolution rules. Should be
present as many times as the number of unresolved conflicts.
At least one of the attributes (conflict-id, conflict-guid) MUST be present.
conflict-id
Optional. Defines the ID of the conflict being resolved. Value is an integer.
The ID should be obtained from the conflict description returned by
pleskrestore (the "/conflicts-description/conflict[@id]" attribute
value)
conflict-guid
Optional. Defines the global ID of the conflict being resolved. Value is a string.
The GUID should be obtained from the conflict description returned by
pleskrestore (the "/conflicts-description/conflict[@guid]"
attribute value).
If omitted, the conflict for resolution is identified by ID.
dump-objects
Optional. Holds a collection of descriptions of backup objects involved in the
conflict and having the same conflict resolution
Must be present in the document in case when different objects involved in the
same conflict should be resolved in different ways.
May not be present in the document in cases when all objects involved in the
conflict should be resolved the same way.
See the structure below.
resolution
Required. Contains a definition of the resolution of the conflict. See the structure
below.
dump-objects structure:
112 Backing Up, Restoring, and Migrating Data
node
Required. Contains a description of the backup object involved in the conflict.
The element contents must be taken from the conflict description returned by
pleskrestore (the "/conflicts-description/conflict/conflicting-
objects/node" element).
Structured as follows:
Backing Up, Restoring, and Migrating Data 113
name
Required. Specifies the object type. Value must be a string.
context
Optional. Holds a collection of data specifying the object position in the backup.
path
Required if the context element is present in the document. Specifies the location of
the object definition in the backup metadata. Value must be a string conforming to the
XPath notation.
attributes
Required, holds a collection of the object properties.
attribute
Required. Specifies a particular property of the object (e.g., login, ID, GUID, etc.),
empty value.
name
Required. Specifies the property name. Value must be a string.
value
Required. Specifies the property value. Value must be a string.
resolution structure:
114 Backing Up, Restoring, and Migrating Data
The resolution element must not be empty. It is required that it contains one, and only
one of its child elements:
do-not-restore
Sets the Do Not Restore resolution for the conflict, empty value.
proceed-with-current
Sets the Proceed With Current resolution for the conflict, empty value.
automatic
Sets the Automatic resolution for the conflict, empty value.
overuse
Sets the Overuse resolution for the conflict, empty value.
overwrite
Sets the Overwrite resolution for the conflict, empty value.
rename
Sets the Rename resolution for the conflict, empty value.
new-name
Required. Specifies the name of a unique resource that should be assigned to the
conflicting objects. Value must be a string.
Makes sense only for unique resource usage conflicts (mapping of IP, database
server, object owner).
Backing Up, Restoring, and Migrating Data 115
This section contains examples of conflicts that may appear and their possible resolutions.
In this section:
Sample 1: Configuration Conflict with Missing IP Address ................................. 116
Sample 2: Configuration Conflict With Missing Database Server ....................... 119
116 Backing Up, Restoring, and Migrating Data
This sample represents descriptions of a conflict which was unresolved upon using default
policies, and its resolution.
The conflict appears because of the following mismatch in backup data and the destination
Panel configuration:
Subscription example.com owned by the reseller Reseller with ID 30 does not have
with ID 30 has web hosting configured on shared shared IP address 192.0.2.200 in
IP address 192.0.2.200. his or her IP pool.
The conflict is resolved with IP mapping suggesting that the restored subscription will be
hosted on shared IP 192.0.2.34 which is in the owner's IP pool.
Note that the conflict resolution XML contains no conflict resolution policies.
In this section:
Conflicts Description .......................................................................................... 117
Conflicts Resolution........................................................................................... 118
Backing Up, Restoring, and Migrating Data 117
Conflicts Description
<conflicts-description>
<conflict id="0">
<type>
<configuration>
<reason-description>
<required-resource-description>
<ip type="shared" value="192.0.2.200"></ip>
</required-resource-description>
<plesk-object-identifier>
<!-- beginning of definition of Panel object that conflicts with
an object in the backup -->
<!-- In resource usage conflicts, the plesk-object-identifier
element specifies Panel object which is an owner of the conflicting
resource. In this example, the conflicting resource is IP, and its owner is
a described reseller with ID 30. -->
<type>reseller</type>
<database-id>30</database-id>
<guid>93dbe1b1-cff5-430f-8466-5b810099772f</guid>
</plesk-object-identifier>
<!-- end of definition of Panel object that conflicts with an
object in the backup -->
</reason-description>
<resolve-options>
<option name="do-not-restore"></option>
<option name="rename"></option>
<option name="automatic"></option>
</resolve-options>
<!-- resolve-options element lists all resolutions that are
possible for this particular conflict. When composing the conflict
resolution rule, you should choose one of these resolutions. -->
</configuration>
</type>
<conflicting-objects>
<!-- beginning of definition of backup objects that conflict with
destination Panel objects. Here, it is a domain example.com -->
<node children-processing-type="" name="domain">
<attributes>
<attribute name="id" value="25"></attribute>
<attribute name="guid" value="0822c175-a10d-459e-bd3a-
e5cbc497e1f0"></attribute>
<attribute name="owner-guid" value="93dbe1b1-cff5-430f-8466-
5b810099772f"></attribute>
<attribute name="name" value="example.com"></attribute>
</attributes>
</node>
</conflicting-objects>
<!-- end of definition of backup objects that conflict with destination
Panel objects -->
<overview>
<!-- beginning of more detailed conflict overview. Here, the conflict
appears because the required IP 192.0.2.200 is not in the owner's IP pool -
->
<object>
<message>backup__restore__conflict_object_name</message>
<name>example.com</name>
<type>domain</type>
<reasons>
118 Backing Up, Restoring, and Migrating Data
<reason>
<message>backup__restore__conflict_configuration_reason_ip</message>
<param name="ip-address" value="192.0.2.200"></param>
<param name="ip-type" value="shared"></param>
<param name="type" value="reseller"></param>
</reason>
</reasons>
</object>
</overview>
<!-- end of detailed conflict overview -->
</conflict>
</conflicts-description>
Conflicts Resolution
<?xml version="1.0" encoding="UTF-8"?>
<resolve-conflicts-task-description>
<conflict-resolution-rules>
<policy />
<rule conflict-id="0">
<dump-objects>
<node name="domain">
<attributes>
<attribute name="id" value="25"></attribute>
<attribute name="guid" value="0822c175-a10d-459e-bd3a-
e5cbc497e1f0"></attribute>
<attribute name="owner-guid" value="93dbe1b1-cff5-430f-8466-
5b810099772f"></attribute>
<attribute name="name" value="example.com"></attribute>
</attributes>
</node>
</dump-objects>
<resolution>
<!-- beginning of the conflict resolution definition: IP mapping:
upon restore, the conflicting domain example.com should have hosting
configured on IP 192.0.2.34 -->
<rename new-name="ip-type:shared:ip-address:192.0.2.34"/>
</resolution>
<!-- end of the conflict resolution definition -->
</rule>
</conflict-resolution-rules>
</resolve-conflicts-task-description>
Backing Up, Restoring, and Migrating Data 119
This sample shows a description and resolution of configuration conflicts which was
unresolved due to the absence of the required database server on the destination server.
The conflicts appear because of the following mismatches in backup data and destination
Panel configuration.
These conflicts are resolved with database mapping (Rename resolution) suggesting that the
first databases will be restored onto the MySQL server with host name 192.0.2.12, and the
second onto the local MySQL database server.
In this section:
Conflicts Description .......................................................................................... 120
Conflicts Resolution........................................................................................... 123
120 Backing Up, Restoring, and Migrating Data
Conflicts Description
<conflicts-description>
<conflict id="0">
<type>
<configuration>
<reason-description>
<required-resource-description>
<db-server host="192.0.2.15" type="mysql" port="3306"></db-
server>
</required-resource-description>
<plesk-object-identifier>
<!-- beginning of definition of Panel object that conflicts with
an object in the backup. In resource usage conflicts it is owner of the
conflicting resource. Here, it is Panel administrator who is the owner of
all database servers -->
<type>admin</type>
<database-id>1</database-id>
<guid>00000000-0000-0000-0000-000000000000</guid>
</plesk-object-identifier>
<!-- end of definition of Panel object that conflicts with an
object in the backup -->
</reason-description>
<resolve-options>
<option name="do-not-restore"></option>
<option name="rename"></option>
<option name="automatic"></option>
</resolve-options>
</configuration>
</type>
<conflicting-objects>
<!-- beginning of definition of backup objects that conflict with
destination Panel objects. Here, it is database mysql_db2_7469 -->
<node children-processing-type="" name="database">
<attributes>
<attribute name="guid" value="86124f4a-5935-48c4-80df-
6d3e9c645378_db_20"></attribute>
<attribute name="owner-guid" value="86124f4a-5935-48c4-80df-
6d3e9c645378"></attribute>
<attribute name="name" value="mysql_db2_7469"></attribute>
</attributes>
</node>
</conflicting-objects>
<!-- end of definition of backup objects that conflict with destination
Panel objects -->
<overview>
<!-- beginning of detailed overview of the conflict. This conflict
appears because database mysql_db2_7469 requires MySQL database server with
host name 192.0.2.15 listening on port 3306, which is not configured on the
destination Panel. -->
<object>
<message>backup__restore__conflict_object_complex_name</message>
<name>mysql_db2_7469</name>
<type>database</type>
<owner-name>sample.net</owner-name>
<reasons>
<reason>
<message>backup__restore__conflict_configuration_reason_db</message>
Backing Up, Restoring, and Migrating Data 121
<object>
<message>backup__restore__conflict_object_complex_name</message>
<name>mysql_db1_6319</name>
<type>database</type>
<owner-name>69.sample.net</owner-name>
<reasons>
<reason>
<message>backup__restore__conflict_configuration_reason_db</message>
<param name="db-type" value="mysql"></param>
<param name="db-host" value="192.0.2.15"></param>
<param name="db-port" value="3306"></param>
<param name="type" value="admin"></param>
<param name="name"
value="backup__restore__object_plesk_admin"></param>
</reason>
</reasons>
</object>
</overview>
<!-- end of detailed overview of the conflict -->
</conflict>
</conflicts-description>
Backing Up, Restoring, and Migrating Data 123
Conflicts Resolution
<?xml version="1.0" encoding="UTF-8"?>
<resolve-conflicts-task-description>
<conflict-resolution-rules>
<policy />
<rule conflict-id="0">
<!-- beginning of the first conflict resolution rule: restore the
database described in the node element on local MySQL server listening on
the port 3306 -->
<dump-objects>
<node name="database">
<attributes>
<attribute name="name" value="mysql_db2_7469"/>
</attributes>
</node>
</dump-objects>
<resolution>
<rename new-name="host:192.0.2.12:port:3306"/>
</resolution>
</rule>
<!-- end of the first conflict resolution rule -->
<rule conflict-id="1">
<!-- beginning of the second conflict resolution rule: restore the
database described in the node element on local MySQL server listening on
the port 3306 -->
<dump-objects>
<node name="database">
<attributes>
<attribute name="name" value="mysql_db1_6319"/>
</attributes>
</node>
</dump-objects>
<resolution>
<rename new-name="host:localhost:port:3306"/>
</resolution>
</rule>
<!-- end of the second conflict resolution rule -->
</conflict-resolution-rules>
</resolve-conflicts-task-description>
124 Backing Up, Restoring, and Migrating Data
Usage
pleskrestore <command> [<arguments>] [<options>]
Commands
Options
Migrating Data
You can migrate data to Parallels Plesk Panel 11.0.0 from other servers managed by Panel
10 or earlier by using the Panel's Migration Manager function. This function is available in
Server Administration Panel > Tools & Settings > Migration Manager if the corresponding
component is installed on the server. This component is not included in typical installations.
For detailed information about migrating data to Panel-managed servers, refer to the
Installation, Upgrade, Migration, and Transfer Guide.
CHAPTER 6
Two other utilities, Webalizer and AWstats, also parse the services logs and generate
HTML files with the statistical data.
Details about where the log files reside and how the utilities process them are given in
this chapter.
System services logs contain traffic usage data and operational details that may be
useful for troubleshooting. These data contain, for example, errors and access
information.
The logs produced by Apache, FTP and mail services for each domain are stored in
/var/www/vhosts/<domain_name>/statistics/logs/. sw-cp-server logs are stored in /var/log/sw-
cp-server/ (error log) and $PRODUCT_ROOT_D/admin/logs/ (access log).
To save disk space, Panel rotates logs: it removes the information written before a
specified date or the least relevant information when the log size reaches a limit. For
more information on logs rotation, see the section Log Rotation (on page 129).
Processing Statistics
Once a day, Panel runs the statistics utility. This gets the statistical data from the
services log files, calculates daily traffic usage values for each domain and customer,
and writes these values to the DomainsTraffic and the ClientsTraffic tables of the psa
database. You can also run the statistics utility manually to calculate statistics for all
domains or a particular domain. For details, see the section Calculating Statistics from
Logs (on page 128).
Webalizer and AWstats are third-party utilities that represent statistical information from
log files in the HTML format. These utilities store the files for each domain in the
subdirectories of /var/www/vhosts/<domain_name>/statistics. You can view HTML statistics
in the Panel GUI or make Panel send them to your e-mail address. For instructions on
how to set up automatic sending of resource usage reports, see the section Resource
Usage Reports (on page 131).
In addition, you can recalculate statistic for previous months using the AWstats utility.
For instructions on how to do this see the section Recalculating Statistics for Previous
Months (on page 128).
Statistics and Logs 127
In this chapter:
Calculating Statistics from Logs......................................................................... 128
Recalculating Statistics for Previous Months ..................................................... 128
Log Rotation ...................................................................................................... 129
Resource Usage Reports .................................................................................. 131
128 Statistics and Logs
If you need to recalculate traffic usage statistics, you can run the statistics utility
manually. It is located in the /usr/local/psa/admin/sbin/(on RPM-based OSes)
or /opt/psa/bin (on DEB-based OSes) statistics directory.
To recalculate statistics for all domains, run the utility without options or
with the --calculate-all option:
# ./statistics --calculate-all
To recalculate statistics for a particular domain, run the utility with the --
calculate-one option:
# ./statistics --calculate-one --domain-name=<domain_name>
3. Analyze the domain log files with awstats by running the command:
$awstats $awstats_gen_opts -
LogFile=$HTTPD_VHOSTS_D/${vhost_name}/statistics/logs/access_log.proce
ssed
This command creates subdirectories with the names "YYYY-MM" in the
$HTTPD_VHOSTS_D/<domain_name>/statistics/webstat directory. "YYYY"
and "MM" show the year and the month in which the corresponding statistics were
collected.
If you want to rebuild statistics pages for a long period, you should start
recalculation from the earliest log files. For example, if you have set the number of
log files to 10 analyze files in the following order: access_log.processed.10,
access_log.processed.9, … access_log.processed.1, access_log.processed.
4. If any of directories with names in 'YYYY-MM' format for the
recalculation period are missing, create them by running the command:
for y in <year_first> <year_last> ; do for m in `seq 1 12` ; do mkdir
${HTTPD_VHOSTS_D}/${vhost_name}/statistics/webstat/$y-$(printf "%.2d"
$m) ; done ; done
<year_first> and <year_last> are the first and the last years of the period for which
you want to recalculate statistics.
5. Run the following cycle to build statistics pages:
for y in <year_first> <year_last> ; do \
for m in `seq 1 12` ; do \
dest_dir=$HTTPD_VHOSTS_D/$vhost_name/statistics/webstat/$y-
$(printf "%.2d" $m) ; \
$awstats $awstats_gen_opts -month=$m -year=$y -output >
$dest_dir/awstats.${vhost_name}-http.html ; \
ln -s $dest_dir/awstats.${vhost_name}-http.html
$dest_dir/index.html ; \
for output in alldomains allhosts lasthosts unknownip allrobots
lastrobots session urldetail urlentry urlexit osdetail unknownos
refererse refererpages keyphrases keywords errors404 ; do \
$awstats $awstats_gen_opts -month=$m -year=$y -output=$output
> $dest_dir/awstats.${vhost_name}-http.$output.html ; \
done ; \
done ; \
done
6. Run statistics to update the upper frame navigation menu with a
month listing:
$PRODUCT_ROOT_D/admin/sbin/statistics --calculate-one --domain-
name=$vhost_name
Log Rotation
Parallels Plesk Panel rotates logs using the logrotate utility. This is located in the
$PRODUCT_ROOT_D/logrotate/sbin/logrotate directory, where the
$PRODUCT_ROOT_D is /usr/local/psa for RPM-based systems or /opt/psa on
DEB-based systems.
130 Statistics and Logs
/usr/local/psa/var/log/xferlog.processed {
missingok
rotate 3
size 10M
compress
nocreate
}
In turn, log rotation parameters for domains hosted on the Panel server are stored in
configuration files in the $PRODUCT_ROOT_D/etc/logrotate.d/ directory.
You can configure log rotation for a particular domain through the Panel GUI. To do
this:
You can also make Panel send these reports to a certain e-mail address. To do this, go
to Server Administration Panel > Tools & Settings > Summary Report > Delivery Schedule and
choose the schedule from the existing ones or create a new one.
Enhancing Performance
For those Parallels Plesk Panel administrators who want to use Panel more efficiently,
we propose ways to improve Panel functioning in different situations. In this chapter,
we will discuss the following improvements:
Reducing resources consumption for Panels that operate in virtual private server
environment.
Increasing the number of domains that a single Panel server is capable of
managing.
Preventing server overload by limiting the number of anti-spam processes.
In this chapter:
Reducing Resources Consumption in VPS Environments .................................132
Increasing the Number of Domains that Panel Can Manage ..............................137
Making Your Mail Spam Resistant .....................................................................142
Optimizing the Task Manager Performance .......................................................142
Note: You can switch only clean Panel installations to the optimized mode, it is not
possible to do this with Panel installations upgraded from earlier versions. Moreover,
you can enable the optimized mode only on fresh installations of the Panel which have
not yet been initialized.
In this section:
Setting Up VPS Optimized Mode in Parallels Vitruozzo Containers ................... 133
Setting Up VPS-Optimized Mode in Non-Virtuozzo Environments ..................... 135
Apache Modules Switched Off in VPS-Optimized Mode .................................... 135
Enhancing Performance 133
If you need to switch the Panel back to the normal mode of operation,
perform the following steps:
1. Switch on the InnoDB engine.
a. Open for editing the file /etc/my.cnf.
b. Locate the lines containing entries skip-innodb and remove
them, or comment them out.
c. Save the file.
d. Restart MySQL server.
2. Switch on the required Apache modules.
On Debian Linux, use the a2enmod utility to switch on all required modules. For
example, if you want to switch on the PHP module, issue the following
command:
a2enmod php5
On other distributions of Linux, edit the main Apache configuration file, which, in
most Linux installations, is located in /etc/httpd/conf/.
a. Open for editing the file /etc/httpd/conf/httpd.conf.
b. Locate the lines LoadModule <module_name> corresponding
to the modules that you want to switch on, and uncomment the
lines.
134 Enhancing Performance
To improve the Panel resources consumption, update the mysqld configuration file
/etc/my.cnf by adding the skip-bdb line to the [mysqld] section, and restart mysqld.
authz_owner
authz_groupfile
authz_dbm
authz_default
ldap
authnz_ldap
ext_filter
mime_magic
deflate
usertrack
dav_fs
vhost_alias
speling
proxy_balancer
cache
disk_cache
file_cache
mem_cache
version
asis
bw
proxy_ajp
auth_ldap
perl
python
php5
php4
The list of modules can vary depending on the operating system distribution and
architecture. When Panel is installed and the optimized mode is switched on, you can
check the list in the following files:
On 32-bit operating systems - /usr/lib/plesk-
9.0/vps_optimized_aspects/apache-modules-all
On 64-bit operating systems - /usr/lib64/plesk-
9.0/vps_optimized_aspects/apache-modules-all
Enhancing Performance 137
If 900 domains are still not enough, you can recompile Apache with more file
descriptors.
This section provides instructions on how to increase the maximum number of domains
running on a Panel server using these two methods.
In this section:
Running Apache with Piped Logs ...................................................................... 138
Recompiling Apache with More File Descriptors ................................................ 138
138 Enhancing Performance
Note: Parallels Plesk Panel (8.2.0 and later) with piped logs feature enabled (on page
138) can host up to 900 domains without the recompilation of Apache system
packages.
In this section:
Recompiling Apache With More File Descriptors on RedHat-like Systems ........ 139
Recompiling Apache With More File Descriptors on Debian Systems ............... 141
Enhancing Performance 139
Note: If you are running Virtuozzo, you have to adjust the fs.file-max on the
hardware node and it will be applied to all VEs.
If you want the task manager to consume less disk space, you can reduce the size of
its own database. To do this, adjust the following settings that define how much
information the task manager stores in the database:
How long task manager stores information about processed tasks. The parameters
that set these intervals for completed, failed and canceled tasks are
completedTasksClearInterval, failedTasksClearInterval, and
canceledTasksClearInterval correspondingly.
By default, these intervals are equal to 1 year. If you want to change them, specify
the values in the ISO 8601 standard, for example, P1Y for the 1 year interval.
How much information about each task execution is stored. For troubleshooting
purposes, the task manager writes information about task executions to log files,
one file per each execution. The parameter that sets maximum number of stored
log files for each task is the maxTaskLogs. Its default value is 5. To make the logs
consume less disk space, specify a smaller value of this parameter.
Enhancing Performance 143
Note: When you set the task removal intervals described above, remember that setting
too small values may make troubleshooting difficult since you may not have enough
information about recent task executions.
When you run all scheduled tasks at once, task manager starts processing a certain
number of tasks simultaneously. After completing (or failing to complete) the task, the
task manager starts another task from the queue and so on. To make processing of
multiple tasks faster, increase the maximum number of tasks processed
simultaneously. The parameter that sets this number is runAllMaxInstances.
However, when you set a greater value for this parameter, remember that too big
values increase the system load and therefore may reduce the Panel performance or
even block customer access to the Control Panel.
To make the task manager produce more information that may help you in
troubleshooting issues, adjust the logging settings in the following ways:
Increase the number of execution logs for each task. To do this, edit the value of
the maxTaskLogs parameter. When you set a greater value, remember that this
will increase the disk space consumption.
Increase the verbosity of the logs. By default, the task manager writes only error
information to log files. To get more information on tasks execution, include tasks
execution messages into the logs by changing values of the parameters log.info
and log.sql to 1.
Important: Including debug information into the task manager logs will reduce its
performance; Therefore, we recommend that you include this information only when
you troubleshoot certain issues.
CHAPTER 8
In this chapter:
Customizing Panel Appearance and Branding .................................................. 145
Hiding and Changing Panel GUI Elements ........................................................ 146
Customizing Website Topics ............................................................................. 192
Adding Custom Banner Images to Web Presence Builder ................................. 201
Customizing Panel Appearance and GUI Elements 145
In this section:
Ways of Changing Panel Functionality .............................................................. 147
Changing the Panel Functionality ...................................................................... 151
Changing Web Presence Builder Functionality .................................................. 186
Customizing Panel Appearance and GUI Elements 147
In this section:
License Key....................................................................................................... 148
Command Line .................................................................................................. 149
Configuration Files ............................................................................................ 150
148 Customizing Panel Appearance and GUI Elements
License Key
There are extra features that can be turned on or off in the Panel license. These changes are
available to those who have access to the Parallels Key Administrator web-based
management interface or Partner API.
The license modifications can be done on a per-license level, or be a default for you and
applied automatically to all the licenses created for you. In both cases, you should contact
Parallels sales: to apply the partner-wide defaults, or to enable a particular extra
customization on a per-license level.
Important: Once you have turned off a feature through the Partner API, there are no
documented methods to turn it back on. If you need to perform this reverse operation, please
use the web-based user interface, or contact your sales representative.
In this section:
Web-based Key Administrator User Interface .................................................... 149
Partner API........................................................................................................ 149
Customizing Panel Appearance and GUI Elements 149
To turn off required features for a new license, start the New Key wizard( ) and add
the features at step three, the feature management.
To turn off required features for an existing license, start the Key Upgrade wizard ( )
and add the features at step two, the feature management.
To turn on a license feature, detach it from the license.
For details on managing license features, please see the KA Client User Guide, Chapter
Managing Keys. You can access this document by clicking the help link in the KA user
interface.
Partner API
To turn off the extra features in new or existing licenses by means of Partner API, run the
appropriate API method with specific feature API identifiers set.
Add API identifiers of the required features to the "array of identifiers of upgrade plans"
parameter of method partner10.createKey and execute it.
Add API identifiers of the required features to the "upgrade plan name" parameter of
partner10.upgradeKey method and execute it.
For instructions on how to customize Panel elements using Partner API, see the Changing the
Panel Functionality chapter (on page 151).
150 Customizing Panel Appearance and GUI Elements
Command Line
You can change or hide the links to additional services using the panel_gui and the
server_pref utilities. The utilities are located in the /usr/local/psa/bin directory.
The utilities should be run with power user privileges.
The following table describes what customizations may be performed using these utilities:
Configuration Files
To use this method, you need to create a text file named panel.ini in the
$PRODUCT_ROOT/admin/conf/ directory or edit the file /usr/local/sb/config on the
Panel managed server.
After this, you can add or remove the specific lines of text from these files in order to perform
the following Panel functionality customizations:
Links to Builder Help and Getting Started Video Change or remove the link to
(on page 186) the video, change the link to
user's guide.
Customizing Panel Appearance and GUI Elements 151
In this section:
Domain Registration and Management Services ............................................... 151
SSL Certificates Selling Services ...................................................................... 155
Link to Provider's Website ................................................................................. 161
Google Services for Websites Buttons .............................................................. 163
Products from Parallels Partners Button ............................................................ 165
Web Presence Builder Buttons .......................................................................... 167
Panel Upgrades................................................................................................. 169
Mail Service Controls ........................................................................................ 170
Links for Purchasing Panel License and Add-On Keys ...................................... 174
Promos.............................................................................................................. 177
Link to Online Support Service .......................................................................... 181
The Facebook Like Button ................................................................................. 183
Product Rating Widget....................................................................................... 185
In this section:
Location of Domain Registration and Domain Management Buttons ................. 152
Changing Domain Name Registrar's URLs ........................................................ 154
Hiding Domain Registration and Domain Management Buttons ........................ 154
152 Customizing Panel Appearance and GUI Elements
Control Panel: Websites & Domains tab > Register Domain Names and Manage Domain Names
buttons.
154 Customizing Panel Appearance and GUI Elements
To change the URL of the Register Domain Names button, run the following
command:
/usr/local/psa/bin/panel_gui -p -domain_registration_url <url>
To change the URL of the Manage Domain Names button, run the following
command:
/usr/local/psa/bin/panel_gui -p -domain_management_url <url>
You can hide the domain name registration and domain management buttons both through
the command line and the Partner API.
To remove the Register Domain Names button using the command line, run the
following command:
/usr/local/psa/bin/panel_gui -p -domain_registration true
To remove the Manage Domain Names button using the command line, run the
following command:
/usr/local/psa/bin/panel_gui -p -domain_management true
To remove the Register Domain Names button and Manage Domain Names
button using the Partner API:
Use the partner10.createKey or partner10.upgradeKey with the API identifier
"EXTRAS_BUTTONS_OFF" in the "array of identifiers of upgrade plans" parameter.
Note: API identifier "EXTRAS_BUTTONS_OFF" also disables the controls related to SSL
certificate selling services and the link to the provider's website.
Important: Once you have turned off a feature through the Partner API, there are no
documented methods to turn it back on. If you need to perform this reverse operation, please
use the web-based user interface, or contact your sales representative.
Customizing Panel Appearance and GUI Elements 155
In this section:
Locations of Links for Purchasing and Viewing SSL Certificates ....................... 155
Changing SSL Certificate Seller's URLs ............................................................ 160
Hiding Buttons for Viewing and Purchasing SSL Certificates ............................. 161
Server Administration Panel: Tools & Settings > SSL Certificates > View SSL Certificates
button.
Customizing Panel Appearance and GUI Elements 157
Server Administration Panel: Tools & Settings > Buy SSL Certificate button.
158 Customizing Panel Appearance and GUI Elements
Control Panel: Websites & Domains tab > SSL Certificates > Add SSL Certificate > Buy SSL
Certificate button.
Customizing Panel Appearance and GUI Elements 159
Control Panel: Websites & Domains tab > SSL Certificates > View Certificates button.
160 Customizing Panel Appearance and GUI Elements
To change the URLs of the Buy SSL Certificate and View Certificates buttons,
run the following command:
/usr/local/psa/bin/panel_gui -p -cert_purchasing_url <url>
The Format of a POST Request
Note that buttons used to buy or view SSL certificates do not just lead to a URL specified
with the command above. Actually, Panel sends a POST request to this URL. The format of
the POST request body varies depending on a button function. For example, if a button is
used to buy SSL certificates, the request body contains such CSR parameters as a domain
name, business name, country, and so on.
The table below provides the details on the parameters which are sent in POST requests.
To remove the buttons for viewing and purchasing SSL certificates using the
command line, run the following command:
/usr/local/psa/bin/panel_gui -p -cert_purchasing true
To remove the buttons for viewing and purchasing SSL certificates using the
Partner API:
Use the partner10.createKey or partner10.upgradeKey with the API identifier
"EXTRAS_BUTTONS_OFF" in the "array of identifiers of upgrade plans" parameter.
Note: API identifier "EXTRAS_BUTTONS_OFF" also disables the controls related to SSL
certificate selling services and the link to the provider's website.
Important: Once you have turned off a feature through the Partner API, there are no
documented methods to turn it back on. If you need to perform this reverse operation, please
use the web-based user interface, or contact your sales representative.
In this section:
Location of the Link to Provider's Website ......................................................... 162
Changing the URL of the View Services Button ................................................. 162
Hiding the View Services Button........................................................................ 163
162 Customizing Panel Appearance and GUI Elements
To change the URL that opens when the View Services button is clicked, run
the following command:
/usr/local/psa/bin/panel_gui -p -mpc_portal_url <url>
Customizing Panel Appearance and GUI Elements 163
To remove the View Services button using the command line, run the following
command:
/usr/local/psa/bin/panel_gui -p -extras true
Note: API identifier "EXTRAS_BUTTONS_OFF" also disables the controls related to SSL
certificate selling services and link to the provider's website.
Important: Once you have turned off a feature through the Partner API, there are no
documented methods to turn it back on. If you need to perform this reverse operation, please
use the web-based user interface, or contact your sales representative.
In this section:
Location of the Google Services for Websites Controls ..................................... 164
Hiding the Google Services for Websites Buttons.............................................. 165
164 Customizing Panel Appearance and GUI Elements
Control Panel > Websites & Domains tab > Google Services for Websites button. It is shown if
the Services are enabled by Administrator.
Customizing Panel Appearance and GUI Elements 165
Important: Once you have turned off a feature through the Partner API, there are no
documented methods to turn it back on. If you need to perform this reverse operation, please
use the web-based user interface, or contact your sales representative.
In this section:
Location of the Products from Parallels Partners Button .................................... 166
Hiding the Products from Parallels Partners Button ........................................... 167
166 Customizing Panel Appearance and GUI Elements
Important: Once you have turned off a feature through the Partner API, there are no
documented methods to turn it back on. If you need to perform this reverse operation, please
use the web-based user interface, or contact your sales representative.
In this section:
Location of the Web Presence Builder Buttons.................................................. 168
Hiding the Web Presence Builder Buttons ......................................................... 169
168 Customizing Panel Appearance and GUI Elements
Important: Once you have turned off a feature through the Partner API, there are no
documented methods to turn it back on. If you need to perform this reverse operation, please
use the web-based user interface, or contact your sales representative.
Panel Upgrades
When a new minor or major version of the Panel is released, Parallels Updater adds an
information box to the Server Administration Panel home page offering to update the Panel.
This can be disabled, so that only updates for the current version are installed.
In this section:
Disabling Panel Upgrades ................................................................................. 170
170 Customizing Panel Appearance and GUI Elements
Important: Once you have turned off a feature through the Partner API, there are no
documented methods to turn it back on. If you need to perform this reverse operation, please
use the web-based user interface, or contact your sales representative.
In this section:
Location of the Mail Service Controls ................................................................ 171
Hiding the Mail Service Controls........................................................................ 174
Displaying the Mail Service Controls ................................................................. 174
Customizing Panel Appearance and GUI Elements 171
Control Panel: Users tab > user name > Create an e-mail address under your account option.
174 Customizing Panel Appearance and GUI Elements
To hide the mail service controls using the command line, run the following
command:
/usr/local/psa/bin/server_pref -u -disable-mail-ui true
You can display the mail service controls using the Panel user interface or the
server_pref command line utility.
To display the mail service controls using the command line, run the following
command:
/usr/local/psa/bin/server_pref -u -disable-mail-ui false
In this section:
Location of Links for Purchasing Panel License and Add-On Keys .................... 175
Changing the Link URLs.................................................................................... 177
Customizing Panel Appearance and GUI Elements 175
Server Administration Panel > Tools & Settings > License Management > Order Panel Add-Ons
and Order Panel Upgrades buttons.
Customizing Panel Appearance and GUI Elements 177
Promos
Promos are the promotion banners that are shown both in the Server Administration Panel
and Control Panel. There are built-in Parallels promos of Parallels Customer and Business
Manager (they are shown if Business Manager is not installed), Help Desk, and a number of
other featured applications. You can create your own promos and insert them in Panel. All
promos can be hidden.
In this section:
Location of Promos ........................................................................................... 177
Creating a Promo .............................................................................................. 178
Hiding Parallels Promos .................................................................................... 179
Location of Promos
Server Administration Panel: Home.
Server Administration Panel: Tools & Settings.
Server Administration Panel: Tools & Settings > Mail Server Settings.
Control Panel in the Power User view: Home.
178 Customizing Panel Appearance and GUI Elements
Creating a Promo
You can create your own promo by editing the panel.ini configuration file.
To create a promo:
1. Open the configuration file panel.ini from the
/usr/local/psa/admin/conf/ directory on the Panel-managed server.
If the file does not exist, create it.
2. Add the line "[promos]" to the file.
3. Specify the parameters of your promo by adding lines like
"<promo_name>.<parameter>=<value>" after the line "[promos]". You can use
the following parameters:
active. Shows if your promo will appear by default or not. Boolean.
icon. URL of an icon that will be shown in the promo.
title. Title of the promo.
text. The promo description.
buttonUrl. The URL that opens upon clicking the promo button.
buttonText. The caption of the promo button.
hideText. Text of the link for hiding the promo.
For example, you want to create a promo that looks like the following (this is the Panel
default Google Integration Promo):
To hide promos on the Server Administration Panel and Control Panel > Home
pages:
1. Open the configuration file /usr/local/psa/admin/conf/panel.ini on
the Panel-managed server. If the file does not exist, create it.
2. Place the following lines in the file and save it:
[promos]
enabled=off
To hide Parallels promos on the Server Administration Panel > Tools & Settings
and Tools & Settings > Mail Server Settings pages:
1. Open the configuration file /usr/local/psa/admin/conf/panel.ini
on the Panel-managed server. If the file does not exist, create it.
2. Place the following lines in the file and save it:
[aps]
serverAppsPromoEnabled=off
To hide a certain promo on the Server Administration Panel and Control Panel
> Home pages:
1. Open the configuration file /usr/local/psa/admin/conf/panel.ini on
the Panel-managed server. If the file does not exist, create it.
2. Place the following lines in the file and save it:
[promos]
<promo_id>.active=false
180 Customizing Panel Appearance and GUI Elements
By default, the Support button (located in Server Administration Panel > Tools & Settings)
opens the Parallels Plesk Panel Online Server Support form at the Parallels website, with a
number of parameters automatically collected and filled in, such as the Panel administrator's
name, company, e-mail, phone, product key number, operating system details, Panel
version, and build number.
In this section:
Creating Link to Support Form on Your Site ...................................................... 182
Creating Link to Compose E-mail Message ....................................................... 183
182 Customizing Panel Appearance and GUI Elements
The Parallels support form link is defined by the support_url parameter in the psa.misc
table of the Panel's database. If the support_url parameter is absent or empty, upon
clicking the Tools & Settings > Support button, the user is redirected to Parallels support
through the following URL:
'https://register.parallels.com/support/form.php?sv=' .
urlencode(serialize($val))
Before changing the link, consider the following to ensure that the support page of your site
is configured properly:
Your support page will accept the sv variable through the GET method. The value of this
variable is a serialized associative array of pre-collected parameters.
You can get the array of parameters on your web site page in the following way:
$params = unserialize($_GET['sv']);
You can address any parameter of this array in the following way:
$params['firstName']
$params['company']
...
To make the Support button open the support form on your website, follow these steps:
1. Connect to the Panel's database (psa).
2. Run the following query:
If the support_url parameter is absent, run:
insert into misc(param, val) values('support_url',
'https://example.com/support')
Where 'https://example.com/support' is the URL of the support page on your website.
If the support_url parameter already exists, run:
update misc set val = 'https://example.com/support' where param =
'support_url'
Where 'https://example.com/support' is the URL of the support page on your website.
Customizing Panel Appearance and GUI Elements 183
Note: On Windows systems, you can use the dbclient.exe utility to add the information to
the Panel's database. For information about using the dbclient.exe utility, consult Parallels
Plesk Panel for Microsoft Windows: Reference for Command Line Utilities at
http://download1.parallels.com/Plesk/PP11/11.0/Doc/en-US/online/plesk-win-cli/44693.htm.
You can customize the link to Parallels support by specifying your e-mail address in the
support_url parameter of the psa.misc table of the Panel's database.
To make the Support button of the Server Administration Panel open the page for composing
e-mail with your support e-mail address, follow these steps:
1. Connect to the Panel's database (psa).
2. Run the following query:
If the support_url parameter is absent, run:
insert into misc(param, val) values('support_url',
'mailto:yoursupport@example.com')
Where 'yoursupport@example.com' is the e-mail address where you want your
customers' support requests to be sent.
If the support_url parameter already exists, run:
update misc set val = 'mailto:yoursupport@example.com' where param =
'support_url'
Where 'yoursupport@example.com' is the e-mail address where you want your
customers' support requests to be sent.
Note: On Windows systems, you can use the dbclient.exe utility to add the information to
the Panel's database. For information about using the dbclient.exe utility, consult Parallels
Plesk Panel for Microsoft Windows: Reference for Command Line Utilities at
http://download1.parallels.com/Plesk/PP11/11.0.0/Doc/en-US/online/plesk-win-cli/44693.htm.
In this section:
Location of the Like Button ................................................................................ 184
Hiding the Like Button ....................................................................................... 185
184 Customizing Panel Appearance and GUI Elements
You can hide the Facebook Like button only by editing the panel.ini configuration file.
To undo the change and return to the default values, remove these lines from panel.ini.
You can hide the product rating widget so that customers and resellers do not see it.
In this section:
Location of the Widget ....................................................................................... 185
Hiding the Widget .............................................................................................. 186
The widget appears right in front of the Panel GUI, once the administrator logs in to Panel.
186 Customizing Panel Appearance and GUI Elements
You can hide the product rating widget only by editing the panel.ini configuration file.
If you do not want to hide the form but only want to change the period of time after which the
form is shown to the administrator, add the following lines to the file:
[rating]
enabled=true
showAfterDays=60
The showAfterDays parameter sets the number of days after which you want the widget
to be displayed.
To undo the change and return to the default values, remove these lines from panel.ini.
In this section:
Changing the Links to the User's Guide and Getting Started Video................... 187
Prohibiting Users from Removing Their Sites .................................................... 190
Making Modules Unavailable in the Editor ........................................................ 190
Making the Site Import Functionality Unavailable .............................................. 191
Changing the Links to the User's Guide and Getting Started Video
The image below shows the location of the links to the User's Guide and the Getting Started
video in the editor.
188 Customizing Panel Appearance and GUI Elements
Navigation navigation
Breadcrumbs breadcrumbs
Banner header
Site Logo siteLogo
Script script
In this section:
Adding Custom Website Topics......................................................................... 193
Rearranging and Removing Topics and Categories .......................................... 200
CHAPTER 9
In this chapter:
Step 1: Creating a Site in Web Presence Builder ............................................... 194
Step 2: Saving a Site to a Snapshot .................................................................. 194
Step 3: Uploading the Snapshot and Preparing for Editing ................................ 195
Step 4: Editing the Files That Compose the Site Topic ...................................... 196
Step 5: Registering the New Topic with Web Presence Builder ......................... 198
Step 6: Checking the New Topic........................................................................ 199
194 Customizing Panel Appearance and GUI Elements
To create a site:
1. Log in to the Web Presence Builder editor.
2. Select a site topic that you want to use as a basis for your custom topic.
3. In the Prefill Your Website dialog, do not enter any information. If it is
prefilled, delete it.
4. Click Create Site.
5. Edit the design and content of the site as desired:
Add, edit, or remove pages, and change their order.
Add text, images, scripts, and other useful functions provided by modules.
Note: You should insert only the following modules: Text and Images, Contact
Form, Blog, Embedded Video, Comments, and Social Sharing. When
inserting the modules, be sure to add them to the page-specific areas.
All other modules, including those inserted into site-wide areas, will not be
saved in a snapshot, and therefore, will not be available in the site topic.
Other items that cannot be saved in a snapshot are documents uploaded
through the Document Manager and the site ownership verification file.
Change layout and colors of the site elements.
When adding or editing text in the topic, you can use the following placeholders:
%%companyName%%, %%address%%, %%city%%, %%country%%, %%phone%%,
%%email%%.
Upload your own banner images if you want to include them in the site topic. If
you upload several images for a topic, Web Presence Builder will randomly pick
one of them when creating a new site based on the topic.
To upload images, click in the header area, select the option Selection from: own
file, and upload all images that you want to include, one by one. You should use
images in GIF, JPEG, or PNG formats, preferably not exceeding 900-1000
pixels in width.
If you need assistance with the Web Presence Builder editor, open the User’s Guide by
clicking Help > Open User’s Guide.
When your site topic is ready, save it to a snapshot as described in the following
section.
Customizing Panel Appearance and GUI Elements 195
Where:
<source_snapshot_file.ssb> is the path to the source snapshot archive in
SSB format that you uploaded to the server. For example: /home/source-
snapshot.ssb.
<resulting_ZIP_archive.zip> is the location and file name of the
resulting ZIP package. For example: /home/package-file.zip.
<category_code> is an identification code of the topic category. You can
specify a name of a new category if you want to create it, or specify the code of
an existing category. Do not use white spaces in category names. You will be
able to set a human-readable name for this category later, by editing a file in the
topic archive (/resources/locale/en_US/SiteTemplates.lng).
The following is a list of codes for the default categories present in Web
Presence Builder 11.
On Windows systems:
“C:\Program Files (x86)\Parallels\Plesk\admin\bin\php.exe"
-c "C:\Program Files (x86)\Parallels\Plesk\admin\php.ini" -
dauto_prepend_file="" "C:\Program Files
(x86)\Parallels\Plesk\sb\utils\snapshot2wst.php" --register
--file=<path_to_ZIP_archive_with_topic>
To verify that your new topic was successfully added to Web Presence
Builder:
1. Log in to the Web Presence Builder editor.
2. On the topic selection screen, select your topic and click Create Site.
3. Review the site content to ensure that everything looks as expected.
CHAPTER 10
Suppose, you have an image file with the name jungle.jpg, and you want to add it
to the editor. Do the following:
1. Resize the image to 960 pixels in width and 250 pixels in height.
Convert the image to the PNG format, and save it as header.png.
2. Create a copy of header.png, resize it to 200 pixels in width, and 57
pixels in height. Save it as preview.png.
3. Connect over SSH to the server.
4. Change to the directory /usr/local/sb/htdocs/headers/, and
create a subdirectory with the banner name. For example,
/usr/local/sb/htdocs/headers/jungle_01.
5. Upload the header.png and preview.png files that you prepared to
the directory /usr/local/sb/htdocs/headers/jungle_01/.
6. Locate the directory /usr/local/sb/resources/. It should contain
the file customHeaders.xml.
If the file is missing, create it and insert the following lines into it:
<?xml version="1.0" encoding="utf-8"?>
202 Customizing Panel Appearance and GUI Elements
<headers>
<header id="jungle_01">
</header>
</headers>
If the file is present, add the following <header> node to it:
<header id="jungle_01">
7. </header>To ensure that the newly added image can be found by
keywords in the banner selection menu, do the following:
a. Open for editing the file
/usr/local/sb/resources/locale/<locale_code>/hea
ders.lng.
b. Add a string in the following format:
<header_id> = "<keyword_1>,<keyword_2>,<keyword_3>"
Where:
<header_id> is the image ID that you have specified in step 6, but with
certain transformations: all uppercase letters must be changed to the lower
case, hyphens and underscore symbols must be removed, the next symbol
following a hyphen or an underscore must be changed to the upper case.
For example, Jungle_01_eXample must be changed to
jungle01Example.
<keyword> is a human-readable word that describes the image or identifies
items on the picture.
You can use several keywords separated with commas. No white spaces can
be used.
Example:
jungle01 = "jungle,tropics,green,nature"
c. Save the file.
8. Issue the following command:
/usr/local/psa/bin/sw-engine-pleskrun
/usr/local/sb/utils/updateResources.php header
Now you can go to the editor and open the list of banner images. The newly added
image should be at the end of the list.
CHAPTER 11
Enhancing Security
When you share a single physical server between many users, you consider all
security aspects thoroughly. Although Panel provides an acceptable security level,
there are suggested ways to improve it. This chapter provides instructions on
protecting Panel server and hosted domains from unauthorized access.
In this chapter:
Restricting Script Execution in the /tmp Directory .............................................. 204
Configuring Site Isolation Settings ..................................................................... 205
Protecting from Running Tasks on Behalf of root .............................................. 206
204 Enhancing Security
The configuration file specifies the list of allowed values for hosting options:
[hosting]
php = on
php_handler_type = fastcgi
;python = off
;perl = off
;fastcgi = any
;miva = off
;ssi = any
;ssl = on
;shell = /usr/local/psa/bin/chrootsh
;asp = any
;php_safe_mode = on
;coldfusion = off
In this file, you can uncomment a line by removing the semi-colon (;) and comment out
a line by adding the semi-colon (;) in the beginning of the line.
Localization
Parallels Plesk Panel 11.0 is shipped with the following interface languages:
American English
Dutch
French
German
Italian
Japanese
Polish
Portuguese
Russian
Spanish
Simplified Chinese
Traditional Chinese
It is possible to translate Parallels Plesk Panel interface (including Web Presence
Builder) into other languages and apply the translation to a Panel installation.
For detailed instructions on translating Panel into your language, refer to the Localization
Guide.
CHAPTER 13
The administrator and resellers associate these additional services with hosting plans
when setting up a distribution strategy. For example, if you have a service that
performs custom mail filtering, Panel lets you offer this service with, say, the Silver
hosting plan and do not offer with others.
To make Panel aware of an additional service, you should add the service to Panel. In
the simplest case, when the service resides on a remote URL and does not require any
notifications from Panel, add it from the Panel GUI, page Service Plans > Additional
Services. From there, you can also associate the service with a custom button that is
instantly added to the Websites & Domains page of each subscriber.
Another way to add a service is to make a programming call to Panel. The benefit of
this approach is that it lets your service to receive Panel notifications about the object
changes. For example, the mail filtering service we mentioned earlier must track
account name changes to serve renamed accounts as well. Though you can make a
call that adds a service and does not subscribe it to notifications, this operation does
not make much sense as it is easier to add such services through the GUI. Thus, we
consider that you will generally use programming means to both add services and
register them with Panel Notifications (PN).
The possible inconvenience of adding services by a call is that you are unable to edit
details of the services through the Panel GUI. Please consider it when designing
service names and descriptions. Another peculiar feature of adding services by a call is
that are not automatically visible to customers. We recommend that you use custom
buttons or write an extension to display the service in the Control Panel.
PN sends notifications about subscriptions, sites, and e-mail accounts related to the
service. The relation subscription - service is derived from plans: A service is
associated with plans, whereas subscriptions are plan instances. If a subscription has
sites or e-mail accounts, the changes of these supplementary objects are also tracked.
Registering Additional Services with Panel Notifications 209
If you wish to register your service with the PN, do the following:
1. Create a service-specific class that implements interface Plan_Item_Interface.
By implementing this interface, you specify the service properties in Panel and
define what type of changes it should receive and how it should handle them. When
a change happens, Panel executes the change handling code from this class. This
code runs in the Administrator context.
2. Register this class by an appropriate call.
For details on interface Plan_Item_Interface and instructions on how to implement it,
see section Preparing a Service for Registration (on page 210).
To learn how to register a prepared class, see section Registering the Service (on page
211).
Note: This section does not explain how to write third-party services, integrate them
into the Panel GUI, or get access to the Panel resources. If you wish to make a
registered service available to customers, create a custom button pointing to the
service URL and place it on pages available to customers. This can be done through
the command line interface (CLI) and will work only if your service receives enough
information from PN. If your service requires access to other Panel resources or you
want to build your service into the Panel GUI, consider writing an extension.
In this chapter:
Preparing a Service for Registration .................................................................. 210
Registering the Service ..................................................................................... 211
Code Samples................................................................................................... 212
CHAPTER 14
When designing names of the class that implements the interface and the file that
includes this class, follow Zend naming conventions. For example, if you create a
directory /PRODUCT_ROOT_D/admin/plib/servicedir and put there file
servicefile.php, then the class name must be servicedir_servicefile. To learn
more about the naming conventions, see http://framework.zend.com/manual/en/coding-
standard.naming-conventions.html.
We offer a sample class you can use as a base when writing own classes to help you
with the implementation. The code is supplemented by comments that explain the
interface organization. To view the code, refer to the Implementation of Plan_Item_Interface
section (on page 213).
CHAPTER 15
Note: We suppose that the Panel is installed to the default installation directory. If you
use a custom directory, please update the paths correspondingly.
If it is impossible for you to run the PHP code, you can register the service directly by
running this MySQL statement customized to your class.
INSERT INTO PlanItems (
classname,
name,
applicableToEmail,
uuid
)
VALUES (
'servicedir_servicefile',
'urn:isv:custom-item-connector:1',
1,
'219b7656-8e92-869d-828a-6814cda71a1s');
The definition of the parameters that present in the statement is as follows:
classname, string
The name of the class that contains the interface implementation.
name, string
The unique name of the service.
uuid, string
The service identifier.
CHAPTER 16
Code Samples
Registering Additional Services with Panel Notifications 213
Implementation of Plan_Item_Interface
<?php
/**
* Sample implementation of a Service Plan Item declaration.
*
*/
/**
*
* Plan_Item_Interface declares the following methods:
*
* public function getName();
* public function getHint($locale);
* public function getDescription($locale);
* public function update(
* $subject,
* $change,
* $subscriptionUuid,
* $planItemUuid
* );
*
* Additional descriptions are available as annotations to method
* implementations below.
*
*/
class servicedir_servicefile implements Plan_Item_Interface
{
private $_logFile = '/tmp/custom-item-connector.log';
private $_locales = array(
'en-US' => array(
'description' => 'External Mail Filtering Service',
'hint' => 'Filter all incoming mail throug cloud mail filter',
),
'de-DE' => array(
'description' => 'This is a description in German',
'hint' => 'And hint is also in German',
),
);
/**
* Returns a unique name of an additional service.
* The Panel uses this name to distinguish services from each other.
*
*
* @return string
*/
public function getName()
{
return 'urn:isv:custom-item-connector:1';
}
/**
* Returns a localized name of the service, that will be
* displayed in the Panel (in Service Plans > Additional Services).
*
*
214 Registering Additional Services with Panel Notifications
/**
* Returns a localized name of the service, that will be
* displayed in the Panel (in Service Plans > Additional Services).
*
*
* @param string $locale Currently used locale in format 'xx-XX'
* @return string
*/
public function getDescription($locale)
{
return $this->_('description', $locale);
}
/**
* Receives update notifications about related Panel objects. The
objects are
* specified with object implementing Plan_Item_Subject interface that
* declares the following methods:
*
* public function getType() - Returns type of a changed object
* as specified by Plan_Item_Subject constants
*
* Available types: Plan_Item_Subject::EMAIL,
Plan_Item_Subject::SITE,
* Plan_Item_Subject::SUBSCRIPTION
*
*
* public function getProperties() - Returns the current values of
* subject properties. The properties are returned as key => value
pairs.
* For deleted objects, properties values remain as they were
* before deletion. For created objects, properties values are
those
* that were assigned to these objects upon creation.
*
*
* Available properties.
*
* For subscriptions:
* GUID: string
* status: boolean
*
* For sites:
* status: boolean
* name: string
* GUID: string
*
* For e-mail accounts:
* email: string (account name)
*
Registering Additional Services with Panel Notifications 215
switch ($change) {
case Plan_Item_Notification::CREATED:
$this->_log("$subjectType created: " .
print_r($subject->getProperties(), true)
);
break;
case Plan_Item_Notification::UPDATED:
$this->_log("$subjectType updated: " .
print_r($subject->getProperties(), true)
);
break;
case Plan_Item_Notification::DELETED:
$this->_log("$subjectType deleted: " .
print_r($subject->getProperties(), true)
);
break;
}
}
/**
* Declares from what type of Panel objects the service will receive
notifications.
* It returns either an array or a single type.
*
* Plan_Item_Subject::SUBSCRIPTION
* The service will recieve notifications about all changes made
to
* subscription (including activation/suspension of subscriptions,
* assigning/de-assigning the service to a subscription)
*
* Plan_Item_Subject::EMAIL
* The service will recieve notifications about all changes made
to
* e-mail accounts on affected subscriptions.
*
216 Registering Additional Services with Panel Notifications
* Plan_Item_Subject::SITE
* The service will recieve notifications about all changes made
to
* site names in the scope affected subscriptions.
*
*/
public static function getSubjectTypes()
{
return array(Plan_Item_Subject::EMAIL);
}
return $this->_locales[$locale][$key];
}
/**
* Sample code to register an additional service in
* the Panel 10.1 and above.
*
*/
/**
* Use the following instructions to initialize the Panel PHP
* environment when running command-line PHP script with sw-engine-pleskrun
* utility. On Linux OSes, it resides in /usr/local/psa/bin/.
*
* For Windows servers, use the following command to run the registration
script.
* "%plesk_bin%\php.exe" -d auto_prepend_file="" "<ABSOLUTE-PATH-TO-
SCRIPT>"
*
* Comment the following two lines if you run the PHP script through the
Panel
* web interface.
*/
require_once('api-common/cu.php');
cu::initCLI();
/**
* The following code registers the service that was
* implemented with the servicedir_servicefile class. This class must
* be available for autoloading from the Panel.
*/
Db_Table_Broker::get('PlanItems')->register(
new servicedir_servicefile(),
servicedir_servicefile::getSubjectTypes()
);
CHAPTER 17
Troubleshooting
This section provides procedures for solving the most typical problems in Parallels
Plesk Panel for Linux. Most importantly, it contains information on what to do if you:
cannot access the Panel log in page
cannot log in to Panel
forget the administrator's password
encounter problems when operating Panel in a Virtuozzo Container
If your problem is not discussed in this chapter or if the proposed solution does not
work, visit the Parallels Knowledge Base at http://kb.parallels.com/ or contact our
technical support department.
In this chapter:
Cannot Access Panel ........................................................................................ 219
Cannot Log In to Panel ...................................................................................... 219
The Administrator's Password Has Been Forgotten .......................................... 220
Panel in a Virtuozzo Container: Broken Layout ................................................. 221
EZ Templates Update Issues in Parallels Virtuozzo Containers ........................ 222
Postfix Consumes Too Many Resources in a Container .................................... 222
Troubleshooting 219
This may happen if there is not enough free disk space on the Panel server.
Since Panel 10, the integration between panels can lead to unexpected results. For
example, some icons in Panel might not be displayed or the layout might be broken
when the offline management is on. To resolve these problems, we recommend that
you do not use the integration, and that you access the panels on different ports (4643
and 8443).
On Windows servers, connect to the hardware node over Remote Desktop and run
the following commands:
The discovery algorithm is straightforward: If the system finds all packages included in
an EZ template, it considers that such a template is installed. The major drawback of
this approach is that Panel 9.x and SMB are very close to each other in terms of
packages, so the auto-detection engine makes incorrect decisions. Namely, if only one
of the applications is present in a container, the system considers that both templates
are installed. The most noticeable outcome of this detection problem is that the system
fails to update both applications or set proper billing for them.
It is possible to stop the auto detection if you use the billing automation software or if
you want to install Parallels Small Business Panel. To do this, modify the
/etc/vztt/vztt.conf file by setting APP_TEMPLATE_AUTODETECTION=no.
The following placeholders are used in the configuration file names in the diagram:
<version> designates the version of a configuration file.
<domain-name> designates the domain name of the website for which the
configuration is generated.
CHAPTER 19
Root templates are starting points in generating configuration files. Panel always starts
generating a configuration from one of these files. All root templates contain statements
that include the other templates located in respective folders (domain, server and
service).
$VAR is an associative array that contains the data model. Below is a detailed list
explaining available paths and values.
$VAR->
$VAR->domainsIpDefaultBootstrap
The full path to the bootstrap file for a domain set as default on an IP address;
string
$VAR->domainsBootstrap
The full path to the bootstrap file for domains; string
$VAR->domainsWebmailHordeBootstrap
The full path to the bootstrap file for Horde; string
$VAR->domainsWebmailAtmailBootstrap
The full path to the bootstrap file for Atmail; string
$VAR->domainsWebmailAtmailcomBootstrap
The full path to the bootstrap file for Atmail Commerce; string
In this chapter:
1. $VAR->server-> .............................................................................................229
2. $VAR->domain-> ...........................................................................................232
3. $VAR->subDomain-> .....................................................................................237
4. $VAR->ipAddress-> .......................................................................................238
Appendix C: Apache Configuration Variables 229
1. $VAR->server->
$VAR->server->fullHostName
Full name of the host where the Panel is installed; string
$VAR->server->ipAddress->all
List of IP addresses registered with the Panel; array with elements $VAR-
>ipAddress
$VAR->server->admin->email
E-mail address of the Panel administrator; string
$VAR->server->productRootDir
The full path to the root directory of the Panel installation; string
$VAR->server->productConfigDir
The full path to the directory where the Panel configuration is stored; string
$VAR->server->getSslLibraryPath
The full path to the system SSL library; string
$VAR->server->getCryptoLibraryPath
The full path to the system cryptographic library; string
1.2. $VAR->server->domains->
$VAR->server->domains->allWithHosting
List of domains where hosting (both web hosting and forwarding) is set up; array
with elements $VAR->domain
$VAR->server->domains->allWithoutHosting
List of domain accounts where no hosting is set up (neither web hosting nor
forwarding); array with elements $VAR->domain
1.3. $VAR->server->webserver->
$VAR->server->webserver->vhostDir
The full path to the system vhosts/ directory; string
$VAR->server->webserver->httpLogsDir
The full path to the logs/ directory; string
$VAR->server->webserver->httpIncludeDir
The full path to the Apache conf.d directory; string
$VAR->server->webserver->httpDir
The full path to the directory with content of the server default website available via
HTTP; string
$VAR->server->webserver->httpsDir
The full path to the directory with content of the server default website available via
HTTPS; string
$VAR->server->webserver->httpPort
Apache HTTP port number; string
230 Appendix C: Apache Configuration Variables
$VAR->server->webserver->httpsPort
Apache HTTPS port number; string
$VAR->server->webserver->cgiBinDir
The full path to the cgi-bin directory of the server default site; string
$VAR->server->webserver->clientGroup
System group of users using Apache web hosting (a user group in which all FTP
users of web hosting are included); string
1.3.1. $VAR->server->webserver->apache->
$VAR->server->webserver->apache->pipelogEnabled
Defines if writing Apache logs to a pipe is enabled; boolean
$VAR->server->webserver->apache->traceEnableCompliance
Determines the behaviour on TRACE requests; boolean
$VAR->server->webserver->apache->allowOverrideDefault
Defines the value of the AllowOverride directive in Apache configuration; string
$VAR->server->webserver->apache->php4ModuleName
Name of the Apache module used for PHP 4; string
$VAR->server->webserver->apache->phpCgiBin
Binary file used to run PHP in CGI mode; string
$VAR->server->webserver->apache->coldfusionModuleName
Name of Apache module used for ColdFusion; string
$VAR->server->webserver->apache->vhostIpCapacity
Maximum number of IP addresses that can be defined in the <VirtualHost> tag in
Apache configuration; integer
1.3.2. $VAR->server->webserver->horde->
$VAR->server->webserver->horde->confD
The full path to the directory with Horde configuration; string
$VAR->server->webserver->horde->logD
The full path to the directory with Horde logs; string
$VAR->server->webserver->horde->docD
The full path to the Horde doc directory; string
$VAR->server->webserver->horde->dataD
The full path to the folder with Horde PEAR data; string
1.4. $VAR->server->tomcat->
$VAR->server->tomcat->workersFile
The full path to the Tomcat workers file; string
$VAR->server->tomcat->workerName
Tomcat worker ID; string
$VAR->server->tomcat->warpPort
Tomcat WARP port; string
Appendix C: Apache Configuration Variables 231
1.5. $VAR->server->mailman->
$VAR->server->mailman->rootDir
The full path to the Mailman root directory; string
$VAR->server->mailman->varDir
The full path to the Mailman var directory; string
$VAR->server->mailman->scriptAliases
ScriptAliases required for the web panel of the Mailman service to work; array with
elements 'url => path'
$VAR->server->mailman->aliases
Aliases required for the web panel of the Mailman service to work; array with
elements 'url => path'
1.6. $VAR->server->coldfusion->
$VAR->server->coldfusion->port
ColdFusion port number; string
$VAR->server->coldfusion->serverStorePath
The full path to the file that contains information for the associated JRun server
(default file name is jrunserver.store); string
1.7. $VAR->server->miva->
$VAR->server->miva->libDir
The full path to the Miva lib directory; string
$VAR->server->miva->binDir
The full path to the Miva bin directory; string
$VAR->server->miva->shareDir
The full path to the Miva shared directory; string
1.8. $VAR->server->awstats->
$VAR->server->awstats->docsDir
The full path to the AWStats docs directory; string
232 Appendix C: Apache Configuration Variables
2. $VAR->domain->
The content of $VAR->domain is defined by the value of the domainId key in
$metainfo.
$VAR->domain->id
Domain ID; string
$VAR->domain->www
Defines if the website is accessible with the www prefix; boolean
$VAR->domain->enabled
Defines the website status; boolean
$VAR->domain->idnName
International domain name; string
$VAR->domain->asciiName
Domain name in ASCII format; string
$VAR->domain->isIpDefault
Defines if the website is set as default for the IP address; boolean
$VAR->domain->hasPhysicalHosting
Defines if the website is set up for web hosting; boolean
$VAR->domain->hasStandardForwarding
Defines if the website is set up as standard forwarding; boolean
$VAR->domain->hasFrameForwarding
Defines if the website is set up as frame forwarding; boolean
$VAR->domain->webAliases
Web aliases of the website; array where elements are objects $object-
>asciiName
$VAR->domain->mailAliases
Mail aliases of the website; array where elements are objects $object-
>asciiName
$VAR->domain->client->email
E-mail address of the website owner; string
$VAR->domain->email
E-mail address of the Domain Administrator of the website; string
2.1. $VAR->domain->physicalHosting->
$VAR->domain->physicalHosting->login
Username of FTP account used to access the website content; string
$VAR->domain->physicalHosting->ipAddress
IP address on which the website is hosted; see $VAR->ipAddress
Appendix C: Apache Configuration Variables 233
$VAR->domain->physicalHosting->vhostDir
The absolute path to the website's vhost directory; string
$VAR->domain->physicalHosting->logsDir
The absolute path to the website's logs directory; string
$VAR->domain->physicalHosting->webUsersDir
The absolute path to the website's directory designated for web users' content;
string
$VAR->domain->physicalHosting->httpDir
The absolute path to the website's httpdocs directory; string
$VAR->domain->physicalHosting->httpsDir
The absolute path to the website's httpsdocs directory; string
$VAR->domain->physicalHosting->cgiBinDir
The absolute path to the website's cgi-bin directory; string
$VAR->domain->physicalHosting->statisticsDir
The absolute path to the website's statistics directory;string
$VAR->domain->physicalHosting->siteAppsConfigDir
The absolute path to the website's directory where configuration files of the installed
non-SSL site applications are stored; string
$VAR->domain->physicalHosting->customConfigFile
The absolute path to the directory <vhostdir>/conf/vhost.conf for a non-
SSL website; string
$VAR->domain->physicalHosting->siteAppsSslConfigDir
The absolute path to the website's directory where configuration files of the installed
SSL site applications are stored; string
$VAR->domain->physicalHosting->customSslConfigFile
The absolute path to the directory <vhostdir>/conf/vhost.conf for a non-
SSL website; string
$VAR->domain->physicalHosting->ssl
Defines if the SSL support is enabled on the website; boolean
$VAR->domain->physicalHosting->trafficBandwidth
Defines a limit imposed on the traffic bandwidth usage by the domain; string
$VAR->domain->physicalHosting->maximumConnection
Defines a limit imposed on the maximum allowed number of connections to the
domain; string
$VAR->domain->physicalHosting->php
Defines if the PHP support is enabled on the website; boolean
$VAR->domain->physicalHosting->phpHandlerType
Defines PHP handler type; string
$VAR->domain->physicalHosting->phpSafeMode
Defines if PHP operates in safe mode; boolean
234 Appendix C: Apache Configuration Variables
$VAR->domain->physicalHosting->ssi
Defines if SSI is supported on the website; boolean
$VAR->domain->physicalHosting->cgi
Defines if CGI is supported on the website; boolean
$VAR->domain->physicalHosting->miva
Defines if Miva support is enabled for the website; boolean
$VAR->domain->physicalHosting->mivaDataDir
The full path to the Miva data directory; string
$VAR->domain->physicalHosting->perl
Defines if Perl is supported on the website; boolean
$VAR->domain->physicalHosting->asp
Defines if ASP is supported on the website; boolean
$VAR->domain->physicalHosting->python
Defines if python is supported on the website; boolean
$VAR->domain->physicalHosting->fastcgi
Defines if FastCGI is supported on the website; boolean
$VAR->domain->physicalHosting->errordocs
Defines if custom error pages are supported on the website; boolean
$VAR->domain->physicalHosting->hasWebstat
Defines if a web statistics service is supported on the website; boolean
$VAR->domain->physicalHosting->webuserScriptingEnabled
Defines if using scripts is allowed to web users on the website; boolean
$VAR->domain->physicalHosting->frontpage
Defines if Microsoft FrontPage is supported on the website; boolean
$VAR->domain->physicalHosting->frontpageSsl
Defines if Microsoft FrontPage over SSL is supported on the website; boolean
$VAR->domain->physicalHosting->coldfusion
Defines if ColdFusion is supported on the website; boolean
$VAR->domain->physicalHosting->subdomains
List of the website subdomains; array with elements $VAR->subdomain
$VAR->domain->physicalHosting->phpSettings
List of PHP settings for the website (including additional directives); string
$VAR->domain->physicalHosting->webusers
Accesses web user specific data; array where elements are objects of type
$object-><webuser-parameter> where <webuser-parameter> is one of the
following:
dir
The absolute path to the directory with the web user's content; string
ssi
Defines if SSI support is enabled for the web user; boolean
Appendix C: Apache Configuration Variables 235
cgi
Defines if CGI support is enabled for the web user; boolean
perl
Defines if perl support is enabled for the web user; boolean
asp
Defines if ASP support is enabled for the web user; boolean
php
Defines if PHP support is enabled for the web user; boolean
phpSettings
List of PHP settings for the web user. All setting values are the same as for the
website except open_basedir (it contains the path to the web user's home
directory); string
python
Defines if python support is enabled for the web user; boolean
fastcgi
Defines if fastCGI support is enabled for the web user; boolean
2.2. $VAR->domain->forwarding->
$VAR->domain->forwarding->ipAddress
IP address on which the website forwarding is set up; $VAR->ipAddress
$VAR->domain->forwarding->redirectUrl
URL to which requests for the website are redirected; string
2.3. $VAR->domain->tomcat->
$VAR->domain->tomcat->enabled
Defines if Tomcat is enabled on the website; boolean
$VAR->domain->tomcat->all
Gets data on all Tomcat applications running on the domain; array where elements
are objects $object->name where 'name' is an application name
2.4. $VAR->domain->protectedDirectories->
$VAR->domain->protectedDirectories->sslDirectories
Password-protected directories of the website available via SSL; array with
elements array('directory' => '', 'realm' => '', 'authFile' =>
'',) where
directory is a path (relative to the virtual host root) to a directory being
protected
realm is a text displayed when requesting password from a user
authFile is the absolute path to a file listing users who are authorized to
access the directory
236 Appendix C: Apache Configuration Variables
$VAR->domain->protectedDirectories->nonSslDirectories
Password-protected non-SSL directories of the website; array with elements
array('directory' => '', 'realm' => '', 'authFile' => '',)
where
directory is a path (relative to the virtual host root) to a directory being
protected
realm is a text displayed when requesting password from a user
authFile is the absolute path to a file listing users who are authorized to
access the directory
Appendix C: Apache Configuration Variables 237
3. $VAR->subDomain->
The content of $VAR->subDomain is defined by the value of the domainId and
subDomainId keys in $metainfo.
$VAR->subDomain->id
Subdomain ID; string
$VAR->subDomain->asciiName
Subdomain name in ASCII format (without the domain name part, i.e. "forum" if the
full domain name is "forum.example.com"); string
$VAR-subDomain->asciiFullName
Full subdomain name (including the domain name part) in ASCII format; string
$VAR->subDomain->httpDir
The absolute path to the website's httpdocs directory; string
$VAR->subDomain->httpsDir
The absolute path to the website's httpsdocs directory; string
$VAR->subDomain->siteAppsConfigDir
The absolute path to the website's directory where configuration files of the installed
non-SSL site applications are stored; string
$VAR->subDomain->siteAppsSslConfigDir
The absolute path to the website's directory where configuration files of the installed
SSL site applications are stored; string
$VAR->subDomain->customConfigFile
The absolute path to the directory conf/vhost.conf for a non-SSL website;
string
$VAR->subDomain->customSslConfigFile
The absolute path to the directory conf/vhost.conf for an SSL website; string
$VAR->subDomain->login
Username of FTP account used to access the website content; string
$VAR->subDomain->cgi
Defines if the CGI support is enabled on the website; boolean
$VAR->subDomain->cgiBinDir
The full path to the cgi-bin directory of the website; string
$VAR->subDomain->miva
Defines if the Miva support is enabled on the website; boolean
$VAR->subDomain->mivaDataDir
The full path to the Miva data directory; string
$VAR->subDomain->perl
Defines if the perl support is enabled on the website; boolean
238 Appendix C: Apache Configuration Variables
$VAR->subDomain->asp
Defines if the ASP support is enabled on the website; boolean
$VAR->subDomain->coldfusion
Defines if the ColdFusion support is enabled on the website; boolean
$VAR->subDomain->php
Defines if the PHP support is enabled on the website; boolean
$VAR->subDomain->phpHandlerType
Defines PHP handler type; string
$VAR->subDomain->python
Defines if the python support is enabled on the website; boolean
$VAR->subDomain->fastcgi
Defines if the FastCGI support is enabled on the website; boolean
$VAR->subDomain->ssi
Defines if the SSI support is enabled on the website; boolean
$VAR->subDomain->ssl
Defines if the SSL support is enabled on the website; boolean
4. $VAR->ipAddress->
The content of $VAR->ipAddress is defined by the value of the ipAddressId key in
$metainfo.
$VAR->ipAddress->id
ID of the IP address; string
$VAR->ipAddress->address
IP address; string
$VAR->ipAddress->sslCertificate->ce
SSL certificate file content; string
$VAR->ipAddress->sslCertificate->ca
CA certificate file content; string
$VAR->ipAddress->sslCertificate->ceFilePath
The full path to the certificate file; string
$VAR->ipAddress->sslCertificate->caFilePath
The full path to the CA certificate file; string
$VAR->ipAddress->defaultDomainId
ID of the domain set as default for the IP address; string
$VAR->ipAddress->hostedDomains
List of domains hosted on the IP address; array with elements $VAR->domain