1. Computing

Discuss in my forum

Migrating a Dedicated Server from Windows to Ubuntu Linux

A Case Study

By

To decision to host on Linux as opposed to Windows is obvious for most web developers; Linux has lower CPU overhead, greater security, and of course is free and open-source. However, my server also hosts game-servers for Garry’s Mod, a game on Valve’s Source engine. Before the game’s major version update on October, 2012, the only way to host a server on Linux was through Wine, which was not ideal.

Windows Server licenses have varying prices across datacenters; I had been charged $10 per month for a Windows 2008 license, but from my experience this is actually quite a low rate. The switch to a Linux distribution made obvious sense when considering these cost savings. I began by renting a new server with Ubuntu 12.04 LTS installed. Ubuntu overall was fairly easy to learn, even for someone who had little previous Linux experience.

My web-server stack used Nginx, an open-source HTTP server known for its high-performance and low resource consumption. Of course, Apache is also available on Ubuntu, but I chose not to use it for the aforementioned reasons. Installation of programs on Ubuntu was refreshingly easy; it was a matter of typing in a few simple commands, instead of clicking through various installers. The configuration of Nginx was a little tricky; setup of sub-domains was a little different than I had been accustomed to from Apache. Nonetheless, the configuration of Nginx is still relatively straightforward considering its versatility.

I used packages called PHP-FPM and MySQL to complete my web-server stack. For MySQL database management, I had previously used a program on Windows called MySQL Workbench, which unfortunately was very buggy and cumbersome. Since with Ubuntu Server I had no GUI to interact with, I decided the easiest way to set up databases would be through a PHP tool called phpMyAdmin. This tool proved very easy-to-use, and I rapidly transferred by forums, WordPress blog, and other pages.

Moving the game-servers to Ubuntu proved a little more difficult, since the install process was not as well documented as the Nginx setup process. When I finally decided to make the move, I ran into a small number of issues. By default, Ubuntu Server seems to lack the binaries for running 32-bit applications, of which the game-server program was one. After figuring out the required packages, I successfully installed the game server, but ran into another minor issue: filenames are case-sensitive on Linux. Fortunately, however, most of the modifications I needed for my server were made by forward-looking developers who had already ensured their code would run on Linux.

Apart from these few minor issues, the transition ran relatively smoothly, and I learned several basic Linux skills. I made a new user to run the game-servers in order to minimize risks; it wouldn’t be able to write to files outside of the game-server. Another interesting program I learned to use was Screen, which allows the creation of multiple persistent sessions. Obviously, I’d want to keep my servers running even when I am not interacting with the server through SSH sessions.

One of the members of my gaming community wished to set up and manage a few game-servers along with me, and I thought this to be a good idea, since after all I had a dual-quad-core server with plenty of processing power. The setup was surprisingly easy, after I learned how to effectively use the chmod and chroot utilities to give the user only permissions to the files they needed to host the server.

My overall impressions of Ubuntu Server are very positive. The lack of GUI did not bother me very much, since terminal commands proved to be quite straightforward. Precise control of permissions in the file-system made setting up new users easy and secure. Lastly, I am pleased to know that my server relies on a lightweight, robust, and open-source operating system.

  1. About.com
  2. Computing
  3. Linux
  4. Linux Distributions
  5. Popular Linux Distros
  6. Ubuntu
  7. Migrating a Dedicated Server from Windows to Ubuntu Linux

©2014 About.com. All rights reserved.