E
E
Evgeny Ivanov2016-12-13 05:48:50
Domain Name System
Evgeny Ivanov, 2016-12-13 05:48:50

Why doesn't Apache virtualhost (dns?) open one of the two sites by name?

vps Debian 7 Everything is standard - apache+mysql+php. I set up a virtualhost according to this instruction
https://www.digitalocean.com/community/tutorials/a...
In total, I have 2 folders with sites in my www folder. The first opens by name, and the second does not. IP opens everything (i.e. the rights are correct).
When you open the second site, the browser says
Can't access the site. The DNS address of the mysite2.ru server cannot be found.
Maybe it's in the dns settings?
The names and settings for both sites are exactly the same - IN SOA, IN A records.
For example
*.mysite1.ru IN A 10.0.61.77 and *.mysite2.ru IN A 10.0.61.77
What's the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-12-13
@alsopub

"Maybe it's the dns settings?"
Exactly.
Most likely the problem is that you have subdomain addresses registered, but the address is not registered for the domain itself.
The first site should also not be opened by http://mysite1.ruif the dns are configured identically.
Add mysite1.ru IN A 10.0.61.77andmysite2.ru IN A 10.0.61.77

2
24-shops 24-shops, 2016-12-13
@24-shops

I confirm that I have an error in dns named.conf.default-zones

zone "mysite1.ru" {
  type master;
  file "/etc/bind/ru/mysite1.ru.conf";
};
zone "mysite2.ru" {
  type master;
  file "/etc/bind/ru/mysite2.ru.conf";
};

in the file /etc/bind/ru/mysites1.ru.conf
$TTL 3600
@ IN SOA mysite1.ru. dns.mysite1.ru. (
  2016121301
  604800
  86400
  2419200
  604800 )
@ IN NS ns1.mysite1.ru.
ns1 IN A 10.0.61.77
@ IN A 10.0.61.77
* IN A 10.0.61.77

and the second file responsible for the second domain /etc/bind/ru/mysites2.ru.conf
$TTL 3600
@ IN SOA mysite2.ru. dns.mysite2.ru. (
  2016121301
  604800
  86400
  2419200
  604800 )
@ IN NS ns1.mysite2.ru.
ns1 IN A 10.0.61.77
@ IN A 10.0.61.77
* IN A 10.0.61.77

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question