steve's blog

Caching NGINX + Apache setup for Drupal 8

It's taken some trial and error, but I have a good setup now for a Drupal 8 site that runs on Apache behind an Nginx reverse-proxy caching server. Just sharing the basics of the recipe here (obviously this is just a portion of the config). The connection to Apache is defined in /etc/nginx/apache_proxy.conf and the key logic is found in the location blocks that either send requests to Apache directly (using that config file or the @proxy alias) or to the caching service at @cache. The following setup was designed to solve the following problems:

Prevent iframe stealing focus with jquery

I recently had (good) reason to embed a complex web page into another page using an iframe. Unfortunately this caused the well-known problem of the iframe stealing focus, which meant that on page load suddenly the browser scrolled down to where the iframe was embedded. After doing some searches and many years of various and complex solutions, I came up with this simple fix: don't display the iframe until it's loaded. Like so.

My HTML looks something like this:

Scripted D6 to D7 Drupal Upgrades

AKA, How to upgrade a complex Drupal site to D7

So Drupal 6 reaches end of life on Februrary 24. If you're like many of my clients, only now are you getting around to making that upgrade happen. Accordingly, I've done a bunch of D6 to D7 upgrades recently, and wanted to share the recipe I now follow to make things go as smoothly as possible.

This process has worked out extremely well even for moderately complex sites, for instance e-commerce sites using Ubercart.

Download your Drupal site without server access

Recently I've had some clients come to me because their previous developer just kind of dropped out of sight. This happens every now and then when you rely on one-person shops. It's also also familiar to me on a personal level: a vanishing dev is largely why I got into this line of work again in the early 2000s, after a few years' hiatus. The problem in these recent cases was complicated because not only did this dev build the sites, but also hosted them. This meant that, for one (live) site, no much-needed code or template changes were possible, and another (dev) site couldn't launch.

Drupal rsyslog with separate log files

This just took a little figuring out, so I'm recording it for posterity. I maintain many Drupal sites, almost all hosted in multisite installations. To save DB server traffic, I've started experimenting with the syslog facility. Here's how I set things up on my Debian server to log each site to its own file. First, I created a /var/log/drupal directory to hold the log files and gave it the appropriate permissions (group etc. will vary by distro).

Lenovo Thinkpad S431: A Web Developer’s Review

I’ve been a Thinkpad user for many years now. I love my mid-2000s T60 with an irrational passion. So much so that, when I cracked the case a couple of years ago, I hit up eBay for an identical replacement rather than try something new. (I’m pretty confident that at least some Thinkpad owners will be nodding in understanding right now.)

PHP Project Management and Bug Tracking with TinyIssue

I've recently returned to freelancing after working for most of the past year at Myplanet, a relatively large web development company that uses Agile techniques to manage teamwork on complex projects. The experience left me impressed with how effective good project management systems and tools can be. Back on my own again, I set off in search of some kind of tool that would let me manage my work. Ideally it would operate both as a bug tracker and as a sprint/scheduling tool, be open source, and written in PHP.

Pages