Note: mod_lua requires Apache httpd 2.4.1 or later.
If you are downloading httpd 2.4 from a distribution set such as Debian, Red Hat, Ubuntu etc, please refer to their documentation on installing mod_lua. If you are building httpd yourself, keep reading this document.
Enabling mod_lua at compile-time can be achieved by adding
--enable-lua to the
configure command, for instance:
./configure --with-included-apr --with-mysql=/usr --enable-lua
If you prefer to manually compile, install and activate mod_lua, you can do so using apxs, by using the following command inside the mod_lua source folder (modules/lua):
apxs -c -i -a -llua mod_lua.c lua_*.c
You may need to adjust the
-llua argument, so it matches the name of your Lua library file.
To load mod_lua into httpd, add or uncomment the following line in httpd.conf:
LoadModule lua_module modules/mod_lua.so
That's it, mod_lua is installed and loaded! Check out this page for pointers on how to set up mod_lua.