I am not going to get into the exact details on how to do this, but here is how we load balance shared hosting with webpanel for free:
1. Decide on how you will load balance with Haproxy. Round robin, tcp only etc. I also suggest using something with a gui such as pfsense. Pfsense gives me both an internal server farm ( internal ip's) and it has a haproxy addon. If you are using the application layer, layer 7, http, it is easiest to use something with haproxy built in because SSL's become a nightmare on raw haproxy and offloading SSL's on the load balancer is one of favorite parts of haproxy.
2. Install webpanel on all the servers in your server farm. If you virtualize, make a template, especially because of the custom mysql in the next step. We went with proxmox and virtualized it. Use the internal IP's pfsense assigns. Make sure NAT etc is configured in webpanel. Try to make sure php extensions etc match on all servers.
3. Configure webpanel to use a remote database. We have 1 remote database load balanced between 3 others that are syncing real time. You can get super creative here.
4. Use rysnc etc. We use SyncThing on the /home directory. *do not sync the databases, this will result in a nightmare.
5. When you create a new user account, create it on all webpanel servers. I am sure there is way to sync accounts but I am not feeling risky this week.
6. A user has no idea what IP address their website is on because they only know the public IP of the loadbalancer and they do not have access to internal IP's. So the customer logs into a random server, uploads their web-files, which is synced to the other servers in the farm and then they create a database, which is remote and managed differently.
I do not host email so I did not include that.
I wanted to give a big thank you to cwp control panel. Without them this would not be possible. cPanel does not support NAT and cPanel costs a fortune, to load balance cpanel might cost thousands a month in licenses. I did order cwp pro and will continue to support cwp the best I can.
If anyone has questions, I will be more then happy to answer them
Jay
SharkBackup