I've placed on my Win7x64 Xampp and Python 2.7 :)
Now I am looking to get the "energy" of Python language... how do i get it done?
I have attempted with mod_python and mod_wsgi but the first doesn't exists for my version of Python, so when I attempt to begin Apache after setting up wsgi it provides me with a mistake ('< Directory "x93C:/wsgi_appx94"> path is invalid -i added an area between < and directory to create the string visible here :D).
So... Anybody knows if there's just a little tutorial to set up these functions?? Or perhaps is anybody is kind enough to describe me step-by-step what shall I actually do? :)
Thanks and sorry if i am not too in a position to explain me :) If you want request :):)
You actually are write, mod_python will not use Python 2.7. So mod_wsgi may be the best brand out there.
I would suggest AMPPS as python atmosphere is automatically enabled with mod_python and python 2.5. AMPPS Website
should you still wish to continue,
Add this line in httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
Uncomment the road in httpd.conf
Open vhost file httpd-vhosts.conf and add
NameVirtualHost 127.0.0.1:80 <VirtualHost 127.0.0.1:80> <Directory "path/to/directory/in/which/wsgi_test.wsgi/is/present"> Options FollowSymLinks Indexes AllowOverride All Order deny,allow allow from All </Directory> ServerName 127.0.0.1 ServerAlias 127.0.0.1 WSGIScriptAlias /wsgi "path/to/wsgi_test.wsgi" DocumentRoot "path/to/htdocs" ErrorLog "path/to/log.err" CustomLog "path/to/log.log" combined </VirtualHost>
Add the next lines in wsgi_test.wsgi
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]
Note : Don't result in the test directory in htdocs. Because I've not attempted that yet. These steps labored for me personally in AMPPS. :)
Then access 127...1/wsgi inside your favorite browser. You will notice Hello World!.
If you do not see, follow QuickConfigurationGuide
You can include wrinkles in httpd.conf
<IfModule wsgi_module> <Directory path/to/directory> Options FollowSymLinks Indexes AllowOverride All Order deny,allow allow from All </Directory> WSGIScriptAlias /wsgi path/to/wsgi_test.wsgi </IfModule>