Background
Cpanel from cpanel.net is the most popular, proven and robust web hosting platform out there. For both not technical and slightly technical, it simplifies the job a lot. It even has a free script installer as well as many paid for auto script installers such as softaculous. Other notable features are email, database and file management on top of robust web statistics aggregation. If you are hosting one or two websites in a shared host environment this is what you need absolutely. Most hosting providers, for example, Godaddy, Bluehost to mention but a few won’t charge you extra for it.
But if you’re a small and startup hosting provider it might require a huge investment as well as unnecessary expense. Say you host your websites in the cloud, dedicated and normal VPS servers, you have to spend $20 to $40 per month on Cpanel. If you’re smart and a good researcher you may look out for discount coupons and if you’re lucky enough, you will land on buycpanel.com from which you can get VPS licenses from as low as $13.95. Did I mention setting it up, requires a professional or an experienced person like me for example? Setting up Cpanel requires you to choose the correct operating system usually CentOS and as of writing this article you CentOS7 and above versions are a must, since Cpanel announcement that it will be stopping support for CentOS 6 on all systems by November 30, 2020. If you install FTP, SSH, and exim services you won’t get away with your junior skill. Of course, there’re many individuals and agencies including CPanel support who offer the installation and hardening service at a certain fee.
If you are in a scenario like mine, you would realize going through all the above jargon is time-consuming and expenditure is overkill.
My scenario
I technically manage one of the most read news blog websites in Uganda. These are two websites which run on a single cloud KVM VPS at linode.com. Both websites get around a monthly traffic of 250k. Both websites are four to five years old.
Technically I’m the single person in a number of publishers. For simplistic, the websites are proudly powered by WordPress which is slightly customized with custom fields, themes, and plugins.
My primary role is to manage the server and carry out routine security audits, performance, theme optimization, update WordPress and plugins. We also slightly handle emails on the server. But we don’t want to spoil our sender score or reduce the reputation of the IP of our server.
We’ve had Cpanel on our node for the last two years, despite being in a tight third world economy.
For some months the license was automatically deactivated due to our failure to submit a payment, throughout that duration we couldn’t access Cpanel support, then it became hard to make any code modifications, manage databases and email accounts.
During that time the only way of getting in the server was via ssh but we didn’t know every command, for example, to carry out a slight firewall fix.
Proposal
For regular management of the server, we had to find a solution. Thus we researched about website/web host control panels. We would filter by fees in relation to Cpanel, features, support, and age of first version and latest version.
One of the most interesting ones we came across was CentOs CP which looks so much like Cpanel but we settled for another.
Choosing VestaCP
Procedure of switch
Order a second node from linode.com
One of the sites is about 51GB in files(images contributing the biggest part) and 1GB for MySQL database. As much as I wanted to use a WordPress backup plugin especially duplicator. The PHP execution time and memory limit couldn’t enable the plugin to execute and complete successfully. I also didn’t use the Cpanel backup feature because it was downloading the files locally on my computer which wasn’t what I desired.
What did I do?
I accessed both the older and newer nodes via ssh.
Older node.
Create a backup archive.
$zip backup.zip -r /public_html
The command took some time to finish about 2hours. I would be glad to discover a faster solution because moving systems around is just getting started.
The next command I used was for backing up the database.
$mysqldump -u root -p database_name > /home/user/path/database-file.sql
The dump was blazing fast, motivating me to continue.
Newer node.
Download commands
Navigate to the path where I want to download backup files.
$cd /home/user/web/domain.tld/public_html $wget http://domain-on-older-node.ltd/backup-path/backup.zip $wget http://domain-on-older-node.ltd/backup-path/database-file.sql
$unzip backup.zip
If the files to extract at the root of public_html directory like in my case, I used the move (mv) command to move the files to the right location.
2. Restoring database
$mysql -u database-username -p $use database-name; $source database-file.sql;
Provide the password as the system will prompt you, the restoration of the database took less than two minutes.
Troubleshooting tips
1. I see a blank white screen when I visit the website
2. Unable to upload photos through the media library.
This is caused by a file permission issue. You have to make sure that the website account owns the WordPress installation since by default website installations are owned by root. Use the command below.
$chown -R username:username /home/username/web/website.com/public_html
Note: replace username with the actual username of the account under which website.com belongs. The website path structure in VestaCP is like /home/username/web/website.com/public_html
3. The uploaded file could not be moved to /wp-content/uploads/year/month
This is also a file permission problem on the uploads directory, you should make sure user and group can all write to this directory. Which you have to fix using the command below.
$chmod -R 777 /home/username/web/website.com/public_html/wp-content/uploads
Conclusion
I would have moved the websites in less than 6 hours but because it was my first time doing this, I didn’t have experience of what I experienced during the process. I was playing trial, error and referring to Google.
I believe this is going to help you and I get a lot of local businesses online by offering them a cheaper performant alternative.
Will also get web developers, online without having to cough more than $5USD per month for a robust node.
Curiosity
Does VestaCP work with docker? How can it be set up? How is the performance?
I'm glad to present about "deserving to be there at the top" at the first…
A forEach loop is one of the most optimized JavaScript Higher-Order functions that make it…
In recent years, the biggest number of people I have met are characterized by the…
I promised to share my thoughts in any possible way. In fact, am happy to…
Hey beloved, Once in a while, I develop thoughts in my head, and instead of…
I remember in primary school, I had different interests compared to the ones I have…
View Comments
I am from a non developer background, but i could imagine how much it saved you. I think VestaCP is the next big thing. Just like WordPress today powering up 31% of websites on the web.
This technical guide will not only help technical and experienced persons looking at setting up web hosting platforms but also for non technical ones looking at establishing business in the same field at a very minimal cost.
Am in full support of VestaCP just after learning from you that its totally free and open source. Thank you.
I will share this article with my readers too.
Cheers David.
First of all thank you for reading, taking
the time to comment and sharing. I absolutely feel small companies especially in emerging markets need to get on board.
You can also restore a database with the command below.
`$gunzip