site: Sites

The site utility is used for managing sites within an existing webspace.

Note: For information on how to create and manage webspaces, refer to the Subscriptions: subscription Utility section.

Usage
site <command> <domain name> [
<option_1> [<param>]
[<option_2> [<param>]]
... [<option_N> [<param>]]

Example

The following command sets up a new domain example.com in the testdomain.tst webspace and enables hosting.

plesk bin site --create example.com -webspace-name testdomain.tst -hosting true

Commands
Command Parameter Description Example

--create or --c

<domain_name>

Creates a new website inside an existing webspace..

 

Requires the -webspace-name option.

Note: If SELinux is enabled on your operating system, the create command might not work. In that case, switch off SELinux as described in the Deployment Guide > Migrating from Other Panels > Preparing for Migration.

To create a site with the name example.com inside the testdomain.tst webspace:

plesk bin site --create example.com -webspace-name testdomain.tst

or

plesk bin site -c example.com -webspace-name testdomain.tst

--update or --u

<domain_name>

Updates configuration of an existing website.

To enable the website example.com:

plesk bin site --update example.com -status enabled

or

plesk bin site -u example.com -status enabled

--remove or --r

<domain_name>

Deletes an existing website.

To delete the website example.com:

plesk bin site --remove example.com

or

plesk bin site -r example.com

--info or -i

<domain_name>

Displays information about configuration of a website.

To view configuration information on the website example.com:

plesk bin site --info example.com

or

plesk bin site -i example.com

--on

<domain_name>

Activates a suspended website.

To activate the website example.com:

plesk bin site --on example.com

--suspend

<domain_name>

Suspends a website.

To suspend the domain example.com:

plesk bin site --suspend example.com

--off

<domain_name>

Disables a website.

To disable the domain example.com:

plesk bin site --off example.com

--list or -l

 

Displays the list of domains.

To display the list of domains on the server:

plesk bin site --list

--update-php-settings

<domain_name>

Updates custom PHP configuration for a website. Use the utility to set values for 16 most often used PHP settings (exposed to Plesk GUI) or to add any additional PHP directive.

To set one of 16 general PHP settings, prepare the file with the settings you want to change.

Note: File syntax should be the same with php.ini (<parameter>=<value>). To set the default value to the parameter, do not use any value: <parameter>=

Then apply the settings to the site (example.com):

plesk bin site --update-php-settings example.com -settings my_file

 

If you cannot find a certain PHP parameter among 16 general settings, add it as an additional directive to a file and apply the changes to the site (example.com):

plesk bin site --update-php-settings example.com -additional-settings my_file_add

--show-php-settings

<domain_name>

Displays information about current PHP configuration of a website.

To view the PHP configuration information for the website example.com:

plesk bin site --show-php-settings example.com

--help or -h

 

Displays help on the use of the utility.

To view help on the use of the domain utility:

plesk bin site --help

or

plesk bin site -h

Options
Option Parameter Description Example

-new_name

<domain_name>

Renames a domain.

Used with the --update only.

To rename the domain example.com to sample.net:

plesk bin site -u example.com -new_name sample.net

-dns

true|false

Enables/Disables DNS zone for a domain.

To enable DNS zone for the domain example.com:

plesk bin site -u example.com -dns true

To disable a DNS zone for the domain example.com:

plesk bin site -u example.com -dns false

-www

true|false

Enables/Disables the www prefix for a domain.

Is true by default.

To disable the www prefix for the domain example.com:

plesk bin site -u example.com -www false

-hosting

true|false

Enables/Disables hosting for a domain.

Is false by default.

 

To enable hosting for the domain example.com:

plesk bin site -u example.com -hosting true

-hst_type

phys|std|frm

Sets the type of hosting on a domain.

The following types are available: physical hosting (phys), standard forwarding (std), and frame forwarding (frm).

Is phys by default.

Requires the -target_url option, when the std or frm parameters are specified.

To set up the standard forwarding hosting (with forwarding to sample.org) for the existing domain example.com:

plesk bin site -u example.com -hosting true -hst_type std -target_url sample.org

-target_url

<URL>

Sets a target URL for the Standard forwarding and Frame forwarding types of hosting.

Required with -hst_type option when the std or frm parameters are specified.

To set up a target URL for the domain example.com with the standard forwarding hosting (forwarding to sample.org):

plesk bin site -u example.com -target_url sample.org -hst_type std

-mail-service-ip

<IP address>[,<IP address>,..]

Sets the IP address for the mail service for the specified domain.

Set the IP address for the mail service for the domain example.com to 192.168.1.2:

plesk bin site -u example.com -mail-service-ip 192.168.1.2

-http_code

301|302

Specifies the HTTP response status code to be used for standard forwarding.

To use the 302 code for forwarding on the domain example.com, which has the standard forwarding type of hosting:

plesk bin site -u example.com -http_code 302

-seo-redirect

non-www|www|none

Turns on the search engine friendly HTTP 301 redirection. Use 'non-www' to redirect from www.domain to domain, 'www' to redirect from domain to www.domain, and 'none' to turn off the redirection (default: non-www).

To turn on redirection for the domain example.com to www.example.com:

plesk bin site -u example.com -seo-redirect www

-www-root

<path>

Specifies website home directory (relative to the webspace root).

To set up a website example.com within the directory site2 in the webspace:

plesk bin site -c example.com -service-plan megaplan -www-root site2

-webspace-name

<domain>

Specifies the webspace name (the same as the name of the main domain in the webspace).

To create a domain site2.com inside an existing webspace example.com for the customer with the username JDoe:

plesk bin site -c site2.com -webspace-name example.com owner JDoe

-parent-domain-name

<parent_domain_name>

Specifies the parent domain name when creating a subdomain.

To create a subdomain test.example.com for the parent domain example.com:

plesk bin site -c test.example.com -parent-domain-name example.com

-shell

<shell_name>|false

Enables/Disables shell access for FTP user, and sets the OS system shell for FTP user access.

To enable shell access for FTP user on the domain example.com, and to set the shell to /bin/sh:

plesk bin site -u example.com -shell /bin/sh

-hard_quota

<number>[K|M|G]

Limits the FTP user hard disk quota.

Unlimited if set to 0.

A number without a letter is interpreted as the number of bytes.

To set a 100 MB hard disk quota for the domain example.com:

plesk bin site -u example.com -hard_quota 100M

-creation-date

<YYYY-MM-DD>

Sets the domain creation date.

Used with the --create only.

To set the creation date for domain example.com to 2008-12-30:

plesk bin site -c example.com -creation-date 2008-12-30

-ssi

true|false

Enables/Disables SSI support.

Is false by default.

To enable SSI support on the domain example.com:

plesk bin site -u example.com -ssi true

-php

true|false

Enables/Disables PHP support.

Is false by default.

To enable PHP support on the domain example.com:

plesk bin site -u example.com -php true

-php_handler_id

module|cgi|fastcgi

Associates the PHP handler with the site. Specify the handler's identifier (default: cgi).

To set PHP handler on the domain example.com to FastCGI:

plesk bin site -u example.com -php_handler_type cgi

-php_safe_mode

true|false

Enables/Disables safe mode for PHP support.

Is true by default.

To disable safe mode for PHP support on the domain example.com:

plesk bin site -u example.com -php true -php_safe_mode false

-cgi

true|false

Enables/Disables CGI support.

Is false by default.

To enable CGI support on the domain example.com:

plesk bin site -u example.com -cgi true

-cgi-mode

webspace|www-root

Determines the location of the cgi-bin directory.

To set the location of the cgi-bin directory for the domain example.com to wwwroot:

plesk bin site -u example.com -cgi-mode www-root

-perl

true|false

Enables/Disables Perl support.

Is false by default.

To enable Perl support on the domain example.com:

plesk bin site -u example.com -perl true

-asp

true|false

Enables/Disables Apache ASP support.

Is false by default.

To enable Apache ASP support on the domain example.com:

plesk bin site -u example.com -asp true

-python

true|false

Enables/Disables Python support.

Is false by default.

To enable Python support on the domain example.com:

plesk bin site -u example.com -python true

-fastcgi

true|false

Enables/Disables FastCGI support.

Is false by default.

To enable FastCGI support on the domain example.com:

plesk bin site -u example.com -fastcgi true

-miva

true|false

Enables/Disables Miva support.

Is false by default.

To enable Miva support on the domain example.com:

plesk bin site -u example.com -miva true

-ssl

true|false

Enables/Disables SSL support.

Is false by default.

To enable SSL support on the domain example.com:

plesk bin site -u example.com -ssl true

-webstat

none|awstats|webalizer

Enables/Disables Web statistic support; selects Web statistics application (Awstats or Webalizer).

Is none by default.

To enable Webalizer support on the domain example.com:

plesk bin site -u example.com -webstat webalizer

-webstat-protdir-access

true|false

Enables/Disables access to web statistics data through password- protected directory /plesk-stat.

Is false by default.

To enable access to web statistics data through password- protected directory /plesk-stat on the domain example.com:

plesk bin site -u example.com -webstat-protdir-access true

-certificate-name

<SSL certificate name>

Sets the SSL certificate for the site.

To set the SSL certificate testcert for the domain example.com:

plesk bin site -u example.com -certificate-name testcert

-err_docs

true|false

Enables/Disables custom server error messages.

Is false by default.

To enable custom error messages support on the domain example.com:

plesk bin site -u example.com -err_docs true

-log-rotate

true|false

Enables/Disables log rotation.

Is false by default.

To enable log rotation on the domain example.com:

plesk bin site -u example.com -log-rotate true

-log-bysize

<number>[B|K|M|G|T]

Enables/Disables log rotation based on the current log file size.

To enable log rotation on the domain example.com once the current log file reaches the 200 KB size:

plesk bin site -u example.com -log-bysize 200

-log-bytime

daily|weekly|monthly

Enables/Disables log rotation by time.

Is daily by default.

To enable weekly log rotation on the domain example.com:

plesk bin site -u example.com -log-bytime weekly

-log-max-num-files

<number>

Limits the number of log files parameter.

Is 3 by default.

To restrict the maximum number of log files (current and rotated) on the domain example.com to 10:

plesk bin site -u example.com -log-max-num-files 10

-log-compress

true|false

Enables/Disables log file compression.

Is true by default.

To disable log file compression on the domain example.com:

plesk bin site -u example.com -log-compress false

-log-email

<email>

Enables/Disables automatic sending of rotated log files to the specified email address.

To enable automatic sending of rotated log files on the domain example.com to email address admin@example.com:

plesk bin site -u example.com -log-email admin@example.com

-mail_service

true|false

Enables/Disables mail service.

Is true by default.

To disable mail service on the domain example.com:

plesk bin site -u example.com -mail_service false

-mail_service_node_ip

<IP address> | local

Specifies the IP address of the service node providing the mail service or the domain.

To set the IP address of the service node providing the mail service for the domain example.com to 192.168.1.2:

plesk bin site -u example.com -mail_service_node 192.168.1.2

-maillist_service

true|false

Enables/Disables the mailing list service.

Is false by default.

To enable mailing list service on the domain example.com:

plesk bin site -u example.com -maillist_service true

-publish-sb-site

true|false

Allows/Prohibits publishing site with Presence Builder.

Is false by default.

To allow publishing site with Presence Builder on the domain example.com:

plesk bin site -u example.com -publish-sb-site true

-max-connections

<number>

Limits the number of available connections.

Unlimited is set to -1.

To limit the maximum number of connections available for the domain example.com to 10:

plesk bin site -u example.com -max-connections 10

-traffic-bandwidth

<number>

Limits the network use.

Unlimited is set to -1.

To limit the maximum network use on the domain example.com to 500 KB/S:

plesk bin site -u example.com -traffic-bandwidth 500

-notify

true|false

Allows/Prohibits standard email notifications on a domain creation (Plesk domain administrators and clients).

Used with --create only.

To prevent email notifications about domain creation:

plesk bin site --create example.com -notify false

-map_ip

<IP address>[,<IP address>]

Specifies the IP address to be assigned to the subscription after the subscription owner change.

To assign the IP address 192.168.1.2 to the subscription example.com after the ownership change:

plesk bin site -u example.com -map_ip 192.168.1.2

-description

<string>

Specifies a description of the subscription to be displayed in Plesk.

To create a description of the domain example.com:

plesk bin site -u example.com -description "Notes about this site"

-admin-description

<string>

Specifies a description of the subscription for the administrator. It is displayed in Plesk only to the administrator.

To create a description of the domain example.com that will be visible for the administrator only:

plesk bin site -u example.com -admin-description "Admin's notes about this site"

-reseller-description

<string>

Specifies a description of a subscription owned by a reseller. It is displayed in Plesk to the reseller and administrator.

To create a description of the domain example.com that will be visible to the reseller and the administrator:

plesk bin site -u example.com -reseller-description "Reseller's notes about this site"

-settings

<filename>

Sets the file containing custom PHP settings for a site. The file can include only 16 general PHP settings exposed to the Plesk GUI.

Used with --update-php-settings only.

To set custom PHP configuration from the file my_file to the site example.com:

plesk bin site --update-php-settings example.com -settings my_file

-additional-settings

<filename>

Sets the file containing custom PHP settings for a site. The file can include any PHP directive except 16 general PHP settings exposed to the Plesk GUI.

Used with --update-php-settings only.

To add directives to custom PHP configuration from the file my_file_add (example.com):

plesk bin site --update-php-settings example.com -additional-settings my_file_add

-outgoing-messages-domain-limit

<number>|default

Sets the maximum number of outgoing messages from a specified site (per hour).

To set the Unlimited value, specify "-1". Specify "default" to set the value specified in server-wide settings.

To set the limit on outgoing email messages from a domain:

plesk bin site -u example.com -outgoing-messages-domain-limit 15

 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.