views:

21

answers:

1

I have the following setup - and don't get any response when I visit the server in a browser.

Should I expect some? Here's the test setup, using python & flup.

#test.py

def myapp(environ, start_response):
  start_response('200 OK', [('Content-Type', 'text/plain')])
  return ['abc\n']

import os
os.environ['FCGI_WEB_SERVER_ADDRS']="127.0.0.1:8000"
from flup.server.fcgi import WSGIServer
WSGIServer(myapp, bindAddress=('127.0.0.1',8000)).run()

python test.py

lynx http://127.0.0.1:8000

unexpected network read error; connection aborted

if i comment out the OS stuff and restart server:

lynx http://127.0.0.1:8000

HTTP request sent; waiting for response.

and nothing ever returns.

+1  A: 

Your FCGI server does not speak HTTP. You need an HTTP proxy that can speak FCGI. You can run something like nginx that does speak HTTP and can pass through to FCGI.

http://wiki.nginx.org/NginxFcgiExample

dietbuddha
thanks. the thing that was getting me was how it doesn't return anything at all, even if you telnet into it.
fastmultiplication