Opened 4 years ago

Closed 3 years ago

#262 closed defect (fixed)

pycsw mod_wsgi vs CGI

Reported by: TC Haddad Owned by: Jeff McKenna
Priority: critical Milestone: 4.0.5 release
Component: MS4W - Packages Version: 4.0.3
Keywords: Cc:
Blocked By: Blocking:

Description

The pycsw section of the ms4w readme state that pycsw uses mod_wsgi, and the readme section for confirming mod-wsgi is very thorough for confirming if mod_wsgi is actually loaded and working.

However the httpd.conf file contains 2 sections for running pycsw:

  • run pycsw through mod_wsgi (around line 626)
  • run pycsw through CGI (around line 634)

As installed by the installer, the block for "run pycsw as CGI" is uncommented, while the block for "run pycsw through mod_wsgi" is commented out.

Neither the pycsw or the mod_wsgi section of the ms4w docs mention the need to uncomment the "run pycsw through mod_wsgi" block, although presumably this is necessary?

Just thought this could be clarified for new users.

Change History (8)

comment:1 by Jeff McKenna, 4 years ago

You noticed :)

Actually this is because the initial MS4W version that included pycsw was configured (and working) with mod_wsgi - but when I upgraded to the pycsw 2.4.2 release the GetCapabilities would hang, when configured for mod_wsgi, so I changed it to CGI when releasing MS4W.

I updated the pycsw section in the readme to mention that CGI is configured by default.

More testing needs to be done with the Apache hang with 2.4.2, and reported to the pycsw community.

comment:2 by Jeff McKenna, 4 years ago

Summary: pycsw configuration vs documentationpycsw mod_wsgi vs CGI

comment:3 by Jeff McKenna, 4 years ago

Milestone: 4.0.4 release4.0.5 release

comment:4 by Jeff McKenna, 3 years ago

This needs to be tested with pycsw 2.6.0, released today (ticket #300)

comment:5 by Jeff McKenna, 3 years ago

Priority: minorcritical

comment:6 by Jeff McKenna, 3 years ago

Component: MS4W - BaseMS4W - Packages

comment:7 by Jeff McKenna, 3 years ago

!!! I've been working hard on this bug, for the MS4W 4.0.5 release with pycsw 2.6.0 & mod_wsgi, with Apache hanging and not giving any debug messages...

It can be solved with one line in httpd.conf (!!) with a specific WSGIApplicationGroup setting :

# run pycsw through mod_wsgi
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias /pycsw /ms4w/apps/pycsw-2.6.0/pycsw/wsgi.py
SetEnvIf Request_URI "/pycsw$" PYCSW_CONFIG=/ms4w/apps/pycsw-2.6.0/default.cfg
<Directory /ms4w/apps/pycsw-2.6.0/pycsw>
 Order deny,allow
 Allow from all
</Directory>

This forces the WSGI application to run in Python's main interpreter, to avoid third party Python packages causing 'thread deadlock' or crashes.

Last edited 3 years ago by Jeff McKenna (previous) (diff)

comment:8 by Jeff McKenna, 3 years ago

Resolution: fixed
Status: newclosed

This is fixed for MS4W 4.0.5 release today. (new pycsw 2.6.0 is through Apache mod_wsgi by default again)

Note: See TracTickets for help on using tickets.