LoginSignup
1
1

More than 5 years have passed since last update.

mod_wsgiがbuildできてるのか確認

Last updated at Posted at 2013-08-25

僕は「WSGI」を「うぃすきー」とは呼ばずに「うさぎ」と呼んでいるので会話中に単語を出すと怪訝な顔をされます.
まあ,なんでも,いいですけれど.

Apache2もmod_wsgiもpythonもオレオレパスに突っ込むために./configureにたくさんオプションをつけた挙句
生成されたMakefileの書き換えも行なって何とかインストールできた後ですが,たくさんオプションつけたんで,
できればもう何も書きたくありません.でも動作は確認せねばいけません.

httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome  /ore/ore/path/to/python3.3.2
WSGIScriptAlias /hello /path/to/hello.py
hello.py
def application(environ, start_response):
    start_response("200 OK", [("Content-type", "text/plain")])
    return ["俺の千早がこんなに可愛い。"]

最低限これだけ書けばとりあえずブラウザでアクセスして動作してることは確認できます.

httpd.conf
WSGIPythonHome  /ore/ore/path/to/python3.3.2

上記,Python build時にオプションで指定した--prefixの値になります.

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1