0

I have an ubuntu 14.04 server that we use as our web server (apache). We have a public web site that is built on Drupal, uses a MySQL DB and we also have some files that are uploaded to our site and stored on our file system.

Since I have only one web server now, I am trying to find a solution for redundancy. There are many choices and I am not sure what one is best for me.

I have seen rsyncmirrir, apt-mirror, clustering, etc. Just not sure what one is going to be best for me.

0

2 Answers 2

0

Try NGINX as a load-balancer for two web servers: http://nginx.org/en/docs/http/load_balancing.html

Use rsync over ssh to keep your doc roots in sync. Clustering MySQL will be trickier.

0

You've got a couple options.

Here's my take, and you'll need a total of 4 servers:

  • Start by moving your database off of the server now, and onto a server dedicated to the DB ('DB Server', #1 in this suggestion). Migrate it to its own MySQL instance on a separate server, and configure that server's firewall (and MySQL) to listen for connections ONLY from the two web servers.
  • On the MySQL server, create a user that has access to the databases/tables it needs. Try to avoid giving DBA access to this user, but keep the creds identical for each server, or set up two MySQL DB users for it, one for each server.
  • Keep your first Apache box ('Apache Server One', #2 in this suggestion) now. Add in another. ('Apache Server Two', #3 in this suggestion).
  • Lock down user access on the web servers to be extremely limited (SSH Key Auth Only, No Root Login, etc.).
  • Set up Apache on both of the web servers, and configure the files to be synced (whether you have that as git version controlled or however, make sure those files and configs on Apache are identical, except for DB users if you use different MySQL users with the same access rights for each server).
  • Configure NGINX for load balancing on another server, which will be where the 'website' ends up starting at ('Load Balancer', #4 in this suggestion), and from there it load balances to the Apache servers, transparently passing traffic through.

The only thing is, if you really want "load balancing" because of heavy load, first look at how dynamic your site content is, and if it's not very dynamic and mostly static content (or CMS'd content that doesn't change frequently), consider using caching on your Apache server instead of load balancing...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .