A Virtual Private Server is the next step above shared web hosting for any website. If a website on a shared host is running slowly due to high volume traffic, or is having issues with its hosting provider due to maxing out limits such as bandwidth or disk space, then a VPS is a very good option to consider. This guide walks you through the details on how to launch your forum on a VPS server. The assumption which I am making is that you are using a web host which uses a cPanel control panel. If you are not, the process is a bit more difficult, and beyond the scope of this article. However, most web hosts do use cPanel, so this tutorial will apply to most of the readers of this blog.
Part 1: Evaluate
The first question which you must ask yourself before moving to a VPS is this: is it a good idea? A VPS server is not cheap. Leasing one can add up to about 40 dollars per month. However, if you have multiple sites, this is a very good idea, because you get full control over everything, and you only have one bill to pay. Finally, you do not require much technical expertise to get everything running. Here is an approximation of how much this may cost you.
Web Hosting: $20.00 /month (From DigitalOcean)
cPanel/WHM License: $20.00 /month
Total: $40.00 /month.
This gets you 2GB of RAM (which is enough), 40GB of disk space (30 GB in practical terms, because the VPS has overhead which takes up some of the disk space), and 3 whopping terabytes of bandwidth. There are other providers, but most of them have similar pricing.
You can decrease this bill in two ways. First, you can buy a year-long cPanel/WHM license, which costs $16 per month, but you have to pay upfront. Second, you can buy a cheaper VPS instance, such as the DigitalOcean 1GB instance for $10. That makes the bill $26 per month. However, I have not tried the DigitalOcean 1GB instance for cPanel. In theory it will work, but it may not have enough RAM to work well enough to run cPanel/WHM at full performance.
Part 2: Create the VPS
I am going to provide instructions for this step in the form of a step-by-step procedure. Here are the instructions.
1. Visit the following URL and create an account: https://cloud.digitalocean.com/registrations/new
2. Enter your credit card as billing information.
3. Click the “Create Droplet” button on the DigitalOcean control panel.
4. Select the $20 or $10 plan. Your choice. I recommend $20.
5. Select the region for your VPS. This doesn’t really matter. Whichever one is closest to your member base, or yourself, is best.
6. If you want, check “Enable Backups,” but you will be charged extra.
7. Under “Select Image” choose CentOS, and then version 6.5 x64. DO NOT choose a more recent version of the OS. It will not work if you do.
8. Do not add an SSH key, unless you know how to. That is beyond the scope of this tutorial.
9. Click “Create Droplet” and wait a little while.
After you finish step 9, you are done with this part of the tutorial! Next, you will need to install the VPS.
Part 3: Install the VPS
1. Go to the following URL: https://cloud.digitalocean.com/droplets
2. Under “IP Address,” find the droplet you just created, and copy the IP to your clipboard. For example, let’s say your IP address is 127.0.0.1.
3. If window machines (see step 4 for Mac or Linux):
- Download PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- Run putty.exe, which you downloaded in the previous bullet point.
- Paste in the IP address from step 2 into “Host name (or IP Address)”
- Click “Open,” then “Yes.”
- When a command prompt appears and asks “Log in as” type “root”
- Wait for a few moments. It will then ask for a password. Enter whatever password you entered when creating the instance.
4. On a Mac or Linux machine (alternative to step 3):
- Open up the terminal. On a linux machine, you should know how to do this. On a mac, enter the Launchpad, then type “Terminal,” and click the only option that pops up.
- Into the terminal, type “ssh firstname.lastname@example.org”. Make sure to substitute whatever your new VPS server’s IP address is instead of 127.0.0.1.
- Wait for a moment, then type in “yes” when it asks you to verify the fingerprint. Don’t worry about checking it.
- Type in the password you entered when creating the VPS in the previous part of this tutorial.
- You are now logged in!
5. type in: yum install wget
6. Wait for a moment. You may have to type in “Y” to accept the installation.
7. Type in: wget http://httpupdate.cpanel.net/latest
8. Type in: chmod +x ./latest
9. Type in: ./latest
10. Wait for about thirty minutes. Do not close the connection.
11. You are now done! Visit the following URL to install WHM via their GUI: http://127.0.0.1/whm .
12. The default options which WHM provides will all work. For nameservers, enter ns1.yourdomain.com, and ns2.yourdomain.com.
Now your VPS is set up! It’s time to transfer your site over to it!
Part 4: Transfer your Site
The following steps should be done fairly quickly, and in the dead of night, while your members are not online, and your board is set to “offline.” If you don’t do that, then content posted while you are going through the steps will be lost.
1. On your old host, go into cPanel, then Backups -> Download a Full Website Backup -> Generate Backup
2. Wait for the backup to be created, then click the link which appears under “Download a Full Website Backup” to download it to your machine. This may take a while.
3. On your new VPS server, log in to WHM by going to http://127.0.0.1/whm (where 127.0.0.1 is the server’s IP address).
4. On the left sidebar, type into the search bar “backup” then select “Restore a Full Backup/cpmove File” from the left sidebar.
5. Scroll down to “Settings” and select “Restore with File.” Select the file you just downloaded from your other server.
6. Do not change the other default options. Click “Restore,” wait for a long while for your browser to upload the file, then for it to be updated.
7. In the search bar mentioned in step 4, type in “basic.”
8. Select “Basic cPanel and WHM Settings.”
9. Scroll down to the bottom. For each “Nameserver ___” field that isn’t empty, click “Add an A entry for this nameserver.”
10. Go to your DNS control panel provided to your by your domain registrar (Godaddy, etc).
11. Simple solution: Set your nameservers to the DNS servers provided by your registrar (they should have an option for that. If you never changed the nameservers, then this is already the case). Add the following A records:
- yourdomain.com -> 127.0.0.1
- *.yourdomain.com -> 127.0.0.1
For some registrars, you should enter @ instead of yourdomain.com, and * instead of *.yourdomain.com.
Wait for a few hours for the change to propagate.
12. More complex solution: Add glue records for “ns1.yourdomain.com” and “ns2.yourdomain.com” which point towards you VPS’ IP. Then, set your nameservers to ns1.yourdomain.com and ns2.yourdomain.com. If you don’t know how to do this, your registrar’s support department will. Wait a while your your DNS propegates (will take several hours).
13. While DNS is propagating, check the status by typing your domain name into http://www.intodns.com/ . If it pops up any red errors, then fix them (or contact your registrar’s support department). Don’t worry about yellow errors.
14. Make sure to switch your board back to “online.”
This tutorial explained how to convert your forum which is now hosting on a cPanel web host to a VPS. We hope you found it useful!