Stopping spam on my private wiki

Some fucker spammed my private wiki with loads of links. I suspect it was some kind of spamming robot. Anyway, that’s gotta stop. Fortunately, since it’s a private wiki, I don’t need to leave access open to people. That being the case, what I want to do is enforce authentication on URLs with @edit in them. This is done using the Apache LocationMatch directive: I added the following into the VirtualHost section that defines kryogenix.org in my httpd.conf.

<LocationMatch "wiki/@edit">
 AuthType Basic
AuthName "No spam"
AuthUserFile /var/www/kryogenix.org/html/wiki/.htpasswd
Require valid-user
</LocationMatch>

The really annoying thing is that you can’t use LocationMatch in a .htaccess file. Why? Why does this require me to have root access to edit the main server configuration file? It’s really bloody irritating.

I'm currently available for hire, to help you plan, architect, and build new systems, and for technical writing and articles. You can take a look at some projects I've worked on and some of my writing. If you'd like to talk about your upcoming project, do get in touch.

More in the discussion (powered by webmentions)

  • (no mentions, yet.)