I'm trying to setup python / apache / WSGI on windows.
I have the following installed, all 32-bit and vc9:
- Apache 2.4
- Python 2.7.9
- Mod_WSGI.so in the modules folder.
http://localhost/ Displays the Apache Haus web page successfully -- Apache is running and serving.
Here is my "Hello World" python script:
def application(environ, start_response): status = '200 OK' output = 'This is my Website!' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output]
Here is my Apache config:
WSGIScriptAlias /wsgi "C:/wsgi_app/wsgi_app.py" <Directory "C:/wsgi_app"> AllowOverride None Options MultiViews Require all granted </Directory>
This version will display the file in plain-text, rather than interpreting it.
If I change options to none...
WSGIScriptAlias /wsgi "C:/wsgi_app/wsgi_app.py" <Directory "C:/wsgi_app"> AllowOverride None Options none Require all granted </Directory>
I get 404 Not Found on http://localhost/wsgi
The apache error log doesn't have much that seems too useful for troubleshooting.
[Wed Feb 10 16:17:49.293987 2016] [wsgi:warn] [pid 4448:tid 336] mod_wsgi: Compiled for Python/2.7.9+. [Wed Feb 10 16:17:49.293987 2016] [wsgi:warn] [pid 4448:tid 336] mod_wsgi: Runtime using Python/2.7.9. [Wed Feb 10 16:17:49.325187 2016] [mpm_winnt:notice] [pid 4448:tid 336] AH00354: Child: Starting 64 worker threads. [Wed Feb 10 16:17:52.538793 2016] [wsgi:error] [pid 4448:tid 1040] [client ::1:54402] Target WSGI script not found or unable to stat: C:/wsgi_app/wsgi_app.py
"LoadModule access_compat_module modules/mod_access_compat.so" is uncommented, if that matters.
Any ideas on how to get this page to load / other apache config changes to try?
Do I need to change a python config somewhere?
C:/wsgi_app
directory? Can you post an exact listing of the files in this directory?