Created
November 27, 2012 18:01
-
-
Save nise-nabe/4155901 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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