0

i'm making a apache web server with two virtual host, i have a DNS Server caching-only on my other centos 6 minimal VM, the IP Address of my Apache Server is 192.168.1.9, when i try to browse that IP Address(192.168.1.9/index.html) on my test VM Windows XP, it display the content of the "index.html", but when i try to browse with the domain name, "http://domain1.com", "the connection has timed out".. same result when i try with my "domain2.com", it just the when i browse "192.168.1.9/index2.html", it doesn't display the content of my domain2 file..

<VirtualHost *:80>
DocumentRoot /home/demo/public_html/domain1.com/public
ServerName domain1.com
ServerAlias www.domain1.com
ErrorLog /home/demo/public_html/domain1.com/log/error.log
CustomLog /home/demo/public_html/domain1.com/log/access.log common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /home/demo/public_html/domain2.com/public
ServerName domain2.com
ServerAlias www.domain2.com
ErrorLog /home/demo/public_html/domain2.com/log/error.log
CustomLog /home/demo/public_html/domain2.com/log/access.log common
</VirtualHost>

is there something to do with DNS Server Records, Zone File, CNAME?? i don't much knowledge with these stuff, I am new with this kind of stuff.. thanks

Kelvin
  • 3
  • 1

1 Answers1

0

For local (without entry in global DNS) web, use HOSTS file entry to translate domain1.com and domain2.com to 192.168.1.9.

Wapac
  • 652
  • 1
  • 5
  • 16
  • i've tried this many times, but it doesn't work with my situation, do i need to configure my DNS Server, like A Record or CNAME, Zone File..? – Kelvin Jun 23 '15 at 07:11
  • Can you please explain the problems with using HOSTS file in your case? – Wapac Jun 23 '15 at 07:13
  • i try this, 192.168.1.9 domain1.com on HOSTS file, and restart my apache.. and browse the domain1.com, well, it didn't resolve the domain name.. is there something i can do wit my DNS Server, to recognize the domain names? – Kelvin Jun 23 '15 at 07:27
  • Does ping domain1.com works after you change your HOSTS file? There is no need to restart the Apache server after that change. – Wapac Jun 23 '15 at 07:54
  • Destination Net Unreachable. – Kelvin Jun 23 '15 at 08:00
  • So ping using ping domain1.com the domain gets resolved correctly to 192.168.1.9, just the server can not be pinged due to Destination Net Unreachable error? If this is the case then the problem is neither in DNS, not in Apache configuration, but more likely in network settings or firewall. – Wapac Jun 23 '15 at 08:04
  • Yeah, i have a DNS Server Caching-Only, i guess the problem is on my DNS Server Zone File, i'll need to read more of this to fix the problem, thanks @wapac – Kelvin Jun 23 '15 at 23:15
  • Fixed, i just need to add the IP Add and Hostname to my Client /etc/host.. thanks – Kelvin Jun 24 '15 at 06:53