0

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

user5332
  • 141
  • 4

3 Answers3

5

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.

0

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

ptman
  • 28,394
  • 2
  • 30
  • 45
0

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.

Coops
  • 6,055
  • 1
  • 34
  • 54