I have two servers, both with self domain 1st www.myexample1.com 2nd www.myexample2.com

and now I would like to setup CDN of www.myexample1.com to www.myexample2.com

but I dont know how setup DNS or Apache that, so both servers served files for www.myexample1.com request

... I don't need solve databases, sessions or someting else... but I need know, how to do that both server will available as www.myexample1.com

link|improve this question
This is probably more relevant on ServerFault, seems like an Apache question. – aendrew Feb 11 '11 at 8:23
feedback

migrated from webmasters.stackexchange.com Feb 11 '11 at 12:49

This question came from our site for pro webmasters.

3 Answers

You cannot build a CDN with two servers.

A real Content Delivery Network (CDN) has servers on several continents, and routes the end users to a server near him by means of TCP/IP Anycast, geo-aware DNS, HTTP redirects and HTTP proxying, or more likely combinations thereof.

Your question is vague to the point of being un-answerable. If you just want to have both servers serve files for www.myexample1.com without any high-availability, you could use DNS Round Robin for www.myexample1.com, and set up your second Apache to also answer requests for this hostname via a name-based virtual host.

link|improve this answer
1  
+1 That's "BGP Anycast"; otherwise correct. – Chris S Feb 11 '11 at 13:23
feedback

You can do DNS round-robin "load balancing". But for a simple CDN solution check out http://code.google.com/p/cirruxcache/

link|improve this answer
feedback

That's quite a big question your asking, and not an easy one if your not familiar with DNS or Apache, but first can I ask what you're looking to achieve by using a CDN? Do you have a current issue you're working around by investigating a CDN?

It's not what I would call a CDN, but the quickest way to achieve want you have described is to have a caching proxy (squid to name a common one) , which you point domain1 to. Then the proxy goes off to domain2 when it needs content it doesn't have in the cache. If a visitor hits the proxy and it already has the file they are asking for in cache, it will be served from there rather than domain2.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown