Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : Python and mod wsgi



Normal Mode | Print  

 Python and mod wsgi (1 Replies, Read 10203 times)
muonshirata
Group: Member
Post Group: Newbie
Posts: 1
Status:
My Ampps Installation folder
D:\Program Files\Ampps

my httpd.conf
pastebin.com/T3uQfuT6

my python.conf
Code

LoadModule wsgi_module modules/mod_wsgi.so
DirectoryIndex  index.wsgi default.wsgi index.py default.py
WSGIPythonPath "D:/Program Files/Ampps/python/Lib;D:/Program Files/Ampps/python/Lib/site-packages;D:/Program Files/Ampps/python/DLLs"
WSGIPythonHome "D:/Program Files/Ampps/python"

<VirtualHost *:80>

    ServerName localhost
    ServerAlias 127.0.0.1
    ServerAdmin webmaster@example.com

    DocumentRoot "D:\Program Files\Ampps\www\wsgi-scripts"

    WSGIScriptAlias /myapp "D:\Program Files\Ampps\www\wsgi-scripts\myapp.wsgi"

</VirtualHost>


myapp.wsgi
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]


D:\Program Files\Ampps\www\wsgi-scripts\test.py
Code

print "Content-type: text/html"
print
print "<html>"
print "<head>"
print "<title>Test CGI</title>"
print "</head>"
print "<body>"
print "<h1>test!</h1>"
print "<p>By a Peaceful dark pond</p>"
print "<p>A frog plops</p>"
print "<p>Into the still water</p>"
print "</body>"
print "</html>"


output test.py
403 Forbidden

You don't have permission to access /wsgi-scripts/test.py on this server.

because i add handler .py to my http.conf

if i delete .py handler i get py code output.

i have read https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

i allready do that right click ampps tray icon ->configuration->ampps->python enviroment checked
but i'm still confuse. pleas help. thx.
IP: --   


Threads
 muonshirata   Python and mod wsgi (1 Replies, Read 10203 times)
    |--  tidus   Hi, 1. Revert...   on September 28, 2013, 9:30 am

« Previous    Next »

Normal Mode | Print  



Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is May 10, 2025, 12:31 pm.

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