Re: Apache 2.4.3 32-bit (ApacheHaus) with mod_wsgi 3.4 on Windows 7 failing silently

1,048 views
Skip to first unread message

David McKeone

unread,
Sep 2, 2012, 5:19:08 PM9/2/12
to mod...@googlegroups.com
I just realized that I left out a little detail;  I'm not getting any error messages in error.log or EventViewer.  Also wanted to ask, is anyone successfully running this setup (or something similar), or is it just me seeing this?

Graham Dumpleton

unread,
Sep 2, 2012, 8:06:55 PM9/2/12
to mod...@googlegroups.com
I have never tried compiling in on Apache 2.4 on Windows. I don't have
the time to do it and compiling for Windows is a PITA for me as all I
have is an old Windows XP VM image on an old laptop that don't even
use for doing stuff any more.

What you should at least do it:

LogLevel debug
WSGIVerboseDebugging On

and see if the log shows anything at all related to mod_wsgi.

Graham
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/DmLSOKyytTgJ.
>
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to
> modwsgi+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.

David McKeone

unread,
Sep 3, 2012, 6:10:55 AM9/3/12
to mod...@googlegroups.com
Thanks Graham, I'll give that a shot.

If I know when you'd like to do it, you are welcome to use my Windows machine remotely to see it for yourself, but I'll see if I can get a bead on the problem first.

David McKeone

unread,
Sep 3, 2012, 7:00:21 AM9/3/12
to mod...@googlegroups.com
I've made some progress.

I first attempted to put "WSGIVerboseDebugging On" in the VirtualHost section of my configuration and Apache complained on startup. OK, so I moved that out of the VirtualHost.  That made me realize that VirtualHost might be special in some way (as far as mod_wsgi is concerned).  Turns out that it was special, because placing the WSGI commands outside of the VirtualHost section made it work normally.  So it appears that something might be up with the way mod_wsgi handles the alias in Apache 2.4.3 on Windows.  Additionally, it doesn't give any errors (even with debug output on), it just fails to recognize the alias.  

---------------------------------------- 
Works
---------------------------------------- 

LoadModule wsgi_module modules/mod_wsgi.so

WSGIScriptAlias /flask "/Apache24/wsgi/flask/wsgihandler.wsgi"

<Directory "/Apache24/wsgi/flask">
    AllowOverride None
    Options None
    Require all granted
</Directory>

----------------------------------------
Doesn't Work
----------------------------------------

LoadModule wsgi_module modules/mod_wsgi.so

<VirtualHost *:80>
WSGIScriptAlias /flask "/Apache24/wsgi/flask/wsgihandler.wsgi"

<Directory "/Apache24/wsgi/flask">
    AllowOverride None
    Options None
    Require all granted
</Directory>
</VirtualHost>

Graham Dumpleton

unread,
Sep 3, 2012, 5:06:26 PM9/3/12
to mod...@googlegroups.com
If that is your whole VirtualHost, then you simply constructed it
wrongly. Missing ServerName and likely didn't turn on NameVirtualHost
outside either. If you only have the one site, just don't use
VirtualHost, there is no need.
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/-f1GQfwNyz8J.

David McKeone

unread,
Sep 4, 2012, 3:55:07 AM9/4/12
to mod...@googlegroups.com

On Monday, September 3, 2012 10:06:28 PM UTC+1, Graham Dumpleton wrote:
If that is your whole VirtualHost, then you simply constructed it
wrongly. Missing ServerName and likely didn't turn on NameVirtualHost
outside either. If you only have the one site, just don't use
VirtualHost, there is no need.


Thanks Graham, you are 100 % correct.  I added a ServerName to the VirtualHost section and mod_wsgi worked fine with 2.4.  What is interesting (at least to me) is that the exact same configuration, sans-ServerName, worked with Apache 2.2, but did not work with Apache 2.4.  I followed it up a little more and found that the NameVirtualHost command seems to be deprecated in 2.4 (http://httpd.apache.org/docs/2.4/mod/core.html#namevirtualhost) and it is now enabled automatically, "any time an IP address and port combination is used in multiple virtual hosts".  I imagine that is what caught me.

Graham Dumpleton

unread,
Sep 5, 2012, 7:04:26 AM9/5/12
to mod...@googlegroups.com
It may have worked in 2.2 without ServerName because if Apache can't
match a VirtualHost and NameVirtualHost is set, it will use whatever
was the first VirtualHost it ever saw. Maybe in 2.4, if
NameVirtualHost is not needed, that it will have that fallback of
always using the first VirtualHost it saw when it doesn't match.

Graham
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/23AG37nRXhgJ.
Reply all
Reply to author
Forward
0 new messages