Domain Templates: domain_template Utility

The domain_template utility is used to create and edit domain templates through CLI. The utility allows the following operations:

Syntax

domain_template <command> <domain template name> [

<option_1> [<param>]

[<option_2> [<param>]]

…[<option_N> [<param>]]]

Example

The following command line creates new domain template named DomainTemplate; enables physical hosting and allocates 100 MB of disk space for domains to be created using this template; sets the domain validity period to one year starting from the domain creation date; sets the monthly domain traffic limit to 500 MB/month; enables Python, PHP, and Apache PHP support; enables forwarding of e-mail messages addressed to non-existing users to e-mail address admin@example.com.

# ./domain_template -c DomainTemplate -hosting true -disk_space 100M -expiration 1Y -max_traffic 500 -python true -asp true -php true -no_usr admin@example.com

Commands

Command

Parameter

Description

Example

--create or -c

<domain template name>

Creates a new domain template.

To create a domain template named DomainTemplate:

# ./domain_template --create DomainTemplate

or

# ./domain_template -c DomainTemplate

--update or -u

<domain template name>

Updates an existing domain template.

To update a domain template named DomainTemplate:

# ./domain_template --update DomainTemplate

or

# ./domain_template -u DomainTemplate

--remove or -r

<domain template name>

Deletes a domain template.

To remove a domain template DomainTemplate:

# ./domain_template --remove DomainTemplate

or

# ./domain_template -r DomainTemplate

--xml-info or -i

<domain template name>

Displays information about a domain template in the XML format.

To display information about domain template DomainTemplate in the XML format:

# ./domain_template --xml-info DomainTemplate

or

# ./domain_template -x DomainTemplate

--help or -h

 

Displays help on the use of the utility.

To view help on the use of the utility:

# ./domain_template --help

or

# ./domain_template -h

Options

Option

Parameter

Description

Example

-new-name

<string>

Sets a new name for an existing domain template.

To change the name of domain template DomainTemplate to NewDomainTemplate:

# ./domain_template -u DomainTemplate -new-name NewDomainTemplate

-clogin

<client login name>

Assigns a domain template to a client account

To assign domain template DomainTemplate to a client with Plesk login name Client:

# ./domain_template -u DomainTemplate -clogin Client

-no_usr

bounce:<txt>|<e-mail address>|reject

Enables or disables message bouncing, forwarding to an e-mail address, or rejecting mail addressed to non-existing users. Sets the Mail to nonexistent user parameter (Bounce with message, Forward to address, and Reject options) and specifies the text added on top of the bounced messages.

To enable bouncing mail messages addressed to non-existing users and adding text mail service for this email address has been discontinued to the bounced messages in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -no_usr bounce:"mail service for this email address has been discontinued"

To enable forwarding mail messages addressed to non-existing users to admin@example.com in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -no_usr admin@example.com

-webmail

true|false

Enables or disables the use of WebMail.

Set to false by default.

To enable WebMail support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -webmail true

-max_dom_aliases

<number>

Sets the Maximum number of domain aliases limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of domain aliases limit in domain template DomainTemplate to 10:

# ./domain_template -u DomainTemplate -max_dom_aliases 10

-disk_space

<number>[K|M|G]

Sets the Disk space limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Disk space limit in domain template DomainTemplate to 50 MB:

# ./domain_template -u DomainTemplate -disk_space 50M

-max_traffic

<number>[K|M|G]

Sets the Maximum amount of traffic (per month) limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum amount of traffic limit in domain template DomainTemplate to 500 MB/month:

# ./domain_template -u DomainTemplate -max_traffic 500M

-max_box

<number>

Sets the Maximum number of mailboxes limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of mailboxes limit in domain template DomainTemplate to 50:

# ./domain_template -u DomainTemplate -max_box 50

-mbox_quota

<number>[K|M|G]

Sets the Mailbox quota limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Mailbox quota limit in domain template DomainTemplate to 50 MB:

# ./domain_template -u DomainTemplate -mbox_quota 50M

-total_mboxes_quota

<number>

Sets the Total mailboxes quota limit (in MB). (type "-1" to set the parameter to Unlimited).

To set the Total mailboxes quota limit in domain template DomainTemplate to 50 MB:

# ./domain_template -u DomainTemplate -total_mboxes_quota 50

-max_redir

<number>

Sets the Maximum number of mail redirects limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of mail redirects limit in domain template DomainTemplate to Unlimited:

# ./domain_template -u DomainTemplate -max_redir -1

-max_mg

<number>

Sets the Maximum number of mail groups limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of mail groups limit in domain template DomainTemplate to 100:

# ./domain_template -u DomainTemplate -max_mg 100

-max_resp

<number>

Sets the Maximum number of mail autoresponders limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of mail autoresponders limit in domain template DomainTemplate to 50:

# ./domain_template -u DomainTemplate -max_resp 50

-max_wu

<number>

Sets the Maximum number of web users limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of web users limit in domain template DomainTemplate to 100:

# ./domain_template -u DomainTemplate -max_wu 100

-max_db

<number>

Sets the Maximum number of databases limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of databases limit in domain template DomainTemplate to 20:

# ./domain_template -u DomainTemplate -max_db 20

-max_maillists

<number>

Sets the Maximum number of mailing lists limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of mailing lists limit in domain template DomainTemplate to 50:

# ./domain_template -u DomainTemplate -max_maillists 50

-max_webapps

<number>

Sets the Maximum number of Java applications limit. (type "-1" to set the parameter to Unlimited). Is set to Unlimited by default.

To set the Maximum number of Java applications limit in domain template DomainTemplate to 100:

# ./domain_template -u DomainTemplate -max_webapps 100

-max_subdom

<number>

