Skip to content

Instantly share code, notes, and snippets.

@nise-nabe
Created November 27, 2012 18:01
Show Gist options
  • Save nise-nabe/4155901 to your computer and use it in GitHub Desktop.
Save nise-nabe/4155901 to your computer and use it in GitHub Desktop.
DocumentRoot /var/www/%0/public_html
$ cd /var/www
$ mkdir aaa
$ cd aaa
$ git clone git://github.com/webpy/webpy.git /tmp/webpy
$ mv /tmp/webpi/web .
$ mkdir public_html
$ vim public_html/index.py
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import web
urls = (
'/', 'index'
)
class index:
def GET(self):
return "Hello, world!"
application = web.appliation(urls, globals()).wsgifunc()
$ vim public_html/.htaccess
Options +ExecCGI
AddHandler cgi-script .py
SetHandler wsgi-script
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.py/$1 [QSA,L]
$ curl http://localhost/
Hello, world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment