Global virtual hosts on Windows network?


Recommended Posts

I have setup a CentOS web server within my works network as we previously hosted a few web pages on IIS which is rubbish.

 

I've created a DNS record on the server (Win Server 2012):

 

websvr.domain.local => 10.83.112.14 

 

which works great across the entire network... It points to the DocumentRoot on the server. However, I have split off the different sites/apps we run into named virtual host containers. In the real world I would either setup a domain name to this or edit my local hosts file to point some-name.domain.local to the IP address.

 

Is it possible to do something like this server wide, allowing to make the change on the server so that everyone on the network can access it?

Link to comment
Share on other sites

yeah just create new dns records that point to your virtual host names.  So if you created say virtual host that is something.domain.local then create a A record that points something.domain.local to whatever IP your hosting that site off of.

Link to comment
Share on other sites

yeah just create new dns records that point to your virtual host names.  So if you created say virtual host that is something.domain.local then create a A record that points something.domain.local to whatever IP your hosting that site off of.

 

Thats what i thought.

 

1st DNS record: websvr.domain.local => 10.83.112.14

 

in the httpd.conf on Apache(CentOS):

<VirtualHost *:80>
        DocumentRoot /var/www/html
        ServerName websvr.domain.local
        ServerAlias websvr.domain
</VirtualHost>

2nd DNS record: intranet.domain.local => 10.83.112.14 

<VirtualHost *:80>
        DocumentRoot /home/intranet/public_html
        ServerName intranet.domain.local
        ServerAlias intranet.domain
</VirtualHost>

Navigating to websvr.domain.local serves the pages in /var/www/html/ and navigating to intranet.domain.local serves the pages in /var/www/html/ but it should serve /home/intranet/public_html

 

Would it take a while to resolve? the 1st DNS record was instant.

Link to comment
Share on other sites

try pinging the second dns entry and see if you get a response.  if not do a ipconfig /flushdns and try again.  Also check to see what dns server is your primary dns server in your ip properties and then go to that dns server and see if the entry replicated to that server yet.

Link to comment
Share on other sites

try pinging the second dns entry and see if you get a response.  if not do a ipconfig /flushdns and try again.  Also check to see what dns server is your primary dns server in your ip properties and then go to that dns server and see if the entry replicated to that server yet.

 

I can't even ping the 1st entry, it does a timeout, even the IP address... I can access it through the browser though :-/

Link to comment
Share on other sites

don't worry if it pings, which I would allow for troubleshooting..  But does it resolve, does ping return the right IP address even if it times out.. Do a nslookup, use dig, etc..

 

Post your full config if your saying when you go to the 2nd fqdn you get the first - this would point to something in your config not right.

Link to comment
Share on other sites

don't worry if it pings, which I would allow for troubleshooting..  But does it resolve, does ping return the right IP address even if it times out.. Do a nslookup, use dig, etc..

 

Post your full config if your saying when you go to the 2nd fqdn you get the first - this would point to something in your config not right.

 

Yes it returns the correct IP.. config for what, sorry?

Link to comment
Share on other sites

by now the dns entries should have replicated across your servers so you should be fine with dns.  If you are still having an issue the configs on the web server are not correct.

Link to comment
Share on other sites

lets see your full apache config.  I would guess you have something that is over riding your virtual -- and is just using you default.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.