Here's a working install script for Ubuntu 12.04 LTS:
Maybe not so useful with Danbooru 2 nearing completion, but I figured I'd post it here for posterity's sake anyway. I haven't tested it on any other versions, but it should be pretty easy to adapt. You should create a user named danbooru beforehand and then run this script as root.