First install the WSGI module and enable:
1.: My machine is python2.7 http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so
2. Place the mod_wsgi-win32-ap22py27-3.3.so in the modules directory under the Apache installation directory
3. Open http.conf
Added: LoadModule wsgi_module modules/mod_wsgi-win32-ap22py27-3.3.so
Download and install the web.py module:
Easy_install-u web.py
Download and install the web.py module:
Easy_install-u web.py
or manually download the installation:
1.: http://webpy.org
2. Unzip to any directory, go to directory python setup.py install, open the Idle editor after installation to test whether the installation is successful:
1>>>ImportWeb2>>> urls= ('/','Index')3>>> app =web.application (Urls,globals ())4>>>classIndex:5 defGET (self):6 return 'Hello world!'7 8>>> App.run ()
Browse 127.0.0.1:8080 in the browser to see if it displays properly
Start setting up
For example, I would like to put the trial web.py program in the D:\develop\webapp directory, and access to the connection is: 127.0.0.1/webapp
The configuration is as follows:
1LoadModule Wsgi_module modules/mod_wsgi.so2 3Wsgiscriptalias/webapp"d:/develop/webapp/index.py/"4 5Alias/webapp/static"d:/develop/webapp/static/"6AddType text/HTML. PY7 8<directory"d:/develop/webapp/">9 allowoverride AllTen Options Indexes followsymlinks execcgi One Order Allow,deny ASetHandler wsgi-Script -Allow from All -</Directory>
Restart Apache.
Whether the test was successful:
Editor: d:/develop/webapp/index.py File:
1 ImportWeb2URLs = ('/','Index')3 4 classIndex:5 defGET (self):6 return "Hello world!"7 8App = Web.application (URLs, Globals (), autoreload=False)9application = App.wsgifunc ()
Access Http://localhost/webapp, configuration complete.
apache+wsgi+web.py Environment Construction under windows