Akismet to the Rescue

Any web site that’s been online for more than a few seconds seems to attract spammers, especially if it supports comment posting or other user generated content. The magnitude of the problem seems to be higher when the site is using a well known software package such as WordPress. My blog is no exception and the problem has become steadily worse as the amount of content on my site has increased.

Continue reading “Akismet to the Rescue”

On Blogging

It’s hard to believe that it’s been nearly seven years since I wrote my first blog post. Most blogs end up with a flurry of posts and then fizzle out completely as the blogger gets bored or runs out of things to say. Way back in August of 2003, I gave myself even odds that I’d manage to actually keep this thing going more than a few months. Well, over 270 blog entries and two major software overhauls later, I’m still on the air, so to speak. Sure, there have been lulls, some of them long, but I’ve always come back.

Continue reading “On Blogging”

Site Tinkering

Well, I’ve finally decided to ditch the old school method of running a web site and move entirely over to a content management system. Since the majority of my site content consists of blog posts, I have decided that WordPress is a good choice. I have been using WordPress for my blog for some time and I have been happy with it so I thought, why not use it for the whole site?

I made this decision not because I have any great difficulties managing the site using old school static html files but because this way is much easier to add content to. It is also much easier to redo the site look without having to monkey with a large number of files and I no longer have to maintain stylesheets and so on if I don’t feel like it.

So far, I have brought the entire blog history across as well as the main web site pages. I have taken the opportunity to eliminate a few pages that were horribly out of date and not terribly useful. I have not finished bringing over the deep content pages, however. That may take some time as there is much fiddly work involved in doing so. I have, however, ensured that the internal linking structure of those pages will bring viewers back to the new WordPress installation instead of leaving them in limbo.

After tinkering with various WordPress themes, I think I have found one that I am happy with. It follows largely in the same vein as my older site layout, being largely text based with relatively little fancy layout gimmickry. That makes me even happier because it means I don’t have to monkey with creating a theme for WordPress which, while it is something I could do if I chose to, I really don’t feel the need to get that deep into WordPress.

This whole adventure has left me somewhat awed by the progress that web site publishing has made over the past ten years. When I made my first foray into blogging back in 2003, the state of the art was quite basic. Content management systems were just becoming a mainstream concept and blogging wasn’t really on most people’s radar. Back then, I rolled my own blog software which I used in one form or another until I switched to WordPress. Now, I have finally jumped on the content management system bandwagon though, in all honesty, the state of the art for that arrived a couple of years ago. It was really just inertia that kept me using the same old system since then. No doubt the next seven years will result in similar advancements which will be interesting to witness.

Blog Overhaul

Well, I decided to overhaul my blog today. After much pondering and thought (about five minutes worth), I decided to throw WordPress at the job. Turns out that it is fairly easy to install and I got the basic install operating quite quickly. However, it wasn’t quite all fun and games.

First, I like my site design so I wanted my blog to use a similar look and feel. Since the world at large goes for all sorts of whizbang gewgaws, my site design is fairly unusual, what with its total lack of images or fancy layouts. It took me the better part of today to work out how to get the basic look right and still maintain the functionality of WordPress that I was interested in.

The second, and possibly more pressing, issue was how to get all the old comments from my original home-grown blog software into WordPress. Knowing this would not be easy, I cranked up my PHP and MySQL skillz and started poking around. Without too much trouble I managed to incant the right stuff at MySQL to copy the data from the old tables to WordPress’s tables. Thus I was able to import all my blog posts since the dawn of time and all the comments associated with them! Yah!

For those of you wondering just why I went to an off-the-shelf software package, it comes down to time. I wanted a bunch of new features which one gets with such software without having to do all the tedious research and write all the tedious code to make it happen. That is just not efficient. I have better things to do, like ripping DVDs or reading books or watching TV or what have you. It’s not that my home grown software was terrible; it was quite good for the design specifications I built it to, but it was just getting old.

