Those of you who know what GridPane, Proxmox and OVH are, will already know what the topic is about, the rest of you will think it’s something geeky (which it may be) and also something of a hosting that burned.
To sum it up, GridPane is today the specialized WordPress panel for high performance servers, something that is not easy to explain without experiencing it. No pretty panels with hundreds of options and color meters, just what is necessary and with the most optimized settings.
Proxmox is an operating system for virtualization, which allows us to create several virtual machines with that physical and large server that we have rented for our services and/or those of our customers.
And OVH is a hosting and internet service provider, which, as well as Google Cloud, Amazon Web Services and many others, used by both individuals and hosting companies to offer their services and sadly known in recent weeks for the fire at one of its Strasbourg data centers (which could have happened to any similar service).
Normally for my clients I usually recommend a customized hosting service according to their needs, in the “more customized” cases I offer them a custom server with GridPane and generally on a VPS, which is usually a Vultr High Frequency Compute machine suitable for the client’s needs. This website, for example, is hosted by Kinsta, one of the hostings that I recommend (I only recommend hostings or services that I use for myself or have tested with my clients),
But for my tests and some of my own services, I use virtual machines on an OVH server with Proxmox and for a new project that I will start soon, the Staging machine for the client will be mounted on this infrastructure.
When I started with the DNG magazine website, I hired a server in USA (ServerPronto), which I configured with DNS server(BIND), mail server, web, database, etc… all services configured by hand and in the same server.
Serious error, single point of failure. Over the years I have learned to separate services as much as possible and select specialized providers for each service, plus the freedom of being able to migrate a single service without having to change everything.
But the truth is that I learned a lot in the process, over time I was automating steps, then I learned Ansible and how to automate the creation of servers from local to dozens or hundreds in the cloud; I even created my own servers. Playbooks special for WordPress (and initially one for PrestaShop when I was still doing projects for that CMS).
With the server for the DNG magazine (initially on FreeBSD, then Ubuntu), I was writing my guides to remember the steps and looking through my hard drive I see that I have the following:
- BASIC STEPS SETTING UP Ubuntu Server 9.10
- BASIC STEPS SETTING UP Ubuntu Server 10.04
- BASIC STEPS SETTING UP Ubuntu Server 12.04 LTS
- Web Server CONFIGURATION (Ubuntu Server 12.04 LTS)
- CONFIGURATION Photo DNG (Ubuntu Server 14.04 LTS Docker)
- DNG Server CONFIGURATION (Ubuntu Server 16.04.02 LTS Open VZ)
All these guides (made in LibreOffice) are between 40 and 70 pages long, for the moment I do not publish them because I would first have to review them in case they have some unpublishable data (keys, etc.), besides being very specific configurations adapted to my needs and also because they may contain some errors and be obsolete.
Right now I still have servers on the old machine that I will have to migrate, the fact is that they are on a Proxmox 3.4. and the new server has installed a Proxmox 6.3, so the time has come to stop creating guides and publish the changes directly on the web, as always to remember in future occasions, but if it can also be of help to someone, so much the better.
After hiring the new server last week with a set of Failover IPs to assign to the virtual machines, I selected as OS a Proxmox 6.3.
Once the OS is installed we can access by SSH with the data sent to us by mail or to the Proxmox web panel with the IP or machine name and port 8006.
First I install an Nginx to act as a reverse proxy and be able to access the Proxmox manager from port 443 (https) or another port at my convenience, in addition to the domain name that I prefer. It is as easy as following the guide below https://pve.proxmox.com/wiki/Web_Interface_Via_Nginx_Proxy so it needs no further explanation, the steps are:
- Install Nginx
- Delete the default website configuration.
- Create the configuration for Proxmox.
- In this configuration we redirect the request to port 80 to the desired port (443 or other).
- We configure the certificate with the default Proxmox certificate, here the ideal is to go one step further and with certbot create a valid certificate for the domain we configure.
- Proxy to the local Proxmox server (https://localhost:8006).
- Check the configuration and restart Nginx.
- Configure the Nginx service to start only after certificates are available.
We already have available the Proxmox interface from our domain and SSL port avoiding having to access from port 8006. Now from web we are going to create a server to use in our WordPress with GridPane.
For GridPane is not valid for any OS or version, it has to be an Ubuntu Server 18.04 LTS, so we download the ISO image of Ubuntu 18.04 and then upload it to be able to use in the installation of our machine.
We create a new virtual machine (create VM), not container which is not valid for GridPane. Once we have selected the disk, memory, processors, etc. that we want for the machine, we will be able to increase its power with more RAM, processors or space.
From the OVH control panel and in the Failover IP that we are going to use for our machine, we select Add a Virtual MAC and put it in the network driver before creating our new machine, or if we have already created it, we modify it and add the MAC with the machine turned off.
We start the machine and the installation process with the ISO image on the machine CD and continue the process from the web console using the noVNC integrated in Proxmox.
Once the installation is finished, we will have to enter the machine and configure the connectivity with the virtual IP to which we have already configured the MAC. We will also need to know the IP of the main server (the one running Proxmox) and with these two IPs we go to our configuration.
All the above process and the configuration of the network card, is perfectly indicated in the following guide https://support.us.ovhcloud.com/hc/en-us/articles/360002394324-How-to-Connect-a-VM-to-the-Internet-Using-Proxmox-VE that has saved me, since I was configuring the machine by means of
/etc/network/interfaces which was the method used until the Ubuntu 16.04 release, is now done by means of Netplan (that’s what happens when you don’t keep up to date like sysadmin and do daily developer)
Remember that the YAML configuration file uses spaces and not tabs, although if you use tabs when you run
sudo netplan apply it will warn you to change to spaces.
Contrary to what it says in the manual, to edit the configuration file (
# sudo vi /etc/netplan/01-netcfg.yaml), I recommend
nano as it is easier to use than
vi. The resulting file will look similar to this one:
# This file describes the network interfaces available on your system # For more information, see netplan(5). network: version: 2 renderer: networkd ethernets: ens18: dhcp4: no dhcp6: no addresses: [192.0.2.1/32] gateway4: 220.127.116.11 nameservers: addresses: [18.104.22.168,22.214.171.124] routes: - to: 126.96.36.199/32 via: 0.0.0.0 scope: link
Where the default card name will be
ens18 but if this is not your case, you can always see its name with
$ ip add as indicated in the guide or also with
$ ip link.
In “addresses“, we will change “192.0.2.1” with the Failover IP to which we previously added the vMAC in the OVH panel.
Where it says “gateway4” and in the “routes” section, we will change “201.0.116” with the first three octets of the IP of the dedicated server (the one running Proxmox) with a final octet of “254“.
In the list of DNS servers I have put Cloudflare’s, which are very fast and the ones I always use, but you can configure Google’s, OpenDNS or the ones you prefer.
Now we can apply the configuration with
$ sudo netplan apply and if we have done everything right, we will have access to the outside with name resolution and from the outside to our server. We can try pinging any domain to see if it resolves correctly.
$ ping -c4 tabernawp.com
We almost have everything available to configure our GridPane, but after the initial steps we need to run some commands on the server as follows root (not with
sudo), so in order to be able to be root, we need to set a password for the root user, for which we run
$ sudo passwd root and enter the desired password for the root user.
Now we can connect via SSH with our user previously configured in Ubuntu and then change to the root user by executing
$ su root
We have everything ready. We go to our GridPane panel and perform a new server provisioning, selecting Custom VPS with the name and Datacenter we want and the IP previously configured.
Then GridPane will tell us the command to run as root on our server (if we run it with sudo, it will not reach the end of the installation) and in about 15 minutes we have a high performance server configured. Then we will create the website(s) already with Nginx, Redis and all the optimized configurations for our great server.
The only problem with setting up a high-performance server for the web site in staging The main thing is that if everything is well configured and works great, our client may notice that his website is slower when we move it to his final website, as it is not as optimized as the server we have prepared for the testing phase. We should advise you of these circumstances.
Remember that in Proxmox we have three firewalls, at the data center level, at the server level and finally at the virtual machine level. By default only the server’s is enabled. Be careful if we activate the one in the data center without changing anything, because we will be left without access to our server, neither via web nor via SSH.
If this happens to you, you have the option of reinstalling the OS with Proxmox from the OVH panel, if you have not yet done any work and do not lose anything, or wait a few minutes. After a few minutes OVH will detect that the server is not responding and will start it with a rescue kernel, sending you the emergency access data.
From there you can SSH into your server and fix the problem in the console, and then restart it with the default kernel.
Finally, I just want to say that I do not recommend you to fight with Proxmox, dedicated servers, virtual machines, configurations, commands, etc., because it is very time consuming and any mistake can ruin all your work.
If you like sysadmin tasks, go ahead, but if you are a developer, remember that experiments are “better with soda” and that the full stack are fine on paper, but optimize server, database, web server, PHP and CMS from backend to frontendsounds great, but in my more than 20 years working in the web, I think I have more than enough fingers on one hand to count the full stack I have met.