Items you must select,
such as menu options,
command buttons, or
items in a list.
Go to the System tab.
Titles of chapters,
sections, and subsections.
Read the Basic Administration
chapter.
Italics
Used to emphasize the
importance of a point, to
introduce a term or to
designate a command line
placeholder, which is to be
replaced with a real name
or value.
The system supports the so
called wildcard character search.
Monospace
The names of commands,
files, and directories.
The license file is located in the
http://docs/common/licen
ses directory.
Preface
Typographical Conventions
Before you start using this guide, it is important to understand the documentation
conventions used in it.
The following kinds of formatting in the text identify special information.
6 Preface
Formatting convention
Type of Information
Example
Preformatted
On-screen computer
output in your commandline sessions; source code
in XML, C++, or other
programming languages.
# ls –al /files
total 14470
Preformatted Bold
What you type, contrasted
with on-screen computer
output.
# cd /root/rpms/php
CAPITALS
Names of keys on the
keyboard.
SHIFT, CTRL, ALT
KEY+KEY
Key combinations for
which the user must press
and hold down one key
and then press another.
CTRL+P, ALT+F4
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.
About This Guide 7
Parallels Plesk Panel for Linux Advanced Administration Guide is a companion guide for the
About This Guide
Parallels Panel Administrator's Guide. It is intended for server administrators whose
responsibilities include maintaining hosting servers and troubleshooting server software
problems.
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.
This guide contains the following chapters:
Introduction to Panel. Describes the main components and services operated by Panel,
licensing terms, and the ways to install and update Panel components.
Virtual Hosts Configuration. Describes virtual host concepts and their implementation in
Panel. Provides instructions on why and how to change their configuration.
Services Management. Contains descriptions of a number of external services used on
Panel server and instructions on how to configure and use them.
System Maintenance. Describes how to change the server host name, IP addresses, and
locations of directories for storing virtual host files, backups, and mail content. This
chapter also introduces Panel's command-line tools, a mechanism for running scripts on
Panel events, and the service monitor that allows monitoring and restarting of services
without logging in to Panel.
Backing Up, Restoring, and Migrating Data. Describes how to back up and restore Panel data
by means of the command-line utilities pleskbackup and pleskrestore, and
introduces the tools for migrating hosted data between servers.
Statistics and Logs. Describes how to run on demand statistics calculations on disk space
and traffic usage, and access web server logs.
Enhancing Performance. Provides information on how to improve Panel functioning by
means of software.
Enhancing Security. Provides instructions on how to protect the Panel server and sites
hosted on it from unauthorized access.
Customizing Panel Appearance and GUI Elements. Introduces Panel themes that can be used
to customize Panel appearance and branding and describes how to remove specific
elements of the Panel GUI or change their behavior.
Localization. Introduces the methods of localizing the Panel GUI into languages for which
Parallels does not provide localization.
Troubleshooting. Describes how to troubleshoot malfunctions of Panel services.
Parallels Plesk Panel files can be divided into six major groups responsible for different
C H A P T E R 1
Introduction to Panel
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.
Introduction to Panel 9
Panel components are as follows:
Panel core. The core processes requests that Panel receivess from the Panel GUI,
command line interface, and API RPC. The core contains scripts, binary files and
other resources used to link Panel components with each other and with external
services.
Panel database psa. The database stores information about Panel objects, such as
IP addresses, domains, user accounts, and so on.
sw-cp-server - a web server based on lighttpd. This serves requests to the Panel
GUI.
Panel GUI - a web interface provided with sw-cp-server. The GUI is the main means
of interaction with Panel.
Command line utilities. The command line interface allows integration of third-party
software with Panel objects. In addition, it is a way for administrators to manage
Panel through the server shell. For more information on the Panel command line
interface, refer to Panel Command Line Reference.
API RPC. This interface is another way to integrate third-party software with Panel.
It allows Panel objects to be managed remotely by sending specifically structured
XML packets and receiving responses from Panel. For more information on API
RPC, refer to API RPC Developer's Guide and API RPC Protocol Reference.
The Most Important Files and Directories
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/.
10 Introduction to Panel
Panel database:
In this chapter:
Installation and Upgrade Overview ....................................................................11
Ports Used by Panel ..........................................................................................12
The most common way of installing and upgrading Parallels Plesk Panel is to use the
Parallels Installer utility. This utility connects to the Parallels Updates server where the
Panel distribution packages are stored. It then retrieves, downloads, and installs Panel.
You can download the Parallels Installer utility from
For detailed instructions on how to use Parallels Installer, refer to Parallels Plesk Panel
10.4 Installation and Upgrade 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 Parallels Plesk Panel 10.4 Installation and Upgrade Guide.
Installing Panel in the Parallels Virtuozzo Containers Environment
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.
You can obtain the Panel templates at
http://www.parallels.com/eu/download/plesk/products/ or download them using the
PVC command line utility call vzup2date -z (available on PVC 4 and above).
For more information on installing Panel on PVC, read the Parallels Plesk Panel Deployment Guide, chapter Deployment Inside Parallels Virtuozzo Containers.
Checking Potential Issues Before Upgrading to Panel 10
If you use Parallels Plesk Panel 9 or earlier and want to upgrade it to Panel 10, you
may encounter problems due to changes in the business model of Panel 10. In
particular, it might be impossible to transfer some settings and business objects.
To efficiently anticipate or resolve the problems, we offer a tool called
plesk101_preupgrade_checker.php. This checks potential business logic issues
with upgrading to Panel 10 and gives recommendations that help you fix the possible
problems related to transition of Panel objects.You can download the tool and find
descriptions of the report messages at http://kb.parallels.com/9436.
12 Introduction to Panel
Ports Used by Panel
Service name
Ports used by service
Administrative interface of the Panel
TCP 8443, 8880
VPN service
UDP 1194
Web server
TCP 80, TCP 443
FTP server
TCP 21
SSH (secure shell) server
TCP 22
SMTP (mail sending) server
TCP 25, TCP 465
POP3 (mail retrieval) server
TCP 110, TCP 995
IMAP (mail retrieval) server
TCP 143, TCP 993
Mail password change service
TCP 106
MySQL server
TCP 3306
MS SQL server
TCP 1433
PostgreSQL server
TCP 5432
Licensing Server connections
TCP 5224
Domain name server
UDP 53, TCP 53
Parallels Plesk Panel is middleware between end users and external services such as
FTP, mail, DNS and others. Due to technical limitations, Panel is able to interact with
these services only if they are available on certain ports.
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.
Introduction to Panel 13
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 for RPM-based systems or /opt/psa on
DEB-based systems. 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
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.
Parallels Plesk Panel for Linux uses the Apache web server for websites hosting.
C H A P T E R 2
Virtual Hosts Configuration
Apache itself does not operate with websites; it manages virtual hosts - web resources
identified either by an IP address or a host name. When creating a site, Panel adds a
new virtual host to Apache so that the site becomes available through the web server.
Panel resides on a virtual host too; this host is called the default virtual host.
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 17).
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 regenerates 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 Configuring Virtual Hosts.
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 23).
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 30).
Virtual Host IP Addresses
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.
Virtual Hosts Configuration 15
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.
Resolving Requests to Web Servers
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 17).
16 Virtual Hosts Configuration
In this chapter:
Virtual Hosts and Hosting Types ....................................................................... 17
Changing Virtual Hosts Settings Using Apache Configuration Templates .......... 18
Predefining Virtual Hosts for New Sites ............................................................. 23
Applying Custom PHP Settings on Domains with PHP in CGI/FastCGI Mode ... 27
Predefining Values for Customizable PHP Parameters ..................................... 29
Analyzing Access and Errors ............................................................................. 30
Virtual Hosts Configuration 17
Virtual Hosts and Hosting Types
Depending on how you intend to use a site created in Panel, for example, to host web
pages or to forward HTTP requests to another site, you can choose from three hosting
types that define the structure of a virtual host created for this site. 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 or 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 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 a browser, not the actual one. Panel uses
HTML frames to show the pages of another site with the requested URL.
The virtual host structure differs depending on hosting type:
Domains with a website hosting type have a directory called document root where
the website files are stored. The configuration of such a virtual host looks like this:
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:
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.
Changing Virtual Hosts Settings Using
Apache Configuration Templates
You can change the settings of virtual hosts running on the Panel server, for example,
set custom error pages (similar for all virtual hosts), or change the port on which the
hosted site is available.
These settings are stored in a set of Apache and virtual hosts configuration files. To
reduce the risk of errors during modification of Apache configuration files, Parallels
Plesk Panel provides a mechanism for changing the Apache and virtual host
configuration - Apache configuration templates. These templates are files, based on
which Panel re-generates certain Apache configuration files. Other Apache
configuration files are generated automatically and cannot be changed. The hierarchy
of the Apache configuration files generated from Panel automatically and from
templates is shown in the Appendix A: Apache Configuration Files (on page 193).
Apache configuration files support versioning. This allows you to roll back to a previous
configuration if the new one contains errors.
The default templates are located in
$PRODUCT_ROOT/admin/conf/templates/default/, where the
$PRODUCT_ROOT_D is /usr/local/psa for RPM-based systems or /opt/psa on
DEB based systems.
Virtual Hosts Configuration 19
To introduce your customizations to the configuration, copy the templates you need to
the $PRODUCT_ROOT/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.
Important: Do not change the default templates. All template customizations must be
performed in the $PRODUCT_ROOT/admin/conf/templates/custom/ directory,
and the default templates structure and content must be kept unchanged, since there
are no specific tools to undo the changes.
To remove customizations and restore the default configuration, just delete the custom
template files.
To change virtual hosts configuration using Apache configuration
2. Copy and paste the required templates from default/ to custom/
preserving the directory structure. You can find the complete list of
templates and their descriptions in the Appendix B: Apache Templates Structure (on page 195).
3. Modify the templates. See the details in the Templates Execution Context
section (on page 21).
4. Check that the modified templates are valid PHP files:
--reconfigure-domain <domain-name>generates files for a specified
domain.
--reconfigure-all generates all configuration files.
Note: Panel generates configuration files automatically upon a variety of events. For
example, if a website's hosting settings are changed - say PHP is enabled configuration for this website is generated anew.
3. Check the validity of the file and generate new configuration files.
Virtual Hosts Configuration 21
Template Execution Context
In essence, configuration templates are PHP files which, when executed, output web
server configuration files. The templates are executed in the environment where the
specific variables $VAR and $OPT are available.
$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 A: Apache Configuration Variables (on page 198).
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
A text generated by the included template (server/tomcat.php) will be included in
the configuration file.
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.
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']) {
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 A: Apache Configuration Variables (on page 198). 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
Changing the default http and https ports of a web server is useful when employing an
additional web server for caching purposes. For example, Nginx web server listens on
the default ports (80 http, 443 https), serves static content, say, all requests but PHP,
and redirects PHP requests to Apache. In turn, Apache web server listens on custom
ports (say, 8888 and 8999) and serves dynamic content - PHP requests.
To change the Apache HTTP port:
Find all occurrences of the string $VAR->server->webserver->httpPort and
replace them with the required port number enclosed in quotation marks, for example:
"3456".
To change the Apache HTTPS port:
Find all occurrences of the string $VAR->server->webserver->httpsPort and
replace them with the required port number enclosed in quotation marks, for example:
"4567".
Example
To make Apache listen to HTTP requests on port 3456, and HTTPS on 4567, make the
changes described above in all templates.
When Panel creates a site, one of the operations it carries out is to create a directory
structure for the site and fill the directories with some initial content. These directories
are located in the corresponding virtual host directories /var/www/vhosts/<domain_name>, where domain_name is the name of a
corresponding domain. By default, Panel creates similar sets of files and directories
inside each virtual host directory. See the section Default Structure of Panel Virtual Host (on
page 24) for a complete list of these files and directories.
24 Virtual Hosts Configuration
If you want to change the set of files and directories that are automatically included in
In this section:
Default Structure of Panel Virtual Host .............................................................. 24
Directories Tree
User
Group
Permis
sions
Description
/<VHOST
>
root
root
755
/anon_ftp
user
psaser
v
750
Anonymous FTP
files.
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.
To define a custom virtual host template:
1. On your local file system, create the required directories: httpdocs,
httpsdocs, cgi-bin, anon_ftp, error_docs.
2. Place the files you need into these directories. Place web pages in
httpdocs and httpsdocs directories, scripts in the cgi-bin
directory, and custom error messages in the error_docs directory.
You can use the default files stored in the /var/www/vhosts/skel/0.
3. Pack the directories and files into an archive in tgz, tar, tar.gz, or zip
format.
Make sure that the directories are in the root of the archive file and not in a
subdirectory.
4. Upload the archive to Panel though the GUI: Server Administration Panel >
Tools & Settings > Virtual Host Template > Browse.
To switch back to the default virtual host template, go to Tools & Settings > Virtual Host
Template and click the Default button.
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.
Default Structure of Panel Virtual Host
The following table shows the default structure of a virtual host created by Panel and
permissions set for its content:
Virtual Hosts Configuration 25
/cgi-bin
user
psaser
v
750
CGI scripts.
/conf
root
psaser
v
755
Configuration
files.
/error_docs
root
psaser
v
755
Error messages
files.
<doc>.html
user
psaser
v
755
/etc
root
root
755
Chroot
environment
directory.
/httpdocs
user
psaser
v
750
HTTP
documents.
/httpsdocs
user
psaser
v
750
HTTPs
documents.
Note: This
directory is not
present in new
installations,
only in
upgrades from
previous
versions
/pd
root
psaser
v
750
Passwords to
protected
directories.
d..<dir1>@<d
ir2>
apache
apache
400
/private
user
root
700
User’s private
storage.
/statistics
root
psaser
v
550
Statistics
directory
/anon_ftpstat
root
root
755
Anonymous FTP
statistics.
/ftpstat
root
root
755
FTP user
statistics.
/logs
root
root
755
Virtual host logs.
/webstat
root
root
755
HTTP user
statistics.
/webstat-ssl
root
root
755
HTTPS user
statistics.
/usr
root
root
755
Chroot
environment
directory.
/web_users
root
psaser
v
755
Web users
directory.
26 Virtual Hosts Configuration
/<web_user>
web_us
er
psaser
v
750
/<subdomain
>
user
psaser
v
750
HTTP and
HTTPs
documents of a
subdomain
(since Panel
10.0)
/subdomains
root
psaser
v
755
Service
directory.
Note: The
directory is
used for
compatibility
with earlier
Panel
versions .
Virtual Hosts Configuration 27
Applying Custom PHP Settings on
Domains with PHP in CGI/FastCGI Mode
Since Panel 10.3, administrators can specify custom PHP settings individually for each
domain (virtual host in Apache terms). The typical usage of this feature is to allocate
certain resources (like RAM consumed by PHP) to a particular site or to allow some
configuration changes to meet needs of a certain web app.
Server-Wide and Domain-Level PHP Settings
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.
Verifying the Results of Domain-Level Configuration
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.
28 Virtual Hosts Configuration
Changing PHP Settings of All New Domains
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 23).
Virtual Hosts Configuration 29
Predefining Values for Customizable PHP
Parameters
Panel allows to define custom PHP configuration for a certain service plan, add-on
plan, subscription, website, and even subdomain. For this purpose, the Panel GUI
exposes 16 most often used PHP parameters that allow customization. The
administrator or a customer can set the value of each parameter either by selecting a value from a preset, typing a custom value, or leaving the default value. In the latter
case, Panel takes the parameter value from the server-wide PHP configuration.
Using the $PRODUCT_ROOT/admin/conf/panel.ini file you can specify what PHP
parameters values will be available in the preset and toggle the visibility of the custom
value field.
Defining the Preset Values
To set the list of predefined values for a certain PHP parameter, add the line of the
following type to the [php] section of the panel.ini file:
<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, Customizing PHP Configuration.
<parameter_name> - a name of a PHP parameter. Use the same syntax as in
php.ini.
<value> - a parameter's value added to the preset. Use the same syntax as in
php.ini.
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:
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:
<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:
To switch the custom value field back on, replace false with true.
Analyzing Access and Errors
For each site, Apache writes access and error information to log files. Each site has
two log files - access_log and error_log, which store information on access to that
site and errors respectively. Apache log files for each site are located in the
/statistics/logs subdirectory of the virtual host directory
/var/www/vhosts/<domain_name>, where domain_name is the name of a
corresponding domain.
To save disk space, Panel rotates Apache logs. Learn how to change log rotation
parameters in the Log rotation (on page 125) section.
Loading...
+ 178 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.