0

[CentOS7] my server IP: aaa.bbb.ccc.ddd

Server Root: /var/www/html

I've two virtual hosts:

subdoamin1.domain.tld
Document Root: /var/www/subdomain1.domain.tld/public_html

subdoamin2.domain.tld
Document Root: /var/www/subdomain2.domain.tld/public_html

when I go to the doamin 'subdoamin1.domain.tld' or 'subdoamin2.domain.tld' I can see both the website, it's OK, but, when I go to the IP, it servs me the site from '/var/www/subdomain1.domain.tld/public_html' but, I want '/var/www/html/' be served.

where is the problem?...

Amin
  • 681
  • 4
  • 9
  • 27

1 Answers1

0

Apache web server has a default virtualhost concept. The default virtualhost should appear firstly from all configurations. It show the page if the target virtualhost is uncertain. You need to create the additional virtualhost that has ServerName aaa.bbb.ccc.ddd and DocumentRoot /var/www/html

Daein Park
  • 4,393
  • 2
  • 12
  • 21