lighttpd, Anyone?

0 views
Skip to first unread message

iRiSh1

unread,
Oct 19, 2005, 12:56:26 AM10/19/05
to TurboGears
I recently discovered the all-powerful Web megaframework we call
TurboGears and am trying to tie it into the lighttpd Web server. I
have FastCGI 2.4.0 installed and lighttpd 1.4.6. on a Gentoo machine.
I have setup my Web root correctly and can load static HTML pages in
lighttpd without a problem. I have also installed TurboGears (via
easy_install) and have Python 2.4 running. I can run the
testproject1-start.py sample file (with lighttpd stopped, of course)
that was created with tg-admin quickstart and it loads CherryPy's
built-in Web server just fine. I can bring up the TurboGears template
page without a problem.

The problem comes when I try to tie together lighttpd and
TurboGears via a file socket. My lighttpd.conf loads the FastCGI
module and the fastcgi.server section is as follows:

fastcgi.server = ( ".fcgi" =>
( "localhost" =>
(
"min-procs" => 1,
"socket" => "/tmp/fcgi.sock"
)
)
)

I've "touch"ed /tmp/fcgi.sock and it's owner/group are both lighttpd.
I then slightly modified the testproject1-start.py file so that I could
tie it into lighttpd. I changed the cherrypy.server.start() line to
the following:

cherrypy.server.start(initOnly=True, serverClass=None)
from cherrypy._cpwsgi import wsgiApp
from flup.server.fcgi import WSGIServer
WSGIServer(wsgiApp,bindAddress="/tmp/fcgi.sock").run()

I can start up lighttpd with no errors. Prior to running my new .fcgi
file (now called dispatch.fcgi), any attempt to load a .fcgi file
results in entries in the lighttpd log files stating that no
fcgi-handler was found. When I try to run "python dispatch.conf"
though, I get a socket error that says "socket.error: (98, 'Address
already in use')". This error occurs when Python gets to my new
WSGIServer line. Anyone have ANY ideas? Help would be GREATLY
appreciated. Thanks! :)

Elvelind Grandin

unread,
Oct 19, 2005, 3:52:38 AM10/19/05
to turbo...@googlegroups.com
Perhaps not exactly what you want but, I use something like this for my lightttp

$HTTP["host"] == "foo.org" {
proxy.server = ( "" => (
(
"host" => "127.0.0.1",
"port" => 1082
)
)
)
--
cheers
elvelind grandin

iRiSh1

unread,
Oct 19, 2005, 7:57:42 PM10/19/05
to TurboGears
I actually figured out how to finally hook TurboGears into
lighttpd through a file socket and will try and post details later.
Contact me if you want more info. I have a new problem, however. My
main TG file (that runs the WSGIServer) is named index.py and lighttpd
is looking at that file as one of the index file names. However, even
though I now get a 404 page FROM CHERRYPY, it says it's trying to load
/index.py and can't find that path. I know that the controllers.py
file defines the structure for CherryPy, but I can't figure out how to
set up that file to intercept lighttpd's request for "index.py"... Any
ideas?

Reply all
Reply to author
Forward
0 new messages