1.Install python-language oriented web framework web.py
1.1 Get web.py source code from official web site.
wget http://webpy.org/static/web.py-0.37.tar.gz
1.2 Unpack the file
tar xzvf web.py-0.37.tar.gz
1.3 Install web.py
cd web.py-0.37 python setup.py install
2.Deploy with Apache service
2.1 Get mod_wsgi module
yum install mod_wsgi2.2 modify httpd config file
Add the following lines in the end of httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so WSGIScriptAlias /appname /var/www/webpy-app/code.py/ Alias /appname/static /var/www/webpy-app/static/ AddType text/html .py <Directory /var/www/webpy-app/> Order deny,allow Allow from all </Directory>
import web urls = ( '/.*', 'hello', ) class hello: def GET(self): return "Hello, world." application = web.application(urls, globals()).wsgifunc()
"Hello world." will right there.