I could compile Apache 2.3 and link mod_lua against LuaJIT 2.0b6 such as this:
LUA_LIBS="-L/usr/local/lib -lluajit-51 -lm" \ LUA_CFLAGS="-I/usr/local/include/luajit-2.0" \ ./configure --prefix=/usr/local \ --enable-lua --with-lua=/dev/null --enable-luajit make
So far as I will tell, despite the fact that there's an
--enable-luajit configuration flag, the mod_lua config.m4 script only searches for lua libraries automatically.
Should you built LuaJIT like a dynamic library in addition to a static library, you might want to clearly link it statically:
(You might want to alter the pathways based on which version of LuaJIT you've installed, and where. Caveat lector: I did not really install and try out the outcomes of this.)