On 20/12/2014, at 7:32 PM, marco del corto <[email protected]> wrote:

>  I'm using:
> - Apache 2.4.10 (httpd-2.4.10-win64-VC11.zip from 
> http://www.apachelounge.com/download/)
> - Python 3.4.2 (python-3.4.2.amd64.msi from 
> https://www.python.org/ftp/python/3.4.2/python-3.4.2.amd64.msi";)
> and I tried:
> - mod_wsgi-3.5.ap24.win-amd64-py3.4
> - mod_wsgi‑4.4.1.ap24.win‑amd64‑py3.4
> - mod_wsgi‑4.4.2.ap24.win‑amd64‑py3.4
> and in all case I got "You don't have permission to access /myapp_w on this 
> server" (while hello.wsgi in /htdocs works fine).
> Do you think I must instead switch to Apache VC10 Win64 
> (http://www.apachelounge.com/download/win64/ httpd-2.4.10-win64.zip) with 
> same Python version?

Yes, please switch to:

    http://www.apachelounge.com/download/win64/binaries/httpd-2.4.10-win64.zip

Python 3.4.2 is compiled with the Microsoft VC10 compiler. You cannot 
necessarily mix binaries compiled with VC10 and VC11. You can have problems, 
including crashes or other strange behaviour. You should not therefore use the 
Apache VC11 compiled binary.

Also stop using the precompiled mod_wsgi binaries from:

    http://www.lfd.uci.edu/~gohlke/pythonlibs/

Use the ones in the zip file I referred to in that other email post.

Those are binaries I have compiled myself. I know first hand that they appear 
to work when the correct versions of Python and Apache are used.

I am only in a position to debug the binaries I built. I cannot debug those 
from that other site as I don't know how they were compiled so cannot reproduce 
anything.

So remove the VC11 Apache and install the VC10 Apache.

Copy the file:

    mod_wsgi-windows-4.4.2/Apache24-win64-VC10/modules/mod_wsgi-py34.so

from my zip file and put it in the modules directory of the VC10 Apache 
installation.

For the very first tests, put a WSGI hello world in the Apache VC10 
installation htdocs directory.

def application(environ, start_response):
    status = '200 OK'
    output = b'Hello World!'

    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)

    return [output]

In the Apache configuration file do the following.

Inside of the Directory block for the htdocs directory, add to the end of the 
line for the existing Options directive:

     ExecCGI

Just before the </Directory> add:

    AddHandler wsgi-script .wsgi

Then just after the </Directory> add:

    WSGIScriptAlias /wsgi "c:/Apache24/htdocs/hello.wsgi"

Change the directory for the htdocs directory if necessary.

Note that the ExecCGI and AddHandler are not needed for WSGIScriptAlias to 
work. I am only getting you to add those as well so I can get you to run two 
tests.

Now restart Apache.

First off, access the URL:

     http://localhost/hello.wsgi

Then access the URL:

    http://localhost/wsgi

Do both work?

Graham


-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to