Sunday, November 11, 2007

Getting Lua in Apache

Used the few hours i had available this weekend trying to see what options are there to get Lua running as an Apache2 module. Shortly put, i knew about two routes: Kepler's mod2 and mod_wombat (which is supposed to be part of apache some day)

Asked about the source for mod_wombat and promptly got what i needed (thanks Brian!). looked around in the docs. looks really similar to mod_python (and i guess to mod_perl??), it can keep a pool of LuaStates, with some code preexecuted on each process, and call a specified function to process client requests. just what i hoped.

now the bad news... it says "You may user (and I encourage you to!) the threaded MPMs"; but PHP5 doesn't run in a threaded apache. ??? i had no idea it was so limited! so i guess the preforked MPM is the most used apache build. who runs apache without PHP?

then came Kepler's mod2 time. i didn't have high hopes on this because the "build everything from scratch for each request" architecture in Kepler was what motivated me to write what later became Xavante.

looking around in the mod2 launcher code confirmed it: there's a small Lua layer that is clearly called with a new, clean LuaState for each request. useless.

but i also found a nice preprocessor switch: some #if LUA_STATE_PER_REQUEST and #if LUA_STATE_PER_PROCESS to change where and when are the LuaStates created! could that be what i was looking for? of course, i was sure that code would be far less tested than the 'standard' LUA_STATE_PER_REQUEST; but still it would be easier to debug it with the kepler guy's help. but... no, it can pre-create the LuaState, but it doesn't execute _any_ code! still waits for the client's request to load, compile and execute the main Lua files. Ugh.

in conclusion: it will be mod_wombat (as i could have guessed from the start); but it's a pity not to use it how the author "encourages" to do.

Saturday, November 10, 2007

PicasaWeb APIs vs. apps

Still haven't had any time to dig into the PicasaWeb API, just what i played around with the Python client library a couple of weeks ago. But what i want is just a very simple upload app for Linux... isn't there anyone? The absolute bestest would be the DigiKam plugin; is it going on? couldn't find any sign of advances there. Also, does it support uploading just lowres versions (like Picasa does)? and keeping track of what's already uploaded (like Picasa doesn't do)?

Saturday, November 3, 2007

XMP specs

Read (again) the Adobe XMP specification, seems pretty easy to use; but the "Media Management Schema" could take some work to get well integrated (since it's precisely for DAM applications).
The hardest part will be to see which attributes are used by current applications, and exactly how. Of course, there will be some inconsistencies between one app and the other (and quite probably between versions of the same app). I hope those would be non-critical.
Sábado, hay que aprovechar para avanzar con la casa.

Acabamos de regresar de Av. Iquitos, donde Carmen compró varillas para corset (que viene aplazando hace semanas). Pasamos un rato al MultiTop al frente de la ferretería donde vimos unos pisos vinílicos que le quedarían muy bien a la pared curva del baño.