Hey Joe.
Joe Van Andel wrote:
> I'm using Python 1.5.2 on Redhat 6.2, and am trying to use FastCGI with
> Webware-0.4.1
>
> I'm just trying out Webware and got the 'OneShot' adapter working. Now,
> I want to try out FastCGI. I've built the FastCGI loadable module for
> Apache, and tried to use FCGIAdapter.py.
>
> Apache's server log shows that FCGIAdapter failed on
> 'import fcgi'
>
> I didn't see any indication that I was supposed to install this Python
> module, and it doesn't appear that FCGIAdapter.py sets its 'sys.path' to
> include /<prefix>/WebKit. So, I copied fcgi.py to
> /usr/lib/python1.5/site-packages.
Sorry, this resulted from some confusion on whether we would include
fcgi.py in the distribution or require users to go get it. I originally
intended for you to go get it from Robin Dunn's site, so he would get
credit, but that looked like a pain, so we stuck in the distribution, but
forgot to mention that it needs to be moved to a location in your python
path.
>
>
> Also, I didn't see the documentation on what <prefix>WebKit/address.text
> should contain. Seems like you should provide a default version of this
> file.
This file is generated automatically by the adaptor when it starts. There
is no need for a default.
At the top of FCGIAdaptor.py, there is a variable named WebKitDir. Set
that to point to the location of the Webkit directory, ie
WebKitDir="/usr/local/Webware/WebKit". Then the file address.text will be
generated and put in the correct place.
>
>
> Once I generated address.text, containing:
> localhost:8086
>
> I then invoked FCGIAdapter.fcgi
You can't invoke it directly. You have to call it through mod_fcgi.
>
>
> My browser showed:
> ERROR
>
> Traceback (innermost last):
> File "/etc/httpd/cgi-bin/FCGIAdaptor.fcgi", line 130, in FCGICallback
> s.send(dumps(dict))
> ValueError: unmarshallable object
>
> You can't call this from the command-line
> ------------------------------------------------
>
> Why can't 'dict' be marshalled, so it can be sent on a socket?
Your server tried to invoke FCGIAdaptor.py as a straight cgi, not through
mod_fcgi. You need to set up the correct mapping for the file in your
http.conf file. Have a look at the top of FCGIAdaptor.py for examples.
>
>
> The error handling in AppServer could be improved, since this error in
> FCGIAdapter caused an error in AppServer.
> --------------------------------------------------
>
> BEGIN REQUEST
> Mon Oct 9 18:45:51 2000
> receiving request from <socket object, fd=7, family=2, type=1,
> protocol=0>
> received 0 bytes
> Exception in thread Thread-1:
> Traceback (innermost last):
> File "/var/tmp/python/python-root/usr/lib/python1.5/threading.py",
> line 376, in __bootstrap
> self.run()
> File "/var/tmp/python/python-root/usr/lib/python1.5/threading.py",
> line 364, in run
> apply(self.__target, self.__args, self.__kwargs)
> File "ThreadedAppServer.py", line 121, in threadloop
> rh.handleRequest()
> File "ThreadedAppServer.py", line 257, in handleRequest
> transaction = self.server._app.dispatchRawRequest(dict)
> NameError: dict
> -----------------------------------------------------
>
> When I look at the ThreadedAppServer.py, 'dict' only gets set if 'data'
> exists, but the statement:
>
> transaction = self.server._app.dispatchRawRequest(dict)
>
> uses 'dict', even if 'dict' isn't set.
>
> What am I doing wrong, or is there
Let me know if the suggestions above don't work.
We will improve the documentation on this. Thanks for pointing this out.
Jay Love
|