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

1
  • This is probably more relevant on ServerFault, seems like an Apache question. Commented Feb 11, 2011 at 8:23

3 Answers 3

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.

1
  • 1
    +1 That's "BGP Anycast"; otherwise correct. Commented Feb 11, 2011 at 13:23
0

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

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.

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.