Searching for a tagline since 2001

Site Search

previous post -- next post

Upgrades and Fixes

Earlier this week I decided to upgrade my virtual web server to the latest version of TurnKey Linux, which is based on Ubuntu 10.04.01 with long term support until April 2015. Why not just do my own minimal install of Ubuntu Server? Well, Turnkey Linux has an awesome tklbam-backup that made migrating from my old install of TurnKey Linux to the new one almost painless. Once migrated to my new virtual server I discovered a few other things, cookies have been broken with my CMS for probably a very long time and I had no 404 pages setup. It is amazing what you discover does not work properly when you dig into an old website, even if you do not change anything related to the site itself.

For anyone considering setting up a Ubuntu (Debian) based server for any length of time, you absolutely have to checkout TurnKey Linux. I started using TurnKey Linux in early 2009 and I have been very happy with my choice. That choice looked even better when they announced TKLBAM last year. In a nutshell, TKLBAM is an easy and powerful system level backup and restore that makes migrating from one server to another extremely easy. In literally a couple minutes I had my websites moved from my old TurnKeyLinux virtual server to my new TurnKey Linux virtual server. All my users were migrated, almost all my software that I had additionally installed was there, the exception being modpagespeed, which is updated from Google's repository, not a TurnKey or Ubuntu repository. I also had to move one admin directory that is non-standard and I use as a home for system administration scripts. There are settings within TKLBAM where I could have had the directory included and maybe even the extra software. The fact is, TKLBAM saved me hours of work and likely saved me troubleshooting small Apache settings that I would have forgotten about if not for such an amazing tool.

One item I wanted to look at after migrating was adding the ability for my CMS to do some sort of cache of pages requested and built using the various scripts and database lookups. While playing around with caching I had to make sure that cookies still worked okay and that is when I discovered cookies were not working before I ever started implementing any sort of cache. No one commenting ever mentioned that there did not appear to be cookies used on my blog and I myself never noticed it. Once upon a time before Twitter when there seemed to be more conversation on blogs there was a specific request that I add cookies and I did. As best I can tell, once I moved toward using PHP5 the extra settings available are apparently needed in order for cookies to work properly. I added a couple more settings to the cookie and like magic they were working again. For the record, my simple cache solution is working as well. Although unless something I write some day gets Slashdotted I might not ever be able to tell if it helps. Pages due indeed cache and additional requests are served as static html.

Interestingly I also looked at the way I was presenting pages not found, a not very well thought out method of redirecting anything not found to my main page which had bots returning to urls that did not exist. I decided instead to present this as it should be and register the page as a 404, not found. But I had to be a little smarter, due to my cache, if the page was requested again Apache was presenting a 404 to the user but was using the cache and returning a 200, which is a page found. This might not seem like a big deal, I mean a user would see the 404, but it would be bad to return to a bot that the page existed. So I made sure to not cache a url that returned a 404, so multiple requests continually return a 404 just as it should. By the way, do I get geek cred for my 404 page?




Comments:
What is this?
Yes, you geek...

Commented by aharden @ Friday, March 25, 2011


What is this?
LOL, I love your geek reference!


Commented by Shaun @ Thursday, March 31, 2011


Name:

Email (will never be published):

url:

Comment:

coffee or beer  Scott likes to drink?
Buy Scott a Drink