My strange solution to Apache not starting on Ubuntu Linux server with SSLEngine on… (YMMV)

The situation: I’m running a web server on Ubuntu Linux using Apache 2. I have two sites on the server that need SSL. I obtained a second IP address (since you can only have one SSL certificate per IP address) and configured Apache accordingly. I was able to get regular old port 80 non-SSL pages to load just fine on virtual hosts configured to use both IP addresses.

I created my key files, got the certificates from the CA (GeoTrust, in this case), all that business. Put the files in the right places, configured the Apache files, all that jazz. Made sure mod_ssl was enabled, yes. All of that. Trust me, I did it. Don’t bother asking. And yet, whenever I tried to run Apache with SSL configured… nothing.

And I mean… nothing.

I’d restart Apache at the command line, and nothing. No error messages of any kind. But Apache wasn’t running. I checked all of the log files (and I mean all of the log files), nothing. DOA.

Eventually I tracked down the culprit as the SSLEngine on line in the Apache config file. With it in there, Apache wouldn’t start. Comment it out, Apache starts up just fine, but of course you don’t have SSL.

I’m using the arrangement of Apache config files as they’re installed in a default Ubuntu build. That means /etc/apache2/httpd.conf is actually empty, and most of its usual contents are in /etc/apache2/apache2.conf, with a few other settings dispersed into a number of adjacent files. There are some critical settings in /etc/apache2/ports.conf and then everything else is in the individual config files I’ve created for each site on the server, stored in the /etc/apache2/sites-available directory with symbolic links for the active ones in /etc/apache2/sites-enabled.

Well… that turned out to be the problem. I’m not sure why it matters, but I was putting the VirtualHost configurations for the SSL sites in the respective sites’ existing configuration files. But no… all of the SSL-related (port 443) <VirtualHost> blocks needed to be put in the 000-default file. That made all the difference.

Well, almost all the difference. My private key files are encrypted with pass phrases, and Apache needed me to enter them when starting up. But, funny thing… it didn’t ask me for them all right away. I had to fiddle around with starting and stopping it a couple of times (which I bothered to do because it still wasn’t running), but eventually it did ask me to enter the pass phrase for both sites, and after I did that, everything is working. Both SSL sites, all of my non-SSL sites, it all works.

I’m a little concerned that Apache is going to require manual input of these pass phrases again whenever it restarts (e.g. if the server reboots). I hope not, but for now I am at least able to move forward knowing it works at all.

Top 5 albums of 2010: the contenders

It’s that time of year… time to start thinking about my Top 5 albums of 2010 post, coming soon. For now, let’s have a look at this year’s contenders, in a visual format. These are all of the full-length albums released in 2010 that I have purchased, from which the top 5 will be selected…

And here are a few others that are non-contenders for various reasons, but still worth a listen. The Shiny Lights is an EP, but it’s fantastic nonetheless. Anesthetize was a limited edition live album, officially available only in Europe, but it’s great stuff. (I ordered it from the UK distributor at ridiculous expense.) And Three is my own. I’m a narcissist, but not that much of a narcissist.

Web standards: a Win-Win-Win situation

Today is the fourth annual “Blue Beanie Day,” a tradition established by the father of web standards, Jeffrey Zeldman.

What are web standards? Simply put, they’re awesome. But seriously… the goal of web standards is to establish a set of best practices for web designers and developers, and a set of open, shared languages and tools for building websites and displaying them in a consistent manner.

At the heart of the modern web standards movement are a set of three core languages: HTML5, for organizing and structuring content; CSS3, for designing the presentation of that content; and JavaScript, for providing rich interaction with that content.

HTML5, CSS3, and JavaScript are all open standards. The specifications are published for anyone to see; they’re open and evolving, for anyone to contribute to; and they’re freely available for anyone to build an application for rendering content delivered via these languages (in common parlance, a web browser, but we’re starting to see “web” content appearing in all sorts of applications for computers and mobile devices these days).

But why are these three web standards so great? Because they create a win-win-win situation:

A win for web designers/developers. By establishing a common set of tools that are open and free to anyone, web designers and developers can get started with no barriers to entry. Plus, by standardizing these tools, the same skills can be applied anywhere a website is being built. And as web browser makers adopt these standards, the last 15 years’ worth of browser-to-browser inconsistency will fade. Our job is made easier, we can get more done in less time, and, with powerful frameworks like jQuery built on top of these standards, this power to do more with less will grow exponentially.

A win for site owners. If you’re paying to build a website, you want to know you’re spending your money wisely. You want your investment to last, and you want to make sure everyone who wants to access your site, can. Web standards are the key to an accessible, reliable, “future-proof” website. Some Internet technologies may come and go; jumping on the latest trend may make your site seem “with it” today, but tomorrow it will be painfully dated… if it even works at all. But these three core web technologies will always be at the heart of the web. Plus, a site built with web standards will automatically be structured well for search engine listings, without the need for expensive and questionable SEO tactics.

A win for Internet users. Web content that is built and delivered with a diligent adherence to web standards will work reliably with any device, any software, that is used to access the Internet. Plus, no well-formed, standards-compliant HTML page ever crashed a web browser.

Web standards: Win-Win-Win.

A brief rant against “mobile” websites, and in praise of CSS3 media queries

This morning, as I do on most mornings, I eased the transition between my peaceful slumber and the mayhem of conscious life by lying in bed, catching up on the goings-on of humanity on planet Earth with the help of my iPhone and the Internet.

This usually consists of checking Twitter, Facebook, and my Google Reader feeds, but when that isn’t enough, I’ll occasionally search the web for whatever random piece of information crosses my stream of consciousness. Today that happened to be the Tim and Eric comedy tour that’s currently underway, since I’ll be seeing it when it arrives in Minneapolis on Wednesday. So I googled Chrimbus Tour review and one of the first links that came up was a review on BuddyTV.

BuddyTV is not a site I think of often. I believe I was vaguely aware of its existence before today, but I didn’t know what it was all about and I never had any inclination to visit it. But I was certainly happy and willing to click the Google link and read its review of the Chrimbus Tour.

Unfortunately, the site did not reciprocate that happy willingness. Instead of taking me to the desired review, it detected I was arriving via iPhone, so it shunted me off to an annoying splash page imploring me to download the BuddyTV iPhone app. No thanks, I really just want to read the article I came here for in the first place. Oh, great! You’ve provided an “Or continue to BuddyTV.com” link at the bottom. Thanks!

But — and this is so often the case in this scenario — that link did not helpfully take me to the article I wanted. (And as a web developer, I can tell you it is not at all difficult to make it do that.) Instead it just went to the BuddyTV home page. Now what? I’ll tell you now what: I closed Mobile Safari and got out of bed. Not only did I not download their app; I didn’t expose my eyeballs to any of the ads that pay for their website; I didn’t get to read the article I was interested in; and I was left with such a negative impression of the site that it drove me to this public rant.

All of this is not really to single out BuddyTV for its bad behavior, though. BuddyTV is just one site among many I’ve encountered over the past couple of years that all adhere to this same pattern of deplorably ill-conceived UX design. Surely this is not the reaction the owners of these sites hope to elicit. But it’s exactly what happens with me, every time, and I’m sure I’m not alone.

There is a solution.

We frequent users of web browsers on mobile devices just want to see your site. We want to see the same pages we’d see on our computer. The same content. But it doesn’t hurt to have that content optimized for the mobile browsing experience. Resized to the smaller screen. A streamlined layout that’s easier to navigate with a touchscreen. But, fundamentally, the same experience.

While there are some tools out there to help turn a regular website into a mobile website (most notably Mobify), there’s a far easier solution: CSS3 media queries.

CS-what media what now? CSS3 media queries are, simply, a set of stylesheet definitions that are applied to a web page selectively depending on certain characteristics of the media the page is being viewed on, most notably, screen size.

With CSS3 media queries, you can define an entirely separate set of stylesheet attributes to be applied only when the user is visiting the site from a small screen. Or an extra large screen. Or you can describe a bunch of intermediate sizes, so with the exact same HTML content the user will see a perfectly laid-out page, optimized to their screen, whether that’s an iPhone, a netbook, a “standard” computer monitor or a 30-inch Apple Cinema Display.

I’ve begun working more extensively with CSS3 media queries on some of my own projects lately, and I am very excited about the potential. If you’re a web developer or designer, you should learn about CSS3 media queries now. And if you’re a website owner, you should know that “mobile” sites are sooo 2008. Now you can have your cake and eat it too. You can have the best of both worlds. Insert cliché here. Just don’t subject your site visitors to any more obnoxious plugs for your iPhone app, or dump them thoughtlessly on your mobile home page with no way of tracking down the article they were coming for. It’s not fair to your users, it’s not fair to your public image, and if you’re supporting your site with ads — or, for that matter, if you’ve been convinced to drop a ton of extra cash on developing a separate mobile site, or an iPhone app that just displays your site’s content anyway — it’s costing you money.

State GOP chair Tony Sutton’s faulty logic

“Something doesn’t smell right when you take control of the state house; you take control of the state senate; you win in the 8th Congressional District, and yet, somehow we don’t win the governor’s race.”

—Minnesota Republican Party chairman Tony Sutton*

I was planning to avoid much commentary on this year’s election, but I’m even more of a math/logic nerd than I am a liberal/progressive, and while I can (almost) shut my mouth about the Tea Party movement, I can’t let this glaringly erroneous logic go uncorrected.

First, Sutton makes two unfounded assumptions:

1. Supporters of Republican state house and senate candidates couldn’t possibly — possibly! — also vote for Mark Dayton.

2. Those same supporters of Republican state house and senate candidates couldn’t possibly — possibly!!!! — vote for Independence Party candidate Tom Horner for governor rather than Tom Emmer.

Let’s just talk math. Let’s go with that unfounded assumption that anyone who voted for a Republican for the state house would also necessarily vote for Tom Emmer, and anyone who voted for a Democrat for the state house would likewise necessarily vote for Mark Dayton. We’ll ignore the state senate and third-party candidates for now.

Let’s assume three house districts, each with 10,000 voters. And let’s assume the vote breakdown went something like this:

District GOP House DFL House Tom Emmer Mark Dayton
District 1 5,500 (55%) 4,500 (45%) 5,500 (55%) 4,500 (45%)
District 2 5,100 (51%) 4,900 (49%) 5,100 (51%) 4,900 (49%)
District 3 1,500 (15%) 8,500 (85%) 1,500 (15%) 8,500 (85%)
Statewide Total 12,100 (40.3%) 17,900 (59.7%)

In this scenario, the GOP house candidates narrowly won districts 1 and 2, while the DFL house candidate overwhelmingly won district 3. Still, the GOP outnumbers the DFL in this fictional 3-seat house by 2 to 1. And yet, the citizens in these three districts, all voting straight party tickets, handed Mark Dayton a decisive 59.7% majority victory in the statewide governor’s race.

This is fictional, simplified, and exaggerated, but it proves my point. And yes, I do believe that there’s some accuracy to this kind of breakdown. There are a few “deep red” districts in the state and a few very “deep blue” ones (mostly in the metro area), but most are fairly close to the middle.

In the actual vote, for instance, let’s compare two counties with roughly equal populations: St. Louis (home of Duluth) and Olmsted (home of Rochester). In St. Louis County, Mark Dayton received 61.8% of the vote; Tom Emmer, 28.6%. In Olmsted County, Tom Emmer received 45.9% of the vote; Mark Dayton 37.9%. So Mark Dayton “won” St. Louis County and Tom Emmer “won” Olmsted County. But saying either candidate “won” a particular county is irrelevant; this is a statewide office, and statewide totals are all that matters.

All it takes is a few districts with a very high proportion of Democrats to Republicans, and a lack of correspondingly skewed districts to compensate, and it’s quite easy, even imagining all voters voting a straight party ticket, to arrive at a scenario where the Republicans score a decisive takeover of the state legislature while still electing a Democratic governor (a statewide office).