Virtual Hosts Configuration

Parallels Plesk Panel for Linux uses the Apache web server for websites hosting. Apache itself does not operate with websites; it manages virtual hosts - web resources identified either by an IP address or a host name. When creating a site, Panel adds a new virtual host to Apache so that the site becomes available through the web server. Panel resides on a virtual host too; this host is called the default virtual host.

When you add a site in Panel, you select one of the hosting types to use with it: web page hosting or forwarding. In terms of Apache, you associate the site with a virtual host of one of three configurations (website hosting, standard forwarding, and frame forwarding). To learn the differences between these configurations, see the section Virtual Hosts and Hosting Types.

Sites are linked to virtual hosts, so if you want to add some feature provided by Apache but not available through the Panel GUI, you should change the virtual host settings using Apache configuration templates. Based on these templates, Panel partly re-generates virtual hosts, so you should follow certain rules when modifying the configuration; otherwise, some of your changes might be lost. Next in this chapter, we will discuss virtual hosts in more detail and provide guidelines on how to modify them safely. To learn more on this point, refer to the section Configuring Virtual Hosts.

Panel creates virtual hosts for websites based on virtual host templates. These templates predefine the content that will be included in each new virtual host. Learn how to change virtual host templates in the section Predefining Virtual Hosts for new Sites.

You can get information on access to each virtual host and Apache errors that have occurred on the host from Apache logs. Learn more about log files location and rotation settings in the section Analyzing Access and Errors.

Virtual Host IP Addresses

The term virtual host refers to the practice of running more than one website on a single server or IP address. For example, Apache can manage two websites, example1.com and example2.com, even if they use a single IP address. Each of these sites is hosted on a separate virtual host.

There are two types of virtual host, each with different methods of requests routing:

Parallels Plesk Panel uses the name-based approach. In addition, Panel provides an option to allocate separate IP addresses to customers who do not want to share their IP address with others. To implement this option, there are two types of IP address in Panel:

Resolving Requests to Web Servers

When a client requests a certain domain, Apache parses the requested domain name. Then Apache searches for the virtual host with the requested domain on the IP address specified in the request. If the host exists, Apache sends the requested files from this host to the client.

If the requested virtual host is not found, Panel uses the following entities to resolve the request:

  1. Default domain. This can be created for a specific IP address. If a request to this IP address contains the name of a non-existent domain, Panel redirects this request to the default domain.
  2. Default virtual host. This accepts all requests to server IP addresses that could not be directed to any default domain.

Hosting Types

Depending on how you intend to use a domain, for example, to host a site or to forward HTTP requests to another domain, you can choose from three hosting types that define the structure of a virtual host created for this domain. The hosting types are the following:

Learn how to change a domain's hosting type in the section Changing Hosting Type.

In this chapter:

Virtual Hosts and Hosting Types

Changing Virtual Hosts Settings Using Apache Configuration Templates

Predefining Virtual Hosts for New Sites

Applying Custom PHP Settings on Domains with PHP in CGI/FastCGI Mode

Predefining Values for Customizable PHP Parameters

Analyzing Access and Errors

Please send us your feedback on this help page.