Couple of questions about server configuration.

May 29, 2017 173 views
DigitalOcean Ubuntu

Hello,

I have a server set up as a web server here with Digital Ocean. I am looking to try to find out how to associate my domain with many servers and I am trying to figure out how to expand that web server to other cities and countries.

The server seems to be set up now for New York (or out of New York). I am guessing that for the US, I would not have to do anything extra. Can anyone confirm that is correct? What about for other countries?

I would be very grateful if someone could link me some documentation on how to do these type of things.

2 Answers

@deusMach89

How you'd go about setup depends on what you're wanting to do.

Are you wanting to accept a request and send the visitor to the closest web server -- i.e. someone makes a request from Tennessee (in the US) and they'd get served by a server in New York, while if someone made a request in Italy, they'd get served by a server in Amsterdam?

That's just a basic example meant to gauge what you're trying to accomplish.

If that's the case, then you'd be looking in to a GeoIP setup. Essentially, you'd setup a proxy server using NGINX (easiest to setup, IMO) which would accept the incoming request and then, based on specific rule sets, it'd proxy the request to a server defined by said rules.

For that, you'd might want to check out:

https://www.digitalocean.com/community/tutorials/how-to-use-nginx-as-a-global-traffic-director-on-debian-or-ubuntu

...

If I completely missed it, please let me know what you're wanting to do in more detail :-).

by Alex Soban
In this guide, we'll configure Nginx to detect and redirect customers to a subdomain that points to a more geographically appropriate server.

Thank you for the reply jtittle!

I think that is what I want. Are you able to this with only one server? I only have one at the moment.

  • @deusMach89

    If you need requests to be served by web servers in multiple locations, no. You'd need to set up Droplets in all areas you want to proxy requests to from the main server.

    For example (a very basic one), you'd setup a single Droplet using the provided guide. It would handle incoming requests and proxy them to servers in other locations based on the incoming visitor location.

    So if you want to handle requests across the US, you'd probably want at least one Droplet in the San Francisco data center and another in New York. If you want to expand beyond that and keep serving from the closest location to the visitor, you'd need to continue to build out based on where your visitors are coming from.

    You may end up with as many as 9x Droplets to handle the requests (one main that functions as the proxy, the other 8 would be 1 Droplet in each Data Center DigitalOcean offers). That could also be as many as 13x Droplets (if you hit the same location multiple times).

    That said, you'd need to find a way to manage storage as well, otherwise you're going to be replicating your data to numerous servers, so you'd probably be adding a storage cluster to the mix (another 2-3+ Droplets) and mounting it to each Droplet. For that you'd use something like GlusterFS or one of many other network file systems.

    It can be complex, it just really depends on what you actually need.

    • @jtittle

      Thanks for replying, I understand now.

      I am really just getting into the concept stage of what I want to be able to do with this.

      You have given me some great information to get started with.

      Thank you very much!

Have another answer? Share your knowledge.