So here’s my shiny new blog with all its shiny old content. If you find anything that didn’t come over correctly, feel free to let me know. Also, I am likely going to be tinkering with the site layout for some time to come so don’t be surprised if something is broken for no apparent reason. Feel free to let me know if you find something like that, too.

I now return you to your regularly scheduled sparse stream of ramblings.

Site Redesign

I decided recently to completely rebuild the backend logic of my web site. Over the years, I’ve noticed a number of problems with managing my site. I’ve had a web site since long before dynamic content and PHP were cool. As a result, much of my content is a set of static pages. That’s all well and good, but it does create a number of problems.

The first major problem is what to do when reorganizing the site. Since I like to keep the old links functional with redirects, I end up creating a bunch of rewrite rules in Apache or placeholder PHP pages or what have you. That’s a real pain to do and easy to mess up. It would be much easier to maintain if there were to be a lookup table somewhere that is consulted for links that don’t exist and an appropriate redirect generated in that case. That can be accomplished using mod_rewrite or with some sort of PHP script in a 404 handler.

When rearranging a site, one also wants to update all the internal links to avoid having them go through the redirection process or worse, hit a 404 error. This problem is not so easy to solve as it requires a periodic validation of the site or preprocessing every page to check for outdated links and rewrite them. This is not really practical.

A content management system can solve the above two problems without too much difficulty. However, most content management systems rely on a database server in the backend. That’s overkill for content that almost never changes, especially for someone proficient with a text editor and file transfer methods. That said, it is conceivable to create a content management system using static files on the file system which then preprocesses the files for links and so on. In fact, that is exactly what I have done, along with a caching scheme so that pages don’t get reparsed every time they are loaded.

Another problem content management systems often have is that the pages they serve appear to be modified every time they are loaded. This is not ideal for web site traffic volumes as search engines and web browsers will have no way of knowing the page really hasn’t been modified. My system uses the modification time of the source file to set the last modified time in the response and it also handles the if modified since request option and returns the proper not modified status if appropriate. This means browser caching can behave normally.

Many of my pages also have a last modified time in the footer. This has historically been updated manually by me when the page is updated. This is not ideal, however, since it requires me to remember to update it. Instead, the new system provides a substitution that adds standard footer along with modification time based on the file’s modification time. After all, the computer is very good at identifying such bits of information.

So I have a content management system that handles static pages implemented. I even arranged for apache to call it for every request within a particular folder. That means that unless the content system recognizes a request, it is not returned. The content system has full control. This prevents anyone from seeing the underlying file structure that implements the site. That is not sufficient, however.

My site also has a number of sections which have well defined behaviour or require more dynamic operation. These are such things as my blog or the photo album section. To make it possible to add such sections on at any time without having to modify the global site code, I have created a module system. The main content system examines the requested item, figures out a module name for the contents, and attempts to pass the request off to that module. If the module exists, it handles the request. In fact, the static pages are implemented as a module in the content system.

And, to top things off, if no module handles the request, it is passed on to a final step that looks up the requested item in a list and determines if a redirection is needed. If a match is found, a redirection is sent back to the browser, If that last ditch effort fails, a 404 error is returned.

It’s a very ambitious project. So far, I have implemented the framework for static pages and have started converting existing static pages to it. Still, I have the blog, photo album, etc., to implement yet before I can bring the new version of the site live. Even with the amount of work involved, I think it is well worth the effort even if there is no real visible change as far as the site users are concerned. Who knows, maybe I’ll share the site code once I have it all working.

Jumping on the Bandwagon

Well, I’ve finally done it. I’ve jumped on the blogging bandwagon. And while you won’t believe it, I didn’t do it because everyone else is doing it. After all, not everyone is doing it. I did it because I often feel the need to comment on current events but find it is too much of a hassle to build a web page each time. So I took the time to hack together some PHP code to run a blog and here we are. Now all the remains to be seen is whether I actually make entries on a regular basis.