Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : 404 error with Python Hello World on Windows



Threaded Mode | Print  

 404 error with Python Hello World on Windows (0 Replies, Read 5035 times)
micsaund
Group: Member
Post Group: Newbie
Posts: 1
Status:
Hi all,

I've been beating my head against the wall (ow!) for a couple days trying to get the 'hello world' example working on AMPPS, but all I can get is a 404.

I was reading this ("I can't run python scripts" here on this forum, but the stupid rules won't let me post the link to this own forum...) and following the chrisjensen23 walk-through on the second page, adjusting for what I think Windows needs.  (full disclosure - I'm a *nix guy, so this could possibly be a windows issue that I'm not detecting).

AMPPS is installed in the default location:  C:\Program Files (x86)\Ampps

I created:  C:\Program Files (x86)\Ampps\www\wsgi-scripts

I created file myapp.wsgi with these contents:

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

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

    return [output]


I edited C:\Program Files (x86)\Ampps\conf\httpd.conf like this:

Code
#### Localhost VirtualHost ####

<VirtualHost 127.0.0.1:80>
<Directory "{$path}/www">
    Options FollowSymLinks Indexes
    AllowOverride All
    Order deny,allow
    allow from All
</Directory>
ServerName localhost
ServerAlias localhost 127.0.0.1
ScriptAlias /cgi-bin/ "{$path}/www/cgi-bin/"
DocumentRoot "{$path}/www"
ErrorLog "{$path}/apache/logs/error.log"
CustomLog "{$path}/apache/logs/access.log" combined

<Directory "{$path}/www/wsgi-scripts">
    Order allow,deny
    Allow from all
</Directory>
WSGIScriptAlias /myapp "{$path}/www/wsgi-scripts/myapp.wsgi"

</VirtualHost>


My C:\Program Files (x86)\Ampps\conf\python.conf is unchanged:

Code
LoadModule wsgi_module modules/mod_wsgi.so
DirectoryIndex  index.wsgi default.wsgi index.py default.py
WSGIPythonPath "{$path}/python/Lib;{$path}/python/Lib/site-packages;{$path}/python/DLLs"
WSGIPythonHome "{$path}/python"


I restart Apache using the AMPPS control panel.

I go to:  ht_tp://localhost/myapp (sorry, stupid 'you can't post links rule again) and get a 404 error.  Error log (debug level) shows:

Code
[Thu Nov 13 18:32:56.707335 2014] [mpm_winnt:debug] [pid 8336:tid 568] child.c(1009): AH00352: Child: Acquired the start mutex.
[Thu Nov 13 18:32:56.707335 2014] [mpm_winnt:notice] [pid 8336:tid 568] AH00354: Child: Starting 64 worker threads.
[Thu Nov 13 18:32:56.741369 2014] [mpm_winnt:debug] [pid 8336:tid 1444] child.c(399): AH00334: Child: Accept thread listening on 0.0.0.0:443 using AcceptFilter data
[Thu Nov 13 18:32:56.741369 2014] [mpm_winnt:debug] [pid 8336:tid 1468] child.c(399): AH00334: Child: Accept thread listening on [::]:443 using AcceptFilter data
[Thu Nov 13 18:32:56.742369 2014] [mpm_winnt:debug] [pid 8336:tid 1492] child.c(399): AH00334: Child: Accept thread listening on 0.0.0.0:80 using AcceptFilter data
[Thu Nov 13 18:32:56.743371 2014] [mpm_winnt:debug] [pid 8336:tid 1516] child.c(399): AH00334: Child: Accept thread listening on [::]:80 using AcceptFilter data
[Thu Nov 13 18:32:57.870320 2014] [authz_core:debug] [pid 8336:tid 1428] mod_authz_core.c(827): [client ::1:50970] AH01628: authorization result: granted (no directives)
[Thu Nov 13 18:32:57.871319 2014] [core:info] [pid 8336:tid 1428] [client ::1:50970] AH00128: File does not exist: C:/Program Files (x86)/Ampps/www/myapp
[Thu Nov 13 18:32:57.872320 2014] [authz_core:debug] [pid 8336:tid 1428] mod_authz_core.c(827): [client ::1:50970] AH01628: authorization result: granted (no directives)


I'm not sure what I'm doing wrong here.  I have a hunch that the WSGIScriptAlias is not working, but my n00bness to Python and Windows webservers isn't helping me come to an answer.  Any help would be appreciated!

Thanks,
Mike

IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is April 19, 2024, 3:06 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.197