I'm currently working on a Systems Integration project where I'm hosting an Apache server on an Ubuntu virtual machine. I need to set up Apache on 2-3 of my teammates' VMs so that when I turn off my VM or laptop, their Apache services will keep our website running. We're using Tailscale VPN to connect our services. My confusion lies in the fact that right now, our website is accessible via the IP Tailscale has assigned to my VM. Once I install Apache on the other VMs and pull my code from GitHub, these copies will have different IP addresses. How can I make sure that when I turn off my VM, the website still runs smoothly without requiring access to the IP of the other VM nodes?
3 Answers
Would I have to install NGINX on each VM that runs an Apache node? Also, just to clarify, the VMs are solely on my teammates’ laptops, while I have the primary Apache node and they have the backup nodes.
Check out the Tailscale DNS documentation; you can set up multiple A records for your domain name. Just keep in mind that if the resolver picks an A record that's offline, it won’t work, so balancing is key.
You might want to set up a load balancer in front of all your servers, which could be another Apache instance or use software like NGINX, Caddy, or HAProxy. You'll probably need some shared storage unless you’re okay with each code version differing until a Git push and pull. Are these VMs just on your teammates’ workstations? If possible, consider spinning up a VPS in the cloud for around $5 a month to handle everything, including the load balancing.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures