Dedicated to VPS Migration

If you’re reading this, then my blog has successfully been migrated to a different server!

I decided that it didn’t make much sense to have my old dedicated server any more, now that I’ve got a VPS node – so I span up a Debian Instance, and setup nginx, mysql and php-fcgi, and started migrating my sites over. So far, it’s been a great experience – there have been no issues, and I’m pretty sure that the site is much much faster. Just try out the search function!

I’m also hosting the previously mentioned VPS wiki on this machine, and have plenty of resources left to host several more dynamic sites.

I hope to do a quick writeup for the VPS wiki in the near future.

GNUPanel on Debian Squeeze

I was recently playing around with the “GNUPanel” Hosting control panel software. While trying to install the dependencies (with the install-dep.sh file), I encountered the error:

Debian version not supported

Even though the GNUPanel site seemed to say that Debian Squeeze was supported.

A quick look at the install-dep.sh file showed that it relied on the mawk unix utility.

By running apt-get install mawk, we can solve this problem and continue with the installation.


UPDATE:

I’ve now had a chance to play around with GNUPanel a bit more, and unfortunately, I don’t think it’s fully up to scratch. The installation process was pretty clunky – the automated installed script forced me to manually confirm the installation of at least 10 groups of packages. Once the software was installed, I had to guess at the username – and the web interface was also pretty…. “ropey”. These are mainly minor issues, and I’m sure that with some TLC, the project can progress, and become much more useable.

VPS Wiki

I have recently started work on what is currently called “VPS Wiki”.

The aim of the Wiki is to provide a centralised location for information about using Linux, performing general sysadmin duties, as well as some programming basics. I think the site will naturally change in time – It might lean more strongly towards a particular topic. If that happens, then I will rename the site – I thought “VPS Wiki” was a good starting point, especially given my recent venture.

Some people might think “What’s the point in this – can’t people just google for the answer?”. However, Because technology is rapidly changing, I find that it can be difficult to find relevant, up-to-date solutions to problems that I encounter. I think having a central database of of useful content could be very handy.

I’d really appreciate any contributions towards the wiki – at the moment, you need an account to edit/create pages. You can check the Wiki out here.

Getting into VPS Hosting…

So, I have taken things a step further. I started off being interested in buying VPS machines – I then turned to low end Dedicated Servers, and now, I’m dabbling in hosting my own VPS machines.

To start off with, I am doing this not for profit. I will not be offering any formal support for my customers, and have negotiated a deal with RapidSwitch, who are providing me with a discount (because I’m not making any money from it). I will be offering OpenVZ VM’s to people on my University course for £5.00/m, with the following spec: 18GB hard disk space, 400MB Ram, 128MB VSwap, and 750GB Bandwidth.

I’ve chosen to use the OpenVZ Web Panel control panel software, as it is easy to use and free.

If this is a successful endeavor, then I may go on to provide commercial VPS’s to customers. Who knows!

You can probably expect some  OpenVZ/CentOS based posts in the not too distant future…

 

UPDATE:

I had to go with SolusVM, due to OWP’s lack of bandwidth tracking. This meant increasing the price by £0.50 to £5.50/m – however, I think the users are probably getting a slightly better experience with the commercial control panel.

Choosing a low cost VPS

I often like to try out different VPS providers, as listed on http://lowendbox.com/. There are normally 2-3 offers posted there every day, so it can be a difficult to know who to go for. Here is what I look out for:

Cost
Obviously, on a website like LowEndBox, you are unlikely to get anything which is expensive – but it’s relative, of course.  Some offers are much better value than others – although the value is normally judged on the below criteria. You should also consider how they bill you – is it monthly, quarterly or do you have to pay for the whole year in advanced? If it’s latter, then you should ask yourself if the host is reputable – it’s no good paying for a years worth of hosting if they shut up shop after two months.

Location, Location, Location
Location is one of the most important factors for me, as it is one of the determining steps in the latency between your network, and the VPS’s network. Typically, the nearer the VPS to you, the lower the latency (or ping) between you and it. This is particularly important if you are running something game server, although it can be noticed with things like web page load times, too.

RAM
This is also very important – the amount of RAM your VPS has will determine how many programs/servers/daemons you can run concurrently. If you are serving static pages, then you wont need much ram – but once you start delving into mySQL, Rails and other memory-intensive applications, you will need more and more RAM for your VPS to keep running smoothly.

It should be noted that OpenVZ and Xen manage memory differently. OpenVZ has “guaranteed” memory, and “burstable” memory. The guaranteed memory will ALWAYS be available to you, no matter the time of day, or how many other people are using the server at the same time. Burstable memory, however, is not always available and should not really be relied upon, especially if you plan on using it for long periods of time. It is the memory which is not currently in use by other VM’s, which you can use for a small amount of time – it is especially useful for things like compiling software, or even just updating software.

