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

2
  • from your client try ping domain1.com and domain2.com Commented Jun 23, 2015 at 6:57
  • could not find host domain1.com/domain2.com, i there something to do with my DNS Server Record? Commented Jun 23, 2015 at 7:08

1 Answer 1

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.

8
  • 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..? Commented Jun 23, 2015 at 7:11
  • Can you please explain the problems with using HOSTS file in your case? Commented Jun 23, 2015 at 7: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? Commented Jun 23, 2015 at 7:27
  • Does ping domain1.com works after you change your HOSTS file? There is no need to restart the Apache server after that change. Commented Jun 23, 2015 at 7:54
  • Destination Net Unreachable. Commented Jun 23, 2015 at 8:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.