subdomain.exe: Subdomains

The subdomain.exe utility is designed to manage subdomain accounts. The utility allows the following:

  • creating, renaming, and removing subdomains
  • enabling scripting languages support for subdomains
  • restricting the use of disk space for subdomains
  • managing FTP user account for subdomains

 

Location

%plesk_cli%

Usage
subdomain.exe <command> [<subdomain name>] [
<option 1> <param 1>[,<param 2>,...,<param n>]
[<option 2> <param 1>[,<param 2>,...,<param n>]]
... [<option N> <param 1>[,<param 2>,...,<param n>]]
]

 

Example

The following command creates the sample.example.com subdomain in the /httpdocs directory (once not specified explicitly, the default root directory is used), sets the disk space quota for this subdomain to 250 MB, and enables the SSI support for this subdomain.

subdomain.exe --create sample -domain example.com -hard_quota 250M -ssi true

 

Commands
Command Parameter Description Example

--create or -c

<subdomain name>

Creates a subdomain on the specified domain.

Requires -domain option.

Use the asterisk (*) symbol to create a wildcard subdomain. Site visitors will be redirected to this subdomain regardless of the subdomain name they enter in a browser.

To create the subdomain sample on the domain example.com:

subdomain.exe --create sample -domain example.com

or

subdomain.exe -c sample -domain example.com

--update or -u

<subdomain name>

Updates the subdomain belonging to a specified domain.

Requires -domain option.

To update the name of the sample.example.com subdomain with a new one - forum.example.com:

subdomain.exe --update sample -domain example.com -new_name forum

or

subdomain.exe -u sample -domain example.com -new_name forum

--remove or -r

<subdomain name>

Removes one or more subdomains from a specified domain.

Requires -subdomains and -domain options.

To remove forum.example.com from example.com:

subdomain.exe --remove -subdomains forum -domain example.com

or

subdomain.exe -r -subdomains forum -domain example.com

--suspend

<subdomain name>

Suspends the specified subdomain.

To suspend the website forum.example.com:

subdomain.exe --suspend forum.example.com

--info or -i

 

Retrieves the information about subdomains belonging to a specified domain.

Requires -subdomains and -domain options.

If the -subdomains option is omitted, outputs the info on all subdomains existing on the parent domain.

To retrieve the info about all subdomains of example.com:

subdomain.exe --info -domain example.com

or

subdomain.exe -i -domain example.com

To retrieve the info about the subdomain sample on example.com:

subdomain.exe --info -domain example.com -subdomains sample

--help or -h

 

Displays help on the use of the utility.

To see the help info on the use of this utility:

subdomain.exe --help

or

subdomain.exe -h

--list or -l

 

Displays the list of domains.

To see the list of all domains on the server:

subdomain.exe -l

 

Options
Option Parameter Description Example

-domain or -d

<domain name>

Specifies a parent domain for a subdomain.

To create the subdomain forum on the domain example.com:

subdomain.exe --create forum -domain example.com

-new_name

<new_subdomain>

Changes the name of a specified subdomain.

To rename subdomain from sample.example.com to the forum.example.com:

subdomain.exe --update sample -domain example.com -new_name forum

-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 sample.example.com, which has the standard forwarding type of hosting:

subdomain.exe -u sample.example.com -http_code 302

-mail-service-ip

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

Sets list of IPv4 and IPv6 addresses for the mail service.

To set the mail service IP for the subdomain sample.example.com to 192.168.1.2:

subdomain.exe -u sample -domain example.com -mail-service-ip 192.168.1.2

-www

true|false

Adds/Deletes the www prefix to/from the subdomain name.

Is true by default.

To remove the www prefix from sample.example.com:

subdomain.exe --update sample -domain example.com -www false

-write_modify

true|false

Allows or prohibits granting the Plesk IIS user and IIS application pool user the full access permission for the subdomain’s httpdocs/ and httpsdocs/ files and subfolders.

This permission might be required for correct functioning of web applications. Note that this permission, when granted, might seriously compromise website security.

Is false by default.

To allow the Plesk IIS user and IIS application pool user write and modify files and subfolders in httpdocs/ and httpsdocs/ folders of subdomain sample.example.com:

subdomain.exe --update sample -domain example.com -write_modify true

 

-webdeploy

true|false

Allows or prohibits web deploy publishing.

Is false by default.

To enable web deploy publishing for sample.example.com:

subdomain.exe --update sample -domain example.com -webdeploy true

-iis_app_pool