Sets the Maximum number of subdomains limit. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Maximum number of subdomains limit in domain template DomainTemplate to 20:

# ./domain_template -u DomainTemplate -max_subdom 20

-expiration

<number>Y|M|D

Sets the Validity period limit starting from creation date of a the domain account. (type "-1" to set the parameter to Unlimited).

Set to Unlimited by default.

To set the Validity period limit in domain template DomainTemplate to 20 days:

# ./domain_template -u DomainTemplate -expiration 20D

To set the Validity period limit in domain template DomainTemplate to 1 year:

# ./domain_template -u DomainTemplate -expiration 1Y

-log_rotate

true|false

Enables or disables log rotation on a domain. Is set to false by default.

To disable log rotation in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -log_rotate false

-log_bysize

<KB>

Enables or disables log rotation on domain based on the current log file size (the Log rotation condition parameter).

To enable log rotation once the current log file reaches the 20 KB size in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -log_bysize 20

-log_bytime

daily|weekly|

monthly

Enables or disables log rotation on domain based on the current log file size (the Log rotation condition parameter).

Set to daily by default.

To set weekly log rotation in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -log_bytime weekly

-log_max_num

<number>

Sets the Maximum number of log files parameter.

To set the maximum number of log files to 5 in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -log_max_num 5

-log_compress

true|false

Enables or disables log file compression (the Compress log files parameter).

Set to false by default.

To enable log file compression in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -log_compress true

-log_email

<e-mail address>

Enables or disables automatic sending of rotated log files to the specified e-mail address (the Send processed log files to e-mail parameter).

To enable automatic sending of rotated log files to domainadmin@example.com in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -log_email domainadmin@example.com

-keep_traf_stat

<number>

Sets the Retain traffic statistics (in months) parameter for a domain (Report > Traffic history > Traffic statistics retention preferences >). (type "-1" if you want all statistics to be retained).

To set the Retain traffic statistics parameter in domain template DomainTemplate to 5 months:

# ./domain_template -u DomainTemplate -keep_traf_stat 5

-maillist

true|false

Sets the Mailing lists parameter.

Set to false by default.

To enable mailing lists in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -maillist true

-dns_zone_type

master|slave

Sets the Type of domain DNS zone parameter.

Set to master by default.

To set the Plesk DNS server to act as slave DNS server in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -dns_zone_type slave

-hosting

true|false

Enables or disables physical hosting on domain (the Physical hosting parameter).

Set to false by default.

To enable physical hosting in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -hosting true

-quota

<number>[K|M|G]

Sets the Hard disk quota parameter for domain. Type -1 to set the parameter to Unlimited. A number without a letter is interpreted as the number of bytes. This is a hard limit that cannot be exceeded.

Set to Unlimited by default.

To set the hard disk quota to 100 MB in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -quota 100M

-ssl

true|false

Enables or disables SSL support (the SSL support parameter).

Set to false by default.

To enable SSL support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -ssl true

-same_ssl

true|false

Enables or disables using a single directory for storing content accessible through SSL and non-SSL connection (the Use a single directory for housing SSL and non-SSL content parameter).

Set to false by default.

To enable using a single directory for storing content accessible through SSL and non-SSL connection in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -same_ssl true

-ssi

true|false

Enables or disables the SSI support parameter.

Set to false by default.

To enable SSI support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -ssi true

-ssi_html

true|false

Sets the use SSI for *.htm, *.html files option for the SSI support parameter.

Set to false by default.

To enable SSI support for HTML and HTM files in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -ssi_html true

-php

true|false

Enables or disables PHP support (the PHP support parameter).

Set to false by default.

To enable PHP support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -php true

-cgi

true|false

Enables or disables CGI support (the CGI support parameter).

Set to false by default.

To enable CGI support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -cgi true

-perl

true|false

Enables or disables the mod_perl support parameter.

Set to false by default.

To enable Perl support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -perl true

-asp

true|false

Enables or disables Apache ASP support (the Apache ASP support parameter).

Set to false by default.

To enable Apache ASP support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -asp true

-python

true|false

Enables or disables Python support (the mod_python support parameter).

Set to false by default.

To enable Python support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -python true

-coldfusion

true|false

Enables or disables ColdFusion support (the ColdFusion support parameter).

Set to false by default.

To enable ColdFusion support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -coldfusion true

-fastcgi

true|false

Enables or disables FastCGI support (the mod_fcgi support parameter).

Set to false by default.

To enable FastCGI support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -fastcgi true

-shell

<shell name>|forbidden

Enables or disables shell access user and sets the OS system shell for FTP user access. (You can use the --shells command of the domain utility to display the list of available shells).

Set to forbidden by default.

To enable shell access and set the /bin/sh/ shell for domain FTP user in domain template DomainTemplate:

# ./domain_template -u -shell /bin/sh

To display the list of available shells:

# ./domain --shells

-webstat

none|webalizer|

awstats

Enables or disables Web statistic support; selects Web statistics application (Awstats or Webalizer) (the Web statistics parameter).

Set to none by default.

To enable Webalizer support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -webstat webalizer

-webstat_protdir

true|false

Enables or disables the accessible via password protected directory '/plesk-stat/' option for the Web statistics parameter.

Set to false by default.

To enable remote user access to the Web statistics data at http://example.com/plesk-stat/ in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -webstat_protdir true

-err_docs

true|false

Enables or disables custom server error messages on a domain ( the Custom Error Documents parameter).

Set to false by default.

To enable custom error messages support in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -err_docs true

-wuscripts

true|false

Enables or disables scripting support for web users on a domain (the Allow the web users scripting parameter).

Set to false by default.

To enable scripting support for web users in domain template DomainTemplate:

# ./domain_template -u DomainTemplate -wuscripts true