Eubolist's Blog

about IT, Linux, the web and much more

Posts Tagged ‘Developer

A simple way to enable .py Python CGI scripts on Lighttpd (“Lighty”) webserver on Ubuntu

leave a comment »

After multiple, failed, attempts with mod_fastcgi I found a simple three step solution to enable python scripts on my webserver:

  1. sudo ln -s /etc/lighttpd/conf-available/10-cgi.conf /etc/lighttpd/conf-enabled/
  2. Add the following section to your /etc/lighttpd/lighttpd.conf file:
    ### Python Config ###
    cgi.assign = (

    “.py” => “/usr/bin/python”
    )
  3. Restart lighty: sudo /etc/init.d/lighttpd restart


That should do the trick. As it says in the title, this is a simple and painless way to enable Python CGI scripts on lighty.

Written by eubolist

2010/06/13 at 15:06