Articles
Software
Gallery
Other works
Contacts

#Lighttpd relative FCGI example.html



            -lighttpd.conf
            {
                server.modules = (
                    "mod_fastcgi",
                    "mod_rewrite",
                    "mod_setenv"
                )

                server.document-root = var.CWD
                server.port = 5050

                url.rewrite-once = (
                    "/" => "/myfcgi.pl"
                )

                setenv.add-environment = (
                    "PERL5LIB" => env.PERL5LIB
                )

                fastcgi.server = (
                    "/myfcgi.pl" => ((
                        "bin-path" => "myfcgi.pl",
                        "socket"   => "myfcgi.sock",
                    ))
                )
            }
            -myfcgi.pl:
            {
                #!/usr/bin/perl

                use FCGI;

                my $request = FCGI::Request();

                while ($request->Accept() >= 0) {
                    print "Content-Type: text/plain\r\n\r\n";
                    print "Hello, World!\n";
                }
            }
            $ lighttpd -D -f ./lighttpd.conf
            >and it just werks™