Questions tagged [mod-lua]

New Apache server module which provides Lua hooks into various portions of the httpd request processing

This module allows the server to be extended with scripts written in the Lua programming language. The extension points (hooks) available with mod_lua include many of the hooks available to natively compiled Apache HTTP Server modules, such as mapping requests to files, generating dynamic responses, access control, authentication, and authorization.

NOTE

mod_lua is still in experimental state. Until it is declared stable, usage and behavior may change at any time, even between stable releases of the 2.4.x series. Be sure to check the CHANGES file before upgrading.

16 questions
3
votes
2 answers

Can't connect to postgresql from mod_lua

I've downloaded and installed Apache 2.4.4 (which now comes with mod_lua module). Enabled it like so: --httpd.conf-- LoadModule lua_module modules/mod_lua.so AddHandler lua-script .lua and ran a simple script and it works.…
Sunder
  • 1,445
  • 2
  • 12
  • 22
3
votes
3 answers

lua embeded in html with apache

Apache has mod_lua. Is there a way to have it process an html page with a like tag similar to php? If not is there some other method? (I've seen mod_plua but it doesn't seem to have much work towards it).
jsmdnq
  • 363
  • 2
  • 10
2
votes
1 answer

apache 2.4 - Cant get Sybase database connection using mod_lua, mod_dbd, freetds

We are migrating our python scripts to lua scripts as part of apache 2.4 upgrade. One of the requirement is connecting to Sybase database and execute queries. To do that we have developed a small code using mod_lua api to get db connection, but we…
Abir
  • 33
  • 5
2
votes
1 answer

3rd party libraries works with lua, not with mod_lua

I've read this and: There's no working solution proposed I'm not running Windows but Linux It's a home-made compilation running httpd-2.4.9 So here's what I tried so far, but without success: follow this suggestion "where do I put 3rd party lua…
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213
1
vote
0 answers

Apache 2.4 + mod_lua: share state between requests

Imagine you want to write your own rate limiter for Apache 2.4 based on mod_lua. The idea would be to limit the requests per time interval per IP. For this task you need to maintain a globally accessible data structure which contains for example the…
samba2
  • 468
  • 7
  • 15
1
vote
1 answer

Using mod_lua how do I write in apache's error_log without using the request_rec object?

I know I can log using r:debug(),r:info() etc in error_log.But there are places in my code where I don't want to pass around the request. Is there something like mod_python's apache.log_error() in mod_lua to achieve this?
callow
  • 517
  • 1
  • 4
  • 15
1
vote
1 answer

Read response body in Apache mod_lua

I'm prototyping a simple "output" filter with Apache + mod_lua. How can I read response body, at the end of other native output filters applied, via LUA? For example, can I get the actual response that will be sent to the client?
Carmine Giangregorio
  • 943
  • 2
  • 14
  • 35
0
votes
1 answer

Getting Error When Building Apache2 on Solaris Server

I am building Apache2 (ver - 2.4.41) on Solaris server. /usr/sfw/bin/gmake Getting below error : ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status gmake[4]: *** [mod_lua.la] Error…
Arif
  • 1
0
votes
1 answer

Determine variable from uri pattern (Apache)

Actually we are using an Apache webserver to host our REST-API. Scripts are written in Lua and mapped with mod-lua. For instance an actual snippet from the httpd.conf: [...] LuaMapHandler /restapi/(v\d{3})/(\w+)…
csaar
  • 530
  • 5
  • 22
0
votes
1 answer

Symbol not found: _ap_lua_init_mutex when loading mod_lua

I have Apache httpd server installed via Homebrew. I tried compiling mod_lua by running apxs -i -a -c mod_lua.c But httpd is failing to start with error Cannot load /usr/local/lib/httpd/modules/mod_lua.so into server: …
Joyce Babu
  • 19,602
  • 13
  • 62
  • 97
0
votes
1 answer

Apache HTTPD mod_lua parseargs mutlivalue table not storing all values

I am currently writing a test harness that introduces delays, failures and proxying using httpd with LUA scripts. This includes the parsing of the querystring which could contain multiple values for the same tag ie:…
0
votes
0 answers

xampp - How to define a driver for MySQL?

I have been trying to use the mod_lua dbacquire function to operate an example mysql database... https://httpd.apache.org/docs/trunk/mod/mod_lua.html#databases I have uncommented what I needed in the httpd.conf file to enable mod_dbd. At the…
A1.exe
  • 331
  • 2
  • 10
0
votes
0 answers

Is lua-lru thread-safe?

I found a Lua LRU cache implementation here lua-lru Is this thread-safe, can this be used with mod_lua?
callow
  • 517
  • 1
  • 4
  • 15
0
votes
2 answers

Unable to get data from PostgreSQL using mod_lua

This is my setup: OS: Linux Ubuntu 14.04 64bit DB: Postgres 9.4 (installed from official Postgres repo) Apache: 2.4.7 with mod_lua manually compiled from source in Apache 2.4.20 and installed Database init script is as follows: CREATE TABLE users ( …
Darko Miletic
  • 1,168
  • 1
  • 13
  • 21
0
votes
1 answer

How to add a query string like QSA flag of mod_rewrite when using mod_lua in Apache?

I want to write a script that rewrite a URL in mod_lua, that is I want to inherit the query string like QSA flag of mod_rewrite. mod_rewrite config: RewruteCond ^/foobar/([0-9A-Za-z]+)/(.+)$ RewriteRule ^.*$ /foobar/$2?_ID_=$1 [QSA,L] I try to code…
user5087813
1
2