Hello everyone, sorry for the delay.
So come on, you will need 3 servers, being;
2x for Google Drive Script.
1x for the load balancer. (may host more sites)
The 2 servers of the Google Drive Script must have dynamic IP and a static DNS, with a minimum of 1 GB of RAM. The load-balancer server also needs a minimum of 1gb of ram, but it needs a static IP. (Or never restart)
0. Create the virtual machine with Ubuntu 18.04
1. We will release the doors, being;
- 443 (HTTPS)
- 80 (HTTP)
- 20,21,990,40000-50000 (FTP)
- 3306 (MySQL Remote)
2. To have a static DNS for a dynamic IP, it is only possible on platforms like Azure (or a more "manual" mode you will see later), as an example, I am using Azure.
3. Repeat the same process on the other servers
4. Create a DNS Zone and point the domain to the server ip that will be used for the load balancer.
5. Access the VM via SSH and you will download the script I created, it will configure everything for you, execute the commands;
$ sudo su
$ git clone
https://github.com/Zonimi/servidor
$ cd servidor
$ chmod -x server.sh
$ sh server.sh
Detail for Brazilians: No lugar de server.sh use servidor.sh
6. The script will ask for your username, and for a domain, I will use player.zonimi.me (don't put http://...).
7. Everything that is asked you answer with Y or N, there is no importance, just attention on the phpmyadmin screen, with Apache select press SPACE, TAB and ENTER, Apache has to be like this [*], see below;
8. When everything is ready, it will appear on this screen, save all data somewhere and repeat the process on 3 servers, using the same domain for everyone.
Note: I haven't created ./domain yet
9. After repeating step 5 on all 3 servers, go to the server you are going to do the load balancer and use;
$ chmod -x balancer.sh
$ sh balancer.sh
Detail for Brazilians: No lugar de balancer.sh use balanceador.sh
10. Enter the same domain that you used on the other servers
11. Enter the DNS of server 01.
12. Enter the DNS of server 02.
13. Access
http://checkip.dyndns.org/ and get your IP
If all goes well you will receive this screen
14. Go to yourdomain.com/balancer-manager and check, don't change anything.
15. By default, my script installs php 7.4, but don't worry, it also installs 7.0, you just need to change it, go to the Google Drive Script folder and open the .htaccess file and add the code below;
<FilesMatch \.php>
SetHandler "proxy:unix:/var/run/php/php7.0-fpm.sock|fcgi://localhost/"
</FilesMatch>
Here it is, there are many tutorials that teach you how to automatically restart your server on Azure, GCloud etc. just search.
About the database, we will use the server that load-balancer is installed on, but for that you will have to wait for me to create the script to add new domains.
Now if you do not use Azure or any similar platform, you will need to have the servers with dynamic IP, and you will have to make the change manually every time you restart the machine, to change the IP / DNS of the servers use the command;
$ nano /etc/apache2/sites-available/your-domain.conf
You can see the perfect operation by visiting
https://www.player.zonimi.me/ and updating the page
Some details;
- I will add the script to create new domains soon, but if you need urgently send me a PM.
- My script installs PHP with FPM/FastCGI, that is, you will notice that it is faster.
- Essential extensions like Ioncube are already installed
- If any server stops/restarts/error, it will only use the server that is working, so restart one at a time xD
- It is also installing SSL on the domain
If anyone wants, I can host your script for 10 usd/month (paying the 3 servers is a little more expensive), if more people are interested, the price may drop..
And remembering that, I don't speak English, I hope you understand xD