Top-priority domain

From ISPWiki
Jump to: navigation, search

Introduction

Web-servers can process multiple web-domains on one IP address. Apache uses VirtualHost, Nginx - several server sections (in the configuration file) having different names, but assigned to the same IP addresses. If the web-server's IP address receives a request containing the name of the web-domain that is not processed by that web-server, Apache and Nginx defines a default web-domain, and process the request based on that web-domain's settings.

Defining a default web-domain

Apache

If virtual hosts are not specified in the configuration file, DefaultVirtualHost configured by the control panel when setting up Apache, is selected as a default web-domain. Otherwise, if web-domains are created in the control panel, and virtual hosts are specified in the configuration file, the first virtual host in the configuration file will be considered a default domain. If web-domain's configuration files are located in different files and included into the main configuration file by the Include directive, those files are uploaded by the web-server in the alphabetical order (for Cyrillic domains punycode domain names are used).

Nginx

When setting up Nginx the control panel in the main configuration file configure the server section that processes requests when other server sections are not present (no web-domains are created in the control panel). When the control panel adds web-domains, their configurations are specified into separate files and are uploaded by the web-server in the alphabetical order (for Cyrillic domains punycode domain names are used). The last server section uploaded will be considered a default web-domain.

Top-priority web-domain

Special directives are used in Apache and Nginx to define a default web-domain. You can choose a default web-domain in the control panel by selecting the check box "Priority" in the www-domain edit form.

Selecting the Priority check box will make the web-domain process requests to IP addresses assigned to that web-domain, which hostname and server IP addresses do not match any web-domain specified in the configuration file. If another top-priority web-domain was selected earlier, and at least one IP address used by the old and new web-domain matches, the "Priority" check box for that web-domain (the one previously considered top-priority) will be cleared.

Web-service functionality

Services configured by the control panel (phpMyAdmin, phpPgAdmin, RoundCube, etc.) require PHP. To ensure their smooth operation and to be able to access them at URL such as http://ip address/phpmyadmin PHP handler must be on in the web-domain's parameters.