Entries tagged as iphoneRelated tags
moodleSaturday, June 27. 2009Turning my iPhone into a Moodle Server
Having ended up with a spare iPhone from a recent upgrade I decided to try jail-breaking the old one and see what software was out there away from the restrictions of the app store. I discovered that lighttpd, php and sqlite were all available from the software repositories for download - these three combined are enough to run a Moodle server. So out the window went cleaning my flat and sensible tasks - I had to make my phone into a Moodle server!
Getting the software for moodle installed and configured was relatively painless, the 'cydia' software installer appears to use dpkg under the hood, so I installed openssh server and apt through the gui installer and then sshed onto the phone to do the work with a full size keyboard and the moodle server was up and running quite quickly. (More details for configuration below). Sqlite is a really interesting technology which seems to be making its way into a lot of software and I was quite interested to see Moodle support for lightweight testing sorts of applications and it has made its way into Moodle thanks to the great work of Andrei Bautu in his GSOC project last year. It only exists in the highly unstable Moodle 2.0 development branch so I needed to install this on my iPhone. Development is moving incredibly fast in the Moodle 2.0 branch so I was not at all suprised to see that the sqlite driver was not working. Sadly, despite successfully installing and passing most of the database unit tests on my development machine with sqlite, some database queries were continuing to cause the iPhone server issues. I spent some bit of time improving the sqlite driver to show more debugging information and get to the bottom of the issue. After a lot of debugging and irritation, it seems that the sqlite library version (3.3.7) linked to from php has a bug/incompatibility which means it does not like queries like: It'll report: SQLSTATE[HY000]: General error: 1 no such column: roles.userid Where as it will work fine with something like: (That was a simple example to try and find the problem - the SQL we have in moodle is a lot more complex that that). To confuse matters, the sqlite command line tool I was using to test on the phone itself was a newer version (3.6.12), which works absolutely fine with both queries. The same was true on my development machine, which meant that I could install with sqlite succesfully everywhere but the iPhone itself. While I don't yet have a working moodle server install running on the phone itself, the exercise in improving the sqlite driver has been really useful. I've updated the driver in CVS, on recent sqlite versions it is only currently failing 9 of 1298 tests. (CEIL and SUBSTR being the major issues - but they are only used for stats and the admin healthcheck) so its really looking like a really useful option for those situations where a full-grown database server is overkill. I've put a video of the (disapointing) install on youtube and you can find details of the various bits of configuration below. Configuration Details I love apt I've never configured lighttpd before, but a quick search for configuring with php and I made a very simple config with /etc/lighttpd/lighttpd.conf and /etc/lighttpd/mod_fastcgi.conf And started the webserver manually with: I created the /htdocs/ directories - and git cloned moodle into /htdocs/moodle and created the moodle config file as mentioned in the sqlite moodle docs: Oh and I was also naughty and made the 'zip' php extension an optional item (as it wasn't in the packed php version):
Enjoy!
(Page 1 of 1, totaling 1 entries)
|
QuicksearchShow tagged entriesSyndicate This Blog |