Configuration file templates (ISPmanager)

From ISPWiki

Jump to: navigation, search

Configuration file templates can be used if the information added by the control panel when creating a domain, WWW domain, etc. is not enough. For example, you want several lines to be automatically added into the httpd.conf configuration file when creating a new WWW domain.

To add a configuration file template, create a file with one of the names listed below in the etc sub directory of the control panel's directory and specify all the lines there. They will be automatically added into the corresponding configuration file. The following templates are currently supported:

  • directory.templ - when creating a new WWW domain, the lines from the file will be automatically added into the Directory section of the httpd.conf configuration file.
  • domain.templ - when creating a new domain zone, the lines from the template file will be automatically added into the corresponding zone section ' of the named.conf configuration file.
  • domainzone.templ - when adding a new domain zone, the zone file will be created basing on this file. Name servers, e-mail servers and alias domain records will be automatically added into this file. In the template you can provide your own parameters SOA, additional SPF, etc.
  • virtualhost.templ - when creating a new WWW domain, the lines of the template file will be automatically added into the corresponding VirtualHost section of the httpd.conf configuration file.
  • server.templ - when creating a new WWW domain, the contents of the server record will be automatically taken from the template file. If localhost specified in the template coincides with localhost created by ISPmanager, localhost won't be duplicated and the lines will be added to a corresponding section.

Please note, that the lines from the configuration file templates are added to the lines created by the control panel, rather than overwrite them.

Contents

Macros

You may use macros that will be changed into the corresponding values.

domainzone.templ

  • __ip__ or __IP__ - an IPv4-address that was specified when creating a new domain.
  • __name__ or __NAME__ - domain name.
  • SOA-record:
    • __mname__ - the source name server where the file was created.
    • __rname__ - the e-mail address of the person responsible for administering the domain's zone file
    • __serial__ - the serial number of this zone file. 32-bit figure that is incremented each time a change is made.
    • __refresh__ - the time, in seconds, a secondary DNS server waits before querying the primary DNS server's SOA record to check for changes. When the refresh time expires, the secondary DNS server requests a copy of the current SOA record from the primary. The primary DNS server complies with this request. The secondary DNS server compares the serial number of the primary DNS server's current SOA record and the serial number in it's own SOA record. If they are different, the secondary DNS server will request a zone transfer from the primary DNS server.
    • __retry__ - signed 32 bit value in seconds. Defines the time between retries if the slave (secondary) fails to contact the master when refresh (above) has expired.
    • __expire__ - the time, in seconds, that a secondary server will keep trying to complete a zone transfer. If this time expires prior to a successful zone transfer, the secondary server will expire its zone file. This means the secondary will stop answering queries.
    • __minimum__ - the minimum time-to-live value applies to all resource records in the zone file. This value is supplied in query responses to inform other servers how long they should keep the data in cache.
    • __nsN__ - name server, where N is a number from 0 to <number of name server> - 1.

virtualhost.templ

  • __bind__ - address:port of the newly created WWW domain.
  • __DocumentRoot__ - WWW domain root directory. This parameter allows to customize log analyzers' configs.
  • __ServerName__ - WWW domain name.
  • __ServerAlias__ - WWW domain's aliases
  • __ServerAdmin__ - administrator email
  • __DirectoryIndex__ - list of index files
  • __SuexecUserGroup__ - username and group for apache 2
  • __Group__ - usergroup for apache 1
  • __User__ - username for apache 1
  • __CustomLog__ - path to access.log
  • __ErrorLog__ - path to error.log


server.templ

  • __server_name__ - WWW domain name.


Examples

Example for directory.templ

We need the following line to be automatically added into the corresponding Directory section of the httpd.conf configuration file when creating a WWW domain.

Deny from all

Add the line into /usr/local/ispmgr/etc/directory.templ

echo "Deny from all" > /usr/local/ispmgr/etc/directory.templ

If you use the __DocumentRoot__ macro, and want the recordDocumentRoot __DocumentRoot__ record to be created as well, you should add into the template, because the lines used in the macros are not added into the configuration files as separate records, except for __ServerName__.

Example for domainzone.templ

We need to edit the SOA records so that ns1.myserver.com is specified as the master name server.

Create the file /usr/local/ispmgr/etc/domainzone.templ with the following contents:

__NAME__. IN SOA ns1.myserver.com. hostmaster.myserver.com. (__serial__ 10800 3600 604800 86400)
Was this helpful? Yes | No
Personal tools