true|false

Allows or prohibits using dedicated IIS application pool for a domain. Is used with the --update command.

Is false by default.

To allow using dedicated IIS application pool on sample.example.com:

subdomain.exe --update sample -domain example.com -iis_app_pool true

-iis-app-pool-turned-on

true|false

Enables or disables an IIS application pool.

To turn off IIS application pool for sample.example.com:

 

subdomain.exe --update sample -domain example.com -iis-app-pool-turned-on false

-max-worker-processes

<number>

Sets the maximum number of worker processes permitted to service requests for IIS application pool.

To set the maximum number of worker processes for the sample.example.com dedicated IIS application pool to 3:

subdomain.exe --update sample -domain example.com -max-worker-processes 3

-idle-timeout

<minutes>

The amount of time a worker process will remain idle before it shuts down.

To set the length of time worker processes for the sample.example.com dedicated IIS application pool to remain idle to 2 minutes:

subdomain.exe --update sample -domain example.com -idle-timeout 2

-managed-pipeline-mode

Integrated|Classic

Configures ASP.NET to run in classic mode as an ISAPI extension or in integrated mode where managed code is integrated into the request-processing pipeline.

To have ASP.NET run in the integrated mode for the sample.example.com dedicated IIS application pool:

subdomain.exe --update sample -domain example.com -managed-pipeline-mode Integrated

-cpu_usage

<integer>

Defines the maximum CPU usage by a domain (in percent).

To limit the maximum CPU usage by sample.example.com to 3%:

 

subdomain.exe --update sample -domain example.com -cpu_usage 3

-cpu-usage-state

true|false

Switches IIS application pool CPU usage monitoring on or off.

To set up CPU usage settings for the IIS application pool of the domain sample.example.com:

subdomain.exe --update sample -domain example.com -cpu-usage-state true -cpu-usage-value 3 -cpu-usage-action KillW3wp -cpu-usage-interval 5

-recycling-by-time 60 -recycling-by-requests 1000 -recycling-by-virtual-memory 5120 -recycling-by-private-memory 10240

 

-cpu-usage-value

<integer number>

Specifies the maximum percentage of CPU time that worker processes in an application pool are allowed to consume over a period of time specified by the -cpu-usage-interval option.

If the limit is exceeded, the event is written to the event log and an optional set of events can be triggered. These optional events are determined by the -cpu-usage-action option.

-cpu-usage-action

NoAction|KillW3wp

Specifies the action that IIS takes when worker processes exceed the limit on CPU time usage.

  • NoAction - no action is taken when the CPU limit is exceeded. A warning is written to the event log.
  • KillW3wp - processes that exceed their CPU limit will be forced to shut down.

-cpu-usage-interval

<minutes>

Specifies the reset interval for monitoring of CPU usage by worker processes.

-recycling-by-time

<minutes>

The period of time after which IIS application pool recycles.

-recycling-by-requests

<number>

The maximum number of requests IIS application pool can process before it recycles.

-recycling-by-virtual-memory

<KB>

The maximum amount of virtual memory a worker process can consume before causing the IIS application pool to recycle.

-recycling-by-private-memory

<KB>

The maximum amount of private memory a worker process can consume before causing the IIS application pool to recycle.

-fp

true|false

Enables/Disables FrontPage support on a subdomain.

Is false by default.

To enable FrontPage support on the subdomain sample.example.com:

subdomain.exe --update sample -domain example.com -fp true

-fpauth

true|false

Allows/Prohibits FrontPage authoring before downloading content via FrontPage.

Is false by default.

To allow FrontPage authoring on sample.example.com:

subdomain.exe --update sample -domain example.com -fpauth true

-fp_no_index

true|false

Defines whether FrontPage uses native WAIS search engine, or IIS Index Server for indexing web sites.

Is false by default.

If on Virtuozzo, is true by default.

To make FrontPage use native WAIS search engine on sample.example.com:

subdomain.exe -u sample -domain example.com -fp_no_index true

-ssi

true|false

Enables/Disables SSI support on the subdomain.

Is false by default.

To enable SSI support on sample.example.com:

subdomain.exe --update sample -domain example.com -ssi true

-ssi_html

true|false

Enables/Disables SSI support for HTML, HTM files on the subdomain.

Is false by default.

To enable SSI support for HTML, HTM files on sample.example.com:

subdomain.exe --update sample -domain example.com -ssi_html true

-php

true|false

Enables/Disables PHP support on the subdomain.

Is false by default.

