1

I have a freshly installed server running Debian squeeze. I've installed Python 2.6.6 and Trac 1.0.1 using easy_install. Trac runs fine when started using tracd. Now I'm trying to configure lighttpd to run Trac using FastCGI. I'm using the following configuration for the FastCGI connection:

fastcgi.server = (
    "/project" => (
        (
            "socket" => "/tmp/trac-fastcgi-first.sock",
            "bin-path" => "/usr/local/lib/python2.6/dist-packages/Trac-1.0.1-py2.6.egg/trac/web/fcgi_frontend.py",
            "check-local" => "disable",
            "bin-environment" => ("TRAC_ENV" => "/var/trac/project")
        )
    )
)

When I start lighttpd using lighttpd -D -f /etc/lighttpd/lighttpd.conf, it just prints : No such file or directory and exits. I don't think it has anything to do with the configuration of lighttpd, if I run the backend script directly, using /usr/local/lib/python2.6/dist-packages/Trac-1.0.1-py2.6.egg/trac/web/fcgi_frontend.py, it prints just that : No such file or directory.

Has anyone had the same problem? And where do I even start looking for the problem?

1 Answers1

0

It seems that in the distribution of Trac installed using easy_install Trac=1.0.1, at least the FastCGI wrapper script file under /usr/local/lib/python2.6/dist-packages/Trac-1.0.1-py2.6.egg/trac/web/fcgi_frontend.py is encoded using CRLF line endings. This results in the shebang line not being read correctly be the kernel and results in the strange error message.

Removing all CR characters from the file fixes the problem:

$ cd /usr/local/lib/python2.6/dist-packages/Trac-1.0.1-py2.6.egg/trac/web/
$ tr -d '\r' < fcgi_frontend.py > fcgi_frontend.py~
$ mv fcgi_frontend.py~ fcgi_frontend.py
$ chmod a+x fcgi_frontend.py