Xen, however, has a more “traditional” type of memory management. You have RAM and Swap Space, and they act pretty much as normal. The RAM is guaranteed, and the swap space is a file on the hard drive which can be used as RAM. It is no where near as fast as RAM, but some higher-end hosts use SSD’s for your swap space… although I have no experience with such luxuries!

With Xen HVM, you are allocated a certain amount of memory, and cannot exceed it. However, the hard drive can be partitioned, allowing you to create swap partitions.

CPU
The CPU that your VPS Host uses in their nodes (the physical machine that is hosting your VPS) is pretty important, too. Some of the sneakier lower end hosts use desktop-grade hardware. While this is not AUTOMATICALLY an awful thing, some people find it more re-assuring when Opterons or Xeons are used in place of the popular Q8200 or Q6600. While hardware failure is not your responsibility, downtime can be very frustrating – and depending on the components used, you might get a performance hit if your host uses consumer-grade components. Some hosts limit you to a certain number of Processor Cores, or limit you to a particular clock speed (Host Rail springs to mind) – this should be checked.

Hard Drive
The amount of disk space you need obviously depends on what you are using the VPS for – an image hosting website would use more than an IRC bouncer… So there is not much to be said on that front. One thing that should be watched out for is the type of disk they use. SCSI drives are typically much faster than SATA drives, but they typically hold much less and are more expensive. It is no good having a SCSI array if there are 40 users on the system, all of whom are using BitTorrent – you may as well be using a 1.44″ floppy drive as your hard disk. To check the average write speed of a host, have a look at this Low End Talk thread – while most hosts operate multiple nodes, it should give you a rough idea of what to expect.

Network
Following on from my second point about location, latency is important. Most good web hosts will provide you with an IP which you can ping to determine the latency between the two networks, and will also have a speed test file  (typically a 10mb/100mb/1gb) which you can download to see what kind of throughput the VPS is capable of. You should also keep your eyes open for the amount of bandwidth you are allowed – some hosts operate 100mb/s lines, with xGB’s bandwidth allowance – others cap your speed at 10mb/s or so, but don’t count the amount of traffic that you transfer. It’s your choice when it comes to this – I personally prefer a fast connection with a limit (especially if they dont have bandwidth over-usage charges, and simply cut you off for the rest of the month), but others may prefer a limited speed with no measured transfer limit.

You should remember that if you plan on using the VPS as an OpenVPN server, then the amount of bandwidth you require will be roughly twice the amount that your computer will download – OpenVPN has to both download and upload, doubling the traffic.

Operating System Range/Control Panel
This is fairly obvious – you should consider the range of operating systems that the host has on offer. Many hosts are willing to make other OS’s available to you, but it’s not a given right. You should check their OS list, and if you dont see what you want, then you should ask them.

There are a few VPS control panels around – the most popular is SolusVM. It’s a personal preference, but I like SolusVM (there is even an iPhone App that will let you reboot/shutdown your VPS while you’re out and about… not that I have ever needed too!). Some hosts let you upload your ISO’s when you are using Xen HVM – ThrustVPS springs to mind on that one. You should probably check that out with the host you are looking at – it’s not a terribly common feature.

TOS
You should check the Terms of Service of your potential web host before you sign up to get hosting from them.Most hosts don’t like you using BitTorrent, and state this in their terms of service. Some hosts disallow anything to do with IRC – others dont like you using lots of CPU time, so it’s important that you check.

Support
Last but not least is support. You should check to see if your potential host has got a live chat service – if so, how often are they online? ThrustVPS has a good live chat service, and where almost always online when I needed them. BuyVM has got an IRC Channel, which is useful, as other users often hang out there – you can ask if it’s just you experiencing an issue, or if it’s a server-wide problem. Not having live chat/IRC support isn’t necessarily a bad thing. As long as the staff are knowledgeable and friendly, and have a quick response time, then you should be OK. A quick way to test this would be to submit a ticket asking something Semi-technical – for instance, “Do you support TUN/TAP?”, or “Can I use a custom kernel”. Their response will help you gauge how they will respond in the future.

OpenVPN Internet Routing on OpenVZ VPS

As far as I know, the iptables masquerade module is not compatible with OpenVZ. As a result, many guides online on how to route all traffic through an OpenVPN Tunnel do not work with OpenVZ, as they depend on the masquerade module of iptables. This IPTables rule:

iptables -t nat -A POSTROUTING -o venet0 -j SNAT --to-source XXX.XXX.XXX.XXX

where XXX.XXX.XXX.XXX is your VPS’s EXTERNAL IP ADDRESS

can be used instead. You can add these lines to your /etc/rc.local file so that they are run at boot. You will also need to edit your /etc/sysctl.conf file, and uncomment this line:

#net.ipv4.ip_forward=1

by removing the #, so that it looks like this:

net.ipv4.ip_forward=1

to enable ip forwarding. Since this file is loaded at boot, you can enable IP Forwarding on the fly by running:

echo 1 > /proc/sys/net/ipv4/ip_forward

through the command line.

I hope that this has helped someone – I know that I had to look through several guides online before I managed to get it working.