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

  • from your client try ping domain1.com and domain2.com – c4f4t0r Jun 23 '15 at 6:57
  • could not find host domain1.com/domain2.com, i there something to do with my DNS Server Record? – Kelvin Jun 23 '15 at 7:08
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.

  • 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 7:11
  • Can you please explain the problems with using HOSTS file in your case? – Wapac Jun 23 '15 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? – Kelvin Jun 23 '15 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. – Wapac Jun 23 '15 at 7:54
  • Destination Net Unreachable. – Kelvin Jun 23 '15 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.