Practicalweb Ltd

Technical information on this site may be out of date : no updates since 2015

Migrating from Drupal 5 to Octopress

October 21, 2014 , posted under drupal octopress blogging long-term

I’ve been running this blog (or some version of it) for almost 10 years now.

I write to help clarify my own thoughts, or to note down technical details of a task that I have struggled to figure out. I often found myself coming back and have saved many hours of trying to figure out the same thing again a year or more later.

Read More…

Using varnish to cache authenticated Drupal pages

October 15, 2013 , posted under drupal varnish esi caching

I have a site which requires users to be logged in, but the pages are not customised. I was playing with a way to cache the content in varnish while still doing an access check. This method uses an access check pages (test.php below) which then uses ESI to load the real, cacheable content.

I’ve tried it in a dev env, I’m not yet sure if we’ll use this in production.

Varnish config

Read More…

Jenkins Build script for Drupal - multistep with changelogs

September 28, 2012 , posted under drupal jenkins ci

My build script has been getting more complex lately and I’m quite pleased with it.

We tend to have several versions of code on the go, version x is live, x+1 is in UAT, and x+2 is in development. With all these versions around it’s important to keep track of changelogs, and to upgrade correctly x to x+1, and then x+1 to x+2 as we have found that going direct from x to x+2 can fail to uncover some bugs. Specifically this happens if a drupal update hook gets edited after it has been released to the client, but before it has run on live. Our builds always start from a copy of the live site.

Read More…

Monitor filesystem for deletions

September 28, 2012 , posted under drupal linux inotify-tools

On a project I’m working on at the moment we have a problem, files are going missing.

We don’t know which part of the system could be trashing these files (user uploaded images in this case) and they are on a shared filesystem so there are plenty of places to point fingers.

Read More…

Check Drupal for update hook changes

July 12, 2012 , posted under drupal drupal planet

In a busy team, with ongoing testing I often find we have a production version of the site, a version under test, and another version being actively developed.

In fact it can be less clear than this if release planning isn’t a priority, some teams simply churn out releases some of which get tested and eventually released.

This can lead to developers being unsure which update hooks have actually run on production (or will have run by the time the next release goes live).

In this case it’s important for somebody to manually review all install files that have been edited and check that we don’t end up releasing update hooks that have been edited after they have been run.

This script fires up a visual diff tool for the changed files.

Read More…

Can't login to Drupal (404)

April 25, 2012 , posted under drupal apache mod-rewrite

I’ve been working on a project for a while on my main dev machine, but needed to run it on my laptop too.

Usually copying a site across is quick but this time I re-installed the OS too, everything went OK except for some reason I couldn’t log in to my drupal site.

Eventually I noticed that while the site appeared to be working, every page was being served with a 404 header.

Read More…