Skip to content

Latest commit

 

History

History
63 lines (39 loc) · 1.18 KB

README.md

File metadata and controls

63 lines (39 loc) · 1.18 KB

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