I really hate it when system configuration gets in the way of programming. I've read several books that have recommended using a personal wiki to capture all of your thoughts. And I actually set one up a few years ago, but the data got stale as I didn't keep it up. So when I got my new 64 bit quad core computer, I decided it was time to restart a wiki.
My desire was to keep the deployment fairly simple and use technologies I knew or wanted to learn. That seemed like a simple enough task, so last Friday I looked up "Wiki" on wikipedia and took a look at their comparisons.
My criteria was it had to be either Ruby or Java based, since I already knew those environments and the goal of this effort was to get going quickly, not learn a new technology. It had to use MySQL as the database, since I already had that installed and had backup routines for it. Finally, it had to be simple to install. My main goal was to get a wiki running so I could capture all the is "yellow sticky notes" I had scattered on my desk and in some sort of meaningful way.
I should also note, at my work I use strictly Windows and run a personal wiki there for work stuff only. This has turned out very helpful as I am a big proponent of the "Getting Things Done" process (look up GTD if you don't know what this is) and a wiki fits real well in that method of organizing.
Sooo, one would think that it wouldn't be that hard to set up a wiki server at home. Boy was I wrong. Here it is almost a week later and I have just finally got back to working on my current Flex project.
Anyway, I narrowed down the choices to XWiki Workspaces, instiki, and JSPWiki.
I first tried to get instiki running as it is a Rails based wiki and I knew that would be the easiest. Well out of the box it worked great, except that it defaulted to using SQLite. SQLite is a file based database, and I wanted to only have to maintain one database in a central location. My database of choice is MySQL, mostly because I learned that one first, (Oh and it is free). So I found on the instiki site instructions for setting up MySQL. I configured my database.yml file as recommended and launched the app. Nothing happened.
It was supposed to deploy the database automatically. Ok, duh, I needed to setup the database in MySQL first. So I went back and did that, launched the app again and again nothing happened. After poking around a bit more I realized I needed to use their run script not the normal "ruby script/server" command. Again it failed. Ok, so I must need to migrate the database first. So I ran "rake db:migrate" restarted the application, and again nothing.
Note, when I say nothing, what I mean is no tables were created even though the app came up and seemed to be happy. Also keep in mind that each time it failed, I had to do some serious googling and to try to understand what I should have been doing. So this "quick" project was turning into a bit of a monster.
I ended up poking around in the db directory and I couldn't understand why I got a sqllite_development file (that is the file for the development environment). But this was the clue I needed.
It turned out what was happening was when I ran the instiki startup script it was starting in production mode. That makes sense now, and I guess if I had looked at the log closer . . . Anyway, when I ran the "rake db:migrate" task even though I had set the RAILS_ENV environment variable to be "production" the rake task was using "development" as the default. Soooo, after more googling, I found out what I should have been running was "rake db:migrate RAILS_ENV=production". Once I did that, things began working.
That was Friday's effort (5 hours shot).
On Saturday it was XWiki's turn. It requires an app server. But comes with a prepacked version. So I tried that first. Nope didn't work. Did I mention I was running a 64-bit machine. Incidentally, 64-bit machines come with 64-bit binaries and more importantly a 64-bit jdk.
Not to worry, I've used JBoss before so I figured I'd just load that up and drop the war version of XWiki into the deploy directory and off I go. So I dutifully loaded up the latest version of JBoss, (5.1.0). Nope, class not found exceptions. Google, google, google.
Ok, finally, even though I didn't like it, it felt like I needed to drop back to JBoss 4, since that's what the install documents recommended. So I grudgingly loaded up JBoss 4.2.3. Being a geek at heart, I feel on my home server I want to be little more on the cutting edge than normal. My mistake. Since it had been a while since my last JBoss project (4 years), I had to relearn how to setup the datasource. But by Sunday I finally had XWiki running. . . locally. Next I had to make it available globaly. I'll leave that to a future post.
No comments:
Post a Comment