0

Here is a problem. I am running on CentOS 7 with Httpd(Apache) installed. After installation default DocumentRoot is /var/www/html. And my site domain is avect.ru. Then I've created a virtual host with the link cp.avect.ru. But when I enter it, it shows content NOT from specified DocumentRoot /var/www/cp, but /var/www/html.

Idk why this happens. NameServers are not working, because they are deprecated. Help please! Here is part of httpd.conf:

<VirtualHost *:80>
    ServerName www.cp.avect.ru
    ServerAlias *.avect.ru
    DocumentRoot /var/www/cp/
    ErrorLog /var/log/cp-error.log
    CustomLog /var/log/cp-requests.log combined
</VirtualHost>
Andrii H.
  • 1,682
  • 3
  • 20
  • 40
  • You must define 2 virtualhosts. One for avect.ru, which points to /var/www/html. Another one for cp.avect.ru, which points to /var/www/cp. And remove the ServerAlias *.avect.ru, this will mix up everything. Here you only show 1 virtualhost, this will not work. – Nic3500 Dec 05 '17 at 22:20
  • Actually before this post I've tried with 2 virtual hosts. That also didn’t work.. – Andrii H. Dec 06 '17 at 06:18

0 Answers0