I was trying to find the the Redirect WordPress to a backup server automatically on stackoverflow and google. But I didn't find any good resource, that guides how to implement the backup server if primary server is down.
Example: I have a site https://onesoftwares.net, if the server goes down then I want to implement another backup server that has same setup of wordpress and it goes on as a secondary server.
- 111
- 1
- 7
-
have a look here : https://serverfault.com/questions/452399/nginx-automatic-failover – bgtvfr Oct 01 '19 at 09:22
-
@bgtvfr I am using appache server. – NomanJaved Oct 01 '19 at 09:51
-
heartbeat can also work with apache. However, this solution will work only if the server is up and wordpress is down (mysql broken or apache broken...). What are you really looking for? high availability or cheap and dirty solutions? – bgtvfr Oct 01 '19 at 14:25
-
I have a VPS where I hosted my blog site. I have a good traffic. But VPS usually goes down for half hour or 2 hour in a month. That is causing an issue for site ranking and trust issues on site. Now I want a permanent solution, Suggest both cheap and expensive solution. – NomanJaved Oct 02 '19 at 06:03
-
Switch to a trustworthy provider. – Gerald Schneider Oct 04 '19 at 09:24
-
suggest DMCA free trustworthy providers. I will switch happily. @GeraldSchneider – NomanJaved Oct 04 '19 at 10:46
1 Answers
Cheap solution : buy a second vps and synchronise the blog on it (for example using mysql master/master replication and unison for files). Install heartbeat and haproxy, for example : https://www.howtoforge.com/setting-up-a-high-availability-load-balancer-with-haproxy-heartbeat-on-debian-lenny
If there is any apache or mysql problem on the first server, visitors will be redirected on the second server.
However : this solution does not ensure real high-availability : if the first vps is down (system halted), or if the network of the first vps is down, your website will be unavailable.
Entreprise class solution : Buy or rent two network appliances and two servers in a datacenter. Install wordpress like stated above and you get redudancy if ONE quipement fails.
Very expensive solutions :
- use CDN : any CDN like akamai will do. Akamai will cache the content of your website and it will still be visible in case of outage.
- Use multiples datacenters with DNS GSLB (https://www.a10networks.com/blog/global-server-load-balancing/) : even if an airplane crashes on your datacenter, the website will be down only for 5 minutes.
- 1,224
- 10
- 19