Setting up this blog

Well, it has taken a couple of days but I’m quite happy with the progress I’ve made on this site.

As it happens, there are loads of web hosting companies out there who sell domain names and hosting for quite modest prices. A domain name is something that I don’t yet have, but hopefully that will change quite soon; an IP address is not terribly easy to remember. So the logic of the situation is that any sane, rational person would opt for a hosting package, as they are cheap and user friendly.

To host this site, I am running a virtual machine on Amazon web services. Ubuntu (which I use a lot actually) has plenty of documentation on installing the LAMP stack which WordPress requires. LAMP, by the way, stands for Linux, Apache, MySQL and PHP. So installing Apache, MySQL and PHP was very simple, in fact you can install all three of them with a single apt-get command.

The bad news is that although Ubuntu does have a package in the software repository for WordPress, I ran into trouble trying to set up this site with it. I got as far as the “5 minute install”, but then I would find myself locked out of my own blog: it refused the user-name and password that I set in the install. This happened multiple times, after much faffing around to uninstall things (I have also learnt how to delete a database from the MySQL console, which I think proves that old adage about a little knowledge and all that). Eventually, I decided to start off from scratch with a fresh VM (thank you, thank you, cloud computing) and instead of getting WordPress from apt-get, I downloaded it from the usual source. Ordinarily, I do not do this as I prefer using apt-get to handle software updates, but on the other hand WordPress has its own mechanism for installing updates. Once I had gone into the MySQL console and manually set up a database and db user for WordPress, it installed itself, and much to my relief, accepted my password! It was 2 o’clock in the morning by then as well, so I would have been quite frustrated if it still refused my login.

Next challenge was to upload media files, photographs in particular. I tried one that was well within the 2MB limit, but got an error. I can’t remember what the error said specifically, but it did indicate that it was unable to create a directory on the server to store the image. Now, here is a bit of background on what was going on. A web server is a program running on the server (computer), and all programs have a user id which governs what files the program can access, where it can create files etc. based on good old Unix permissions. The user id is some user account on the system, who is said to be the program’s owner (but that may not correspond to an actual human being). When you upload an image, the web server has to be able to store it by creating a new file on the server. The trouble in my case was that the uploads directory on my server was owned by root, and hence the web server user (in this case called www-data; a special user account just for Apache) was not allowed to create a file in that directory. So, to fix this issue, I simply chowned the uploads directory to www-data, and voila, I could upload images no problems. This is actually one situation where self hosting has an edge over other hosting packages: with packages you often don’t get SSH access unless you pay a lot of money, and you need SSH access in order to change the directory owner.

So that is the story of the technical hiccups in establishing this blog. The rest has just been fiddling with settings and typing posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

four × two =