So I decided to move my blog from shared hosting so VPS hosting. VPS is getting cheaper everyday with as low as $2 per day makes it a good bargain to host blog in VPS. With VPS, we can choose which software we want to install, and configure it in our own taste.
But definitely, choosing VPS is not for everyone. It is more suitable for advanced user as configuring it involves a great deal of IT skills. Despite of several one-click install available which makes our VPS production ready within few minutes, configuring manually enables us to cramp our VPS and maximize the resource without several overhead and bloatware provided by one-click install. Moreover, I believe it is a good step for us to get to know how to deploy server for production grade.
The Problem with Previous Hosting
Actually I experienced no major issue with my previous hosting. But from recent review, I read a lot of complaints and recommendation to stay away from this host anymore. My previous hosting was shared Windows hosting. I used to experiment with Windows hosting to host ASP.NET application but for most of the time, I am using it only for hosting my blog. Moreover, nowadays there is a technology called ASP.NET Core which can be run on top of Linux machine. Therefore, I have no constraint in using Linux again for deploying my own personal server.
Moving to Linux VPS will be a new experience for me as I will ditch the simplicity of configuring and deploying sites via IIS Management console and Visual Studio. I also have to install and configure on my own via command line. But I think it is a great idea to learn and build your own server from scratch!
Advantage of VPS
We can configure VPS to suit our needs. We can also install software other than web server, such as streaming server, messaging server, etc. This ability is unavailable in basic shared hosting services. You are also not limited by specific platform, such as PHP, which is really common in shared hosting. You can pick your favorite platform and install it.
With VPS, you can also isolate your system from other users. In shared hosting, your data is usually placed in same space as other user. In the event of security breach, either caused by security hole hosting provider configuration or hosted user programs, your data might be at risk too. Badly configured shared hosting space can affect reliability and security.
In VPS, each hosted system is isolated with each other. Security hole in other user’s program will not affect your system’s integrity. Your system is also have its own IP address, therefore zeroing the risk of attack towards a website sharing same address with our website.
In terms of performance, it depends on the hosting providers performance and management. When your provided is doing good, they will not oversell their space, and maintain good balance between user and available resources. But we also have to wary of naughty providers who oversell their spaces and cramp numbers of customer into one single server. This will create major performance issue and affect the reliability and availability of your server. It is good idea to read reviews and make necessary judgement before purchasing your space.
I use CentOS 7 for my server as it is a community-maintained of Red Hat Enterprise Linux (RHEL). From what I understand, CentOS and RHEL shares similar configuration which makes it compatible between each other (e.g. software compiled for RHEL can run out of the box in CentOS). RHEL itself is an enterprise grade Linux OS configured for production-grade server.
So here’s the software I installed so far within my CentOS box:
- NGINX: A fast web server to serve HTTP requests. I pick NGINX over Apache because I believe it gives better performance especially for serving static content. NGINX is easily configurable via its configuration script, and can dispatch request via CGI, FastCGI, or Reverse Proxy out of the box.
- PHP-FPM: A process manager for serving PHP scripts. PHP-FPM is a FastCGI based application which provides better throughput compared to CGI protocol. There is no module or extension available for running PHP with NGINX, unlike Apache’s mod_php. Therefore, PHP script will be executed by different process than the web server.
- MariaDB: As we (might) know the situation with MySQL, I have to admit that I feel more “secure” in the long run with MariaDB than MySQL. MariaDB itself is a fork of MySQL by its original co-founder. MariaDB itself is (almost) binary compatible with MySQL, with many shell commands are symlinked with existing MySQL commands. As WordPress only support MySQL and MariaDB, I cannot use PostgreSQL for the database.
In next post, I will give some tips to configure and set up your VPS. Stay tuned!