I'm running web.py with lighttpd with very similar config to what's suggested on the website. When I run it with /etc/init.d/lighttpd start I get these errors in the logs:
2022-11-07 21:30:59: (gw_backend.c.528) connect /tmp/fastcgi.socket-0: Connection refused
2022-11-07 21:30:59: (gw_backend.c.371) child exited: 1 unix:/tmp/fastcgi.socket-0
2022-11-07 21:30:59: (gw_backend.c.512) new proc, socket: 0 /tmp/fastcgi.socket-0
2022-11-07 21:30:59: (gw_backend.c.528) connect /tmp/fastcgi.socket-0: Connection refused
2022-11-07 21:30:59: (gw_backend.c.371) child exited: 1 unix:/tmp/fastcgi.socket-0
It works when I test it with lighttpd -D -f /etc/lighttpd/lighttpd.conf.
My python file starts with #!/usr/bin/env python3 and is executable.
The program was failing because environment variables weren't being passed. I don't love the current resolution, and I plan on coming back to it later. For now, I set environment variables in
lighttpd.conf. In/etc/lighttpd/lighttpd.conf(good links for reference webpy.org ongspxm.gitlab.io):To debug this I made a simple web.py app (mostly from the homepage) and outputted the environment variables. It might help you debug:
More info on REAL_SCRIPT_NAME: lighttpd, mod_rewrite, web.py
/etc/init.d/lighttpd statuswas helpful for figuring out the issue.Changing#!/usr/bin/env python3to#!/usr/bin/env python3.10fixed it. Unfortunately I'm not sure why.