So I’ve taken the first steps to setup entreprenewb.com. I’ve bought hosting, I installed an operating system, setup a web server, database, and blog/cms. Here’s what I did to setup my server:
Remote Hosting
I am currently running this site on a LAMP stack (Linux, Apache, MySql, and PHP) hosted through Linode. When I initially looked for hosting I found this helpful comparison of virtual private servers (VPSes) for Linux and I found that Linode offered the best hosting when compared to other hosts. It’s approximately $20 a month for the most basic hosting package, which is more expensive than the cheapest hosting packages out there, but it’s pretty inexpensive if you want full control over your server, easy access, and good support. The technical guides at Linode allowed me to setup a server very quickly (we’re talking a few hours from purchase to a live site) and add additional features easily. You will have to connect through SSH via the command-line, so you will need basic familiarity with the Linux shell environment. As for moving files around, I usually end up using rsync to transfer my files to the remote destination. As for the operating system, I chose Ubuntu as that’s what I was the most familiar with.
Local Testing/Development Environment
I decided to see if I could use a virtual machine as a development environment instead of the OS on my own computer. By doing this, I can have backups of the OS in various stages of being installed and configured with software. And more importantly, I will have no reservations about making a change as I can simply rollback nor will I be dependent on my physical operating system, which means I can upgrade or reinstall my computer’s OS without having to touch my test environment.
Using a VM has also encouraged me to document the requisite software and configuration steps I need to create a working environment in both the test region and production. For me, it was simply easier to begin to automate the production environment in the form of bash scripts to perform each task. Once I had my install scripts working, I was able to host the install scripts on my local machine, but share and run them on the virtual machine.
Setting up the environment
- I first downloaded the OS from here: http://www.ubuntu.com/server/get-ubuntu/download.
There are a number of ways to download it, I chose to use a torrent. If you have a slow connection it may take some time (the image is about 700mb). I then burned it to a CD; this will vary for your OS, but the Ubuntu website has documentation for the major OSes:
https://help.ubuntu.com/community/BurningIsoHowto - Download VirtualBox and create a new image: http://www.gilsmethod.com/how-to-create-a-new-virtual-machine-in-virtualbox.
I found that creating a “fixed” size image was taking a very long time, so I chose the dynamic option instead and it was created immediately. The recommendation I’ve read against fixed size is that if your OS may grow unexpectedly fixed size may be an option to keep it under wraps, but for me, that’s not a likely scenario. - I then had to configure the VM for sharing files between the VM and local machine using the “guest additions” software from VirtualBox, see http://joergweis.wordpress.com/2009/03/07/install-virtualbox-guest-additions-on-ubuntu-server-810/
- Setting up LAMP. See the guides at Linode, they are clear and concise for your flavor of Linux: http://library.linode.com/lamp-guides/. I did not setup an IP for my local environment, but had to for my production server. Also, in my local environment, I just ended up using the IP address my router automatically assigns to the web server. I then added an entry in my local hosts file with a more friendly name for the server.
- Get your files onto the server. From your own machine (this assumes you have rsync installed), run this from the command line:
rsync -ave ssh /source/directory youruser@yourhost.com:/destination/directory
The options here are, ‘a’=archive mode, ‘v’=verbose, and ‘e’=transfer protocol. For option ‘e’, I have specified SSH. You then should be prompted for a user and password to your site and once you’ve entered your credentials, the files should transfer. - The last thing I did was install WordPress to use as content management software. This was probably the easiest thing out of everything I had to do. See http://codex.wordpress.org/Installing_WordPress.
- I also decided to host WordPress outside my root directory using these instructions. After that, I installed a few plugins where I felt WordPress native feature’s were lacking, specifically Bad Behavior to block spam, Google Analyticator for google analytics tools, and sCategory Permalink to allow me to pick the category that is used in the my WordPress posts’ urls.
Once I was satisfied with all of these steps in my test environment, I then rolled them out to my production server with very little hassle.