Lua 5.1 Fast CGI module
C CMake
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
src
.gitignore
CMakeLists.txt
LICENSE
README.md

README.md

Lua FCGI

Lua Fast CGI module.

Tested on ubuntu

Dependencies

There are 2 dependencies needed to build this project they are:

  • Lua 5.2 development
  • Fast CGI development

You can run the following command to install dependencies

$ sudo apt-get install liblua5.2-dev libfcgi-dev lua5.2

Building

If your building on 64bit and it fails you may have to edit the Makefile to point at the right location for the liblua5.1.so file.

$ cmake ./
$ make

Running Luafcgi

Install spawn-fcgi to run the fcgi process: $ sudo apt-get install spawn-fcgi

$ spawn-fcgi -a 127.0.0.1 -p 9000 luafcgi

Nginx Setup

$ sudo apt-get install nginx

Example configuration:

server {
    listen 80;
    server_name localhost;
    root /home/www/lua;
    index index.lua;

    location / {
        try_files $uri /index.lua;
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
    }
}

On some version of nginx you will need to modify /etc/nginx/fastcgi_params:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

Examples

For example lua scripts see examples directory.

LICENSE

See LICENSE