To enable PHP support on sample.example.com:

subdomain.exe --update sample -domain example.com -php true

-php_handler_id

cgi-5|cgi-5.3|cgi-5.4|fastcgi-5|fastcgi-5.3|fastcgi-5.4|isapi-5

Associates the PHP handler with the site.

Is cgi by default.

To enable running PHP as an ISAPI extension on the subdomain sample.example.com:

subdomain.exe --update sample -domain example.com -php_handler_id isapi-5

-cgi

true|false

Enables/Disables CGI support on the subdomain.

Is false by default.

To enable CGI support on sample.example.com:

subdomain.exe --update sample -domain example.com -cgi true

-perl

true|false

Enables/Disables PERL support on the subdomain.

Is false by default.

To enable PERL support on the subdomain sample.example.com:

subdomain.exe --update sample -domain example.com -perl true

-asp

true|false

Enables/Disables ASP support on the subdomain.

Is false by default.

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

subdomain.exe --update sample -domain example.com -asp true

-miva

true|false

Enables/Disables ASP support on the subdomain.

Is false by default.

To enable Miva support on sample.example.com:

subdomain.exe --update sample -domain example.com -miva true

-ssl

true|false

Enables/Disables SSL support.

Set to false by default.

To enable SSL support on the subdomain sample.example.com:

subdomain.exe -u sample -domain example.com -ssl true

-python

true|false

Enables/Disables Python support on the subdomain.

Is false by default.

To enable Python support on sample.example.com:

subdomain.exe --update sample -domain example.com -python true

-subdomains or -s

<subdomain[,<...>]>

Specifies the subdomains to remove or to retrieve info about.

Required with --remove and --info.

If the -subdomains option is omitted, the ---info command outputs the info on all subdomains existing on the parent domain.

To remove sample.example.com and photo.example.com from example.com:

subdomain.exe --remove -subdomains sample,photo -domain example.com

To retrieve info about forum.example.com:

subdomain.exe --info forum -domain example.com

-www-root

<www_root>

Specifies the document root directory for a subdomain, relative to the webspace root directory.

To specify the directory /site2 as the root directory for the subdomain sample.example.com:

subdomain.exe --create sample -domain example.com -www-root /site2

-create_phys

true|false

Creates/Doesn't create the root directory for a subdomain within the %plesk_vhosts%/ domain_name/ httpdocs folder.

Is true by default.

To create the /httpdocs/pics folder as the root directory for subdomain pics.example.com:

subdomain.exe --create pics -domain example.com -hst_type virt -create_phys true

-asp.net

true|false

Enables/Disables ASP.NET support on the subdomain.

Is false by default.

To enable ASP.NET support on sample.example.com:

subdomain.exe --update sample -domain example.com -asp.net true

-asp.net_version

1.1|2.0|4.0

Specifies the version of Microsoft ASP.NET on the subdomain.

Is 2.0 by default.

To choose version 4.0 of Microsoft ASP.NET on sample.example.com:

subdomain.exe -u sample -domain example.com -asp.net_version 4.0

-certificate-name

<SSL certificate name>

Sets the SSL certificate for the site.

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

subdomain.exe -u sample -domain example.com -certificate-name testcert

-notify

true|false

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

Used with --create only.

To prevent email notifications about the subdomain creation:

subdomain.exe --create sample.example.com -notify false

-max-connections

<number>

Limits the number of HTTP connections.

Unlimited is set to -1.

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

subdomain.exe -u sample.example.com -max-connections 10

-traffic-bandwidth

<number>

Limits the network usage.

Unlimited is set to -1.

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

subdomain.exe -u example.com -traffic-bandwidth 500

-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 subdomain sample.example.com to www.sample.example.com:

subdomain.exe -u sample.example.com -seo-redirect www

-description

<string>

Sets a description for the subscription to be displayed in Plesk.

To set a description reading "Custom description" for the subdomain sample.example.com:

subdomain.exe -u sample -domain example.com -description "Custom description"

-admin-description

<string>

Sets a description for the subscription to be displayed in Plesk to the Administrator.

To set a description reading "Custom description" for the subdomain sample.example.com:

subdomain.exe -u sample -domain example.com -admin-description "Custom description"

-reseller-description

<string>

Sets a description for the subscription to be displayed in Plesk to be displayed to a Reseller and the Administrator.

To set a description reading "Custom description" for the subdomain sample.example.com:

subdomain.exe -u sample -domain example.com -reseller-description "Custom description"