uWSGIのインストールとHello world

2014年6月26日 (木) 03:15時点におけるYosuke (トーク | 投稿記録)による版 (ページの作成:「== uWSGI インストール == # easy_install -Z uwsgi == hello.py 作成 == # vi hello.py === 中身 === def application(env, start_response): start_response...」)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)

uWSGI インストール

# easy_install -Z uwsgi

hello.py 作成

# vi hello.py

中身

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return "Hello World"

Web サーバ起動

Port 9090 での例。

# uwsgi --http :9090 --wsgi-file hello.py

アクセス

以下のようにアクセスできるようになった。

http://example.com:9090/


以上。