Unix installation

Ubuntu server edition with fastcgi

  1. sudo apt-get install lighttpd unzip libreadline-dev build-essential libfcgi-dev

  2. wget http://luaforge.net/frs/download.php/4017/kepler-install-1.1.1-2 (or later)

  3. chmod +x kepler-install-1.1.1-2

  4. sudo ./kepler-install-1.1.1-2

  5. sudo luarocks install kepler-fastcgi

  6. sudo vim /etc/lighttpd/lighttpd.conf

    add "mod_fastcgi" to server.modules

    server.modules += ("mod_fastcgi")
    

    add

    fastcgi.server = (
                ".ws" =>
                ( "localhost" =>
                    ( "socket" => "/tmp/kepler-fastcgi.socket",
                      "bin-path" => "/usr/local/lib/luarocks/bin/wsapi.fcgi"
                    )
                )
             )
    
  7. sudo /etc/init.d/lighttpd restart

You can now test a simple hello world to make sure everything works as expected:

  1. sudo vim /var/www/hello.ws

    require "wsapi.response"
    function run(wsapi_env)
        local res = wsapi.response.new()
        res:write("Hello World!")
        return res:finish()
    end
    return run
    
  2. Navigate to http://localhost/hello.ws to make sure it displays correctly.

Note: Do not use the cgilua.fcgi binary provided with kepler unless you must. It is included right now mostly as legacy, so it is not really tuned for performance. wsapi.fcgi will provide much better performance.