我有一个新安装的服务器运行Debian挤压 。 我已经使用easy_install安装了Python 2.6.6和Trac 1.0.1 。 开始使用tracd时Trac运行良好。 现在我正在尝试使用FastCGIconfigurationlighttpd来运行Trac。 我正在使用FastCGI连接的以下configuration:
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") ) ) )
当我使用lighttpd -D -f /etc/lighttpd/lighttpd.conf启动lighttpd时,它只是打印: No such file or directory并退出。 如果我使用/usr/local/lib/python2.6/dist-packages/Trac-1.0.1-py2.6.egg/trac/web/fcgi_frontend.py直接运行后端脚本,我认为它与lighttpd的configuration没有任何关系/usr/local/lib/python2.6/dist-packages/Trac-1.0.1-py2.6.egg/trac/web/fcgi_frontend.py ,它只是打印: No such file or directory 。
有没有人有同样的问题? 我甚至从哪里开始寻找问题?
看来在使用easy_install Trac=1.0.1安装的Trac的分发中,至less是/usr/local/lib/python2.6/dist-packages/Trac-1.0.1-py2.6.egg/trac/web/fcgi_frontend.py下的FastCGI包装器脚本文件/usr/local/lib/python2.6/dist-packages/Trac-1.0.1-py2.6.egg/trac/web/fcgi_frontend.py使用CRLF行尾进行编码。 这导致shebang行不能被正确读取为内核,并导致奇怪的错误信息。
从文件中删除所有CR字符可修复问题:
$ 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