MediaWiki: Creating a Private Wiki (2023 Update)

(This is an update of an article I wrote in 2011. Because so much has changed, I’ve opted for a re-write instead of just updating the original. The re-write went up in 2017; I have updated it for 2023.)

MediaWiki is the software behind Wikipedia, but you can use it to create your own special-purpose sites. I’ve used it at work to build an internal company knowledge base, and at home to make a Wiki for the fictional worlds of a couple of roleplaying games I’ve been in.

It’s a pretty polished software package, but out of the box it tends to assume that you are creating something like Wikipedia that is visible to (and editable by) the whole wide world. If that’s not what you want, it requires some tuning, which I’ll describe in detail after the jump.

Firefox Proxy Auto-Configuration

Consider the following purely hypothetical scenario: You do a lot of your work inside a web browser. Stuff on your workplace network (like the bug tracking system, the company Wiki and the source control system) you have to access directly. Stuff outside you have to access via a proxy (because the direct access is filtered in a haphazard way that blocks websites of your vendors and customers, as well as resources you need to do your job).

You can go manually change the network settings in your browser every time you go back and forth. You can set up two different browsers (one proxied and another not). You can use a browser add-on that lets you manually toggle proxy settings with one click.

Better still if you didn’t have to do any of that stuff and your browser would just automatically do the Right Thing. With Firefox, you can achieve this result reasonably easily using a “Proxy Auto-Configuration File” (or PAC file, for short). Read on for details.

MediaWiki: Creating a Private Wiki

This article is obsolete. The instructions given will not work with current MediaWiki versions. Please refer to the updated version of this article.

MediaWiki is the software behind Wikipedia, but you can use it to create your own special-purpose sites. I’ve used it at work to build an internal company knowledge base, and I’m using it at home to make a Wiki for the fictional world of a roleplaying game I’m in.

It’s a pretty polished software package, but out of the box it tends to assume that you are creating something like Wikipedia that is visible to (and editable by) the whole wide world. If that’s not what you want, it requires some tuning, which I’ll describe in detail after the jump.

Why the Password-Protected Posts?

Things change, and change is bad.

One bad change you may have noticed is that a handful of the posts here are now password-protected. This isn’t something I’m especially happy about, since these posts are about things I think are cool, and which I want to share with everyone. But someone smart (and with a significant stake in the matter) made the case that these posts also leaked information which could put me and others at risk.

I’ve tried to adopt the most measured response that still fixes the problem: hide only the posts I have to, and put those behind a wall rather than destroy them entirely. While I hope this is the last time I’ll have to do this retroactively, we don’t always get what we want or expect.

If you see a password-protected article, and have reason to believe I know and trust you, then you can always send email and ask for the password. Unless that trust is already established, though, you’re wasting your time — if it were something I could show to just anybody, I’d already be doing that.

Backups on the Home Front

In computing, you have exactly two options: 1) Have current, working, tested backups or 2) don’t care if your data is there tomorrow. There is no third option. Pretending that there is leads only to substantial cussing.

Unfortunately, people mostly either know this already, or won’t be convinced of it until they learn from the school of bitter experience. So, this isn’t a post to try to convince you to take backups; it’s a post about how I do it, presented in the hopes that it’ll make doing so easier and safer. (As with many of my computer-related posts, the actual implementation is somewhat specific to UNIX-like systems, though many of the general principles apply universally.)

Barbarians at the gate: Excluding Bing via robots.txt

This isn’t about the variety of cherry. If you haven’t heard of Bing.com, it’s Microsoft’s recent attempt at a search engine. (If you’re curious, Google it.)

If you are not particularly pleased with the idea of a company like Microsoft making money from your creative work, then my strong suggestion is to create a robots.txt file in the root of your web-space, with contents not unlike:

User-agent: msnbot
Disallow: /

User-agent: *
Disllaow:

The robots.txt is a voluntary standard which allows web page authors to exclude search engines from part or all of their sites. There’s a helpful website that has details about why you might want to do this, and how to go about it.

Of course, there have been some allegations that Bing isn’t honoring the robots.txt standard. But announcing that they’re unwelcome is a fine symbolic act, even should they fail to honor your wishes.