Get your own LaTeX-enabled wiki in the cloud with Instiki on Heroku
Wednesday, November 21st, 2012 | Author: Konrad Voelkel
In this post, I will tell you how to run your own wiki like the nLab. [UPDATED 2013-01-07; easier fix]
To run your own wiki like the nLab (for personal or public purposes), you need a webserver, so in principle some computer which runs all day and all night with internet access, and on this webserver an installation of Ruby and Instiki (or you just have the wiki on a single computer, like your computer at work; which is what I used to have before the tablet-era). Since nowadays you can outsource this stuff, you probably just buy a virtual machine, i.e. something that feels as if someone else has a webserver reserved somewhere, running all day and all night, just for you. In fact, there might be a real computer with thousands of virtual machines running on this single computer, but you wouldn't notice. They might even spread the single virtual machine over several computers, to avoid problems if the internet connection of one single computer is flaky. That's then what they call the cloud (I'm simplifying).
The part about "buy something" feels bad, right? If you investigate a bit, it feels even worse, since the prices are not meant to be for end-consumers but for web application developers with thousands of customers, who need a big scalable architecture (unlike a single person).
Go to Heroku, those guys allow you to have one single virtual machine with Ruby support and a database (so, in principle, the possibility to install an Instiki wiki) for free. Now the bad thing is that Heroku apps have to come in a specific format, which isn't the case for Instiki (as of now, 2012-11-15). Maybe also kind of bad is that Heroku uses their own language for the cloud stuff, i.e. they call their virtual machines "dynos". But there are also good things to say: their interface looks very clean, I haven't experienced any bugs, the documentation is superb, they use GIT for version control...
If you know a tiny little bit about computers or programming (maybe even without that), you can install Instiki on Heroku, to get your personal math-wiki. Here are the steps to take (on Ubuntu Linux 12.10, by the way. I don't know of anything else, but Mac/Windows should not pose any obstacle here).
Installing Instiki on Heroku:
- Register on Heroku.
- Download the Heroku Toolbelt (which includes GIT).
- Follow the first three steps for Heroku (not Steps 1,2,3 for Ruby) in the instructions in the README in mkcode's version of the Instiki repository, section "Deploy to Heroku" only.
- Read my comment in this thread at github about a database naming problem.
- Log in into your Heroku Dashboard
- Modify your instiki/config/environments/production.rb accordingly: remove the if-statement, log to STDOUT by default.
- Now follow steps 4--end in the instructions in the README in mkcode's version of the Instiki repository, section "Deploy to Heroku".
- It should work now.
Probably soon the problem will be fixed. Then it should be possible to write a smart shell script that does everything for you. Right now I don't know enough Ruby to be smart enough to fix the database naming problem, but I know that it shouldn't be hard to do that. Maybe I should do my first github fork / pull / etc. but then I don't know the GIT details. If that happens, I will update this post.
Oh and by the way, I remember that it was once possible to get your own sub-wiki of the nLab, like Joyal's CatLab. I din't find these right now, do they still exist?
2012-11-26 (26. November 2012)
eine schöne Idee, so ein eigenes Mathe-Wiki. Würde das gerne ausprobieren und bin gerade dabei, deiner Anleitung zu folgen. Leider habe ich keine Ahnung, was ich da tue. Ich habe nichts von einer PostgreSQL-Datenbank gefunden, daraufhin ein Addon "Heroku Postgres Dev :: Crimson" hinzugefügt. War das richtig?
Nun habe ich bei den Einstellungen dieses Addons auch eine Datenbank, ist diese gemeint? Der Name steht aber nicht in NAVY oder COPPER. Und wie muss ich nun die instiki/config/environments/production.rb anpassen?
2012-11-27 (27. November 2012)
In my Heroku Dashboard, when I go to my app, I see under "Add-ons" the entry "Heroku Postgres Dev :: Copper".
Crimson is also a color (which I didn't know before), so that fits :-)
I figured that the Add-on is added automagically once one attempts to install Instiki, but maybe that isn't universally the case (it was for me, somehow).
It is the right thing you did, adding the PostgreSQL Dev database Add-on manually. Probably you can just continue using the description, by modifying in your production.rb the string "navy" to "crimson".
By the way: I found it quite easy and recommendable to install Instiki locally on your machine, to experiment a little bit. That is so easy that I didn't have to write anything about that.