Found this.

http://code.google.com/p/isapi-wsgi/issues/detail?id=2

Turns out to be a known bug with isapi-wsgi.  There is a suggested fix  
that I'm trying now.

-KIRBY

On Feb 26, 2009, at 3:38 PM, Kirby Turner wrote:

>
> Unfortunately it doesn't help but gives me something more to
> research.  I'll also post a message to the isapi-wsgi group to see if
> someone there has encountered this issue before.
>
> Thanks,
> -KIRBY
>
>
> On Feb 26, 2009, at 3:04 PM, mdipierro wrote:
>
>>
>> Does hits help?
>>
>> http://www.usenet-forums.com/php-language/24828-remote_addr-iis.html
>> http://wiki.pylonshq.com/display/pylonscookbook/Serving+a+Pylons+app+with+IIS
>>
>> It seems in IIS ISAPI environment variables are not the environment
>> being bassed.
>>
>> Massimo
>>
>>
>> On Feb 26, 1:39 pm, Kirby Turner <ki...@thecave.com> wrote:
>>> Thanks Massimo.  Another step closer.  I made the recommended  
>>> changes
>>> and now I get a new error message:
>>>
>>> Traceback (most recent call last):
>>>  File "C:\Python25\lib\wsgiref\handlers.py", line 92, in run
>>>    self.result = application(self.environ, self.start_response)
>>>  File "gluon\rewrite.py", line 129, in <lambda>
>>>    wsgibase_new=lambda e,r: wsgibase(filter_in(e),r)
>>>  File "gluon\rewrite.py", line 50, in filter_in
>>>    key=e['REMOTE_ADDR']+':'+path
>>> KeyError: 'REMOTE_ADDR'
>>>
>>> I tested from both the local machine and a remote machine and got  
>>> the
>>> same message.
>>>
>>> -KIRBY
>>>
>>> On Feb 26, 2009, at 11:25 AM, mdipierro wrote:
>>>
>>>
>>>
>>>> Try change
>>>
>>>>  sys.argv = ['']
>>>
>>>> into
>>>
>>>>  sys.argv = ['web2py.py']
>>>
>>>> and
>>>
>>>>  application=ExecuteOnCompletion2(gluon.main.wsgibase, callback)
>>>
>>>> into
>>>
>>>>  application=gluon.main.wsgibase
>>>
>>>> You'd lose the ability to run cron jobs but once the problem is
>>>> isolated we can fix it.
>>>> Let us know.
>>>
>>>> Massimo
>>>
>>>> On Feb 26, 8:07 am, Kirby Turner <ki...@thecave.com> wrote:
>>>>> Hi All,
>>>
>>>>> I feel close to having this working using IIS6+isapi-wsgi+web2py
>>>>> +mssql.  I have encountered an issue within web2py and I'm not  
>>>>> sure
>>>>> how to get around it.  I'll talk about the error at the end of  
>>>>> this
>>>>> message, but first here is the basics for setting up isapi-wsgi
>>>>> with
>>>>> web2py under IIS.  I can provide better documentation later  
>>>>> after I
>>>>> have everything working.  (Note: I have only tested under IIS6.)
>>>
>>>>> My goal is to use isapi-wsgi + web2py under IIS.  To accomplish
>>>>> this
>>>>> you must install the following (in this order):
>>>
>>>>> Python 2.5.4http://python.org
>>>
>>>>> Python for Windows Extensionshttp://sourceforge.net/projects/pywin32/
>>>
>>>>> isapi-wsgihttp://code.google.com/p/isapi-wsgi/
>>>
>>>>> There is a known bug using Python for Windows Extensions through
>>>>> ISAPI
>>>>> using Python 2.6.1.  This bug has been fixed in the [yet to be
>>>>> released] Python 2.6.2 and Python 3.0.1.  This is really not an
>>>>> issue
>>>>> for web2py developers because web2py doesn't yet support these 2
>>>>> versions of Python.  Still it's good to know (for people like
>>>>> me<grin>).  More information on the bug is available here:
>>>
>>>>> http://sourceforge.net/tracker/index.php?
>>>>> func=detail&aid=2609380&grou...
>>>
>>>>> I created a new handler called isapi-wsgihandler.py (see attached)
>>>>> that is based on web2py's own wsgihandler.py and added it to the
>>>>> root
>>>>> web2py directory.  To install this ISAPI extension and setup a
>>>>> website
>>>>> under IIS, execute the following command line:
>>>
>>>>> python isapi-wsgihandler.py install
>>>
>>>>> This will setup a virtual directory under IIS called web2py.  The
>>>>> virtual directory name is set in the isapi-wsgihandler.py and the
>>>>> local URL is:
>>>
>>>>> http://localhost/web2py/
>>>
>>>>> To remove the site and uninstall the ISAPI extension from IIS,
>>>>> execute
>>>>> the following command line:
>>>
>>>>> python isapi-wsgihandler.py remove
>>>
>>>>> To see error messages and print statements while testing the
>>>>> website
>>>>> under IIS run Win32TraceUtil.py found in the directory C:
>>>>> \Python25\Lib
>>>>> \site-packages\win32\lib.
>>>
>>>>> Okay, that's it for the setup.  Now on to the issues I encountered
>>>>> with web2py.
>>>
>>>>> I received an error within web2py that said sys.argv did not  
>>>>> exists
>>>>> so
>>>>> I added the following to isapi-wsgihandler.py:
>>>
>>>>> sys.argv = ['']
>>>
>>>>> This fixed the problem but I'm not sure of the impact.  After  
>>>>> doing
>>>>> this I now get this error message:
>>>
>>>>> Traceback (most recent call last):
>>>>> File "C:\Python25\lib\wsgiref\handlers.py", line 92, in run
>>>>>   self.result = application(self.environ, self.start_response)
>>>>> File "gluon\contrib\wsgihooks.py", line 33, in __call__
>>>>>   self.__callback(self.__environ)
>>>>> AttributeError: ExecuteOnCompletion2 instance has no attribute
>>>>> '_ExecuteOnCompletion2__environ'
>>>
>>>>> I'm not sure how to get around this issue.  Any suggestions on a
>>>>> fix?
>>>
>>>>> That's the status so far.  As I said I feel like this is very  
>>>>> close
>>>>> to
>>>>> working, which will be great.
>>>
>>>>> Meanwhile, I'm still waiting to hear back from my customer with a
>>>>> yay
>>>>> or nah to use python + web2py instead of ASP.NET MVC.  At the
>>>>> moment
>>>>> it looks like the customer is going to okay the move, which will
>>>>> make
>>>>> me very happy even if I have to host the app under IIS.
>>>
>>>>> Thanks,
>>>>> -KIRBY
>>>
>>>>> isapi-wsgihandler.py
>>>>> 1KViewDownload
>>>
>
>
>
> >



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to