Question

Multiple droplets hosting 1 website

Posted August 15, 2013 4.3k views
Hi guys, I was just wondering if it was possible to host 1 website off of multiple droplets and use load balancing to pick which droplet the user connects to? Thanks in advance, Francis

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

4 answers
Yes, it's possible. You can use a DNS service like Amazon Route 53 that routes the user to the nearest server.
Thanks for your reply, but what I meant was how can you replicate the Apache configuration on both servers to display the same website (so when you update a website it updates across all servers) ?

Thanks again,
Francis
If the servers are in the same location, you can use 1 droplet as a NFS server and mount that on all servers. You can do this even if the servers are not in the same place, but can become a huge problem.
There's also different ways ( like syncing files on update with some custom made scripts - lsyncd is an example )
Also, the sessions between the servers have to use a memcached server
I personally recommend SaltStack. Set up a salt-master server and three salt-minions which are the webservers and use states to replicate configuration.

Install Saltstack: https://salt.readthedocs.org/en/latest/topics/installation/index.html
This should get you started with states: http://docs.saltstack.com/topics/tutorials/states_pt1.html
Submit an Answer