0

I’m setting up a simple web server on my Raspberry Pi and I can’t seem to set up lighttpd, fastcgi, and flask correctly.
By now, I’ve gone through a few iterations of /etc/lighttpd/lighttpd.conf, the most recent one being
fastcgi.server = (“/test” =>
“test” => (
“socket” => “/tmp/test-fcgi.sock”,
“bin-path” => “/var/www/py/test.fcgi”,
“check-local” => “disable”
)
)

That spat out an error on /etc/init.d/lighttpd start. The first line looked wrong, so I added a set of parens after the fat arrow:
fastcgi.server = (“/test” => (

))

This didn’t spit out an error, but when I tried to connect, I get ERR_CONNECTION_REFUSED in Chrome. Then I tried removing “/test” =>, and that had the same problem. I have also tried the config shown in this question, and the same problem occurred.
In /var/www/py/test.fgci:
#!/usr/bin/python
from flup.server.fcgi import WSGIServer
from test import app

WSGIServer(app, bindAddress=”/tmp/test-fcgi.sock”).run()

In /var/www/py/test.py:
from flask import Flask
app = Flask(__name__)

@app.route(“/test”)
def hello():
return “

☭ hello, comrade ☭

The current lighttpd.conf fails when I start it with /etc/init.d/lighttpd start.

Kuldeep Baberwal Changed status to publish February 17, 2025