Results 1 to 6 of 6

Thread: Apache/Mod-WSGI incompatibility

  1. #1
    Join Date
    Nov 2008
    Location
    Darmstadt/Hessen/Germany
    Posts
    2

    Default Apache/Mod-WSGI incompatibility

    Hi,

    I have springpython 1.0.0 RC1 running on an Apache/Mod-WSGI installation.
    The default policy of mod_wsgi is to restrict stdin/stdout/stderr as an application should not require to read/write on these filehandles.

    As springpython uses amara (and amara uses 4suite-xml) the problematic part is

    Ft/Xml/Sax.py", line 247

    where 4suite-xml initializes a SaxPrinter with default filehandle sys.stdout.

    Not really a direct springpython/4suite-xml/mod_wsgi problem
    But it's one

    Current workaround:

    Set "WSGIRestrictStdout Off" in the Apache central module config.

    4suite-xml: 1.0.2-5
    OS: Debian Etch

    Regards

    Sven

  2. #2
    Join Date
    Aug 2006
    Posts
    382

    Default

    Swen,

    I'm glad you found a work around. I have posted a comment on the 4Suite-XML mailing list, linking back to this discussion thread. To be honest, I haven't actually used Spring Python in an apache configuration, so I'm eager to see that it works out well.
    Greg L. Turnquist (@gregturn), SpringSource/VMware
    Project Lead: Spring Python and author of Spring Python 1.1 and Python Testing Cookbook.
    Listen to Pond Jumpers, the international podcast for open source developers.
    These comments are my own personal opinions, and do not reflect those of my company.

  3. #3
    Join Date
    Feb 2009
    Posts
    3

    Default

    Quote Originally Posted by swilhelm View Post
    Hi,

    I have springpython 1.0.0 RC1 running on an Apache/Mod-WSGI installation.
    The default policy of mod_wsgi is to restrict stdin/stdout/stderr as an application should not require to read/write on these filehandles.

    As springpython uses amara (and amara uses 4suite-xml) the problematic part is

    Ft/Xml/Sax.py", line 247

    where 4suite-xml initializes a SaxPrinter with default filehandle sys.stdout.

    Not really a direct springpython/4suite-xml/mod_wsgi problem
    But it's one

    Current workaround:

    Set "WSGIRestrictStdout Off" in the Apache central module config.

    4suite-xml: 1.0.2-5
    OS: Debian Etch
    I agree that an app shouldn't require use of standard file handles, but there should be no problem with optionally accessing them, and in Amara, it's optional (the default).

    Does the mod_wsgi problem manifest with an error if sys.stdout is even accessed? If so, I think that's overly harsh, and would be a problem for a lot of programs. Even if that's the case, I can place a workaround in Amara, depending on how best to send a signal to Amara through mod_wsgi. For example, is there an environment variable we could check at module level to detect mod_wsgi and avoid touching sys.stdout at all?

  4. #4
    Join Date
    Aug 2006
    Posts
    382

    Default

    If it makes you feel any better, there are plans to migrate from amara to elementTree. Several issues have been generated due to the C extensions in amara. a) Can't run SP in google app engine and b) can't run SP in jython.

    See http://jira.springframework.org/brow...INGPYTHONPY-98 for more info.
    Greg L. Turnquist (@gregturn), SpringSource/VMware
    Project Lead: Spring Python and author of Spring Python 1.1 and Python Testing Cookbook.
    Listen to Pond Jumpers, the international podcast for open source developers.
    These comments are my own personal opinions, and do not reflect those of my company.

  5. #5
    Join Date
    Jan 2011
    Posts
    2

    Default

    I just configured to spring python 1.0.0 RC1 mine is running on apache/mod –wsg installation. I never thought about this problem until I read your post. but your work around is not working for me, I cant access the apache central module config to turn std out off. Isn’t there a method in spring python to change properties after configuration using after set properties command?
    Hello World

  6. #6
    Join Date
    Aug 2006
    Posts
    382

    Default

    Winterman,

    I am curious if you have the same problems working with Apache when using Spring Python 1.2.0.FINAL. There have been considerable changes made, so I don't know the status of running SP inside Apache.
    Greg L. Turnquist (@gregturn), SpringSource/VMware
    Project Lead: Spring Python and author of Spring Python 1.1 and Python Testing Cookbook.
    Listen to Pond Jumpers, the international podcast for open source developers.
    These comments are my own personal opinions, and do not reflect those of my company.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •