- ユーザhogeが~/Sites以下での実行環境 .pyで実行する場合
- Uncheck System Preferences > Sharing > Web Shearing
% diff /etc/apache2/httpd.conf /etc/apache2/httpd.conf.default
145c145
< LoadModule python_module libexec/apache2/mod_python.so
---
> #LoadModule python_module libexec/apache2/mod_python.so
469c469
< AddHandler cgi-script .cgi .py
---
> #AddHandler cgi-script .cgi% diff /etc/apache2/users/hoge.conf /etc/apache2/users/hoge.conf.default
2c2
< Options Indexes MultiViews ExecCGI
---
> Options Indexes MultiViews- Check System Preferences > Sharing > Web Shearing
/Users/hoge/Sites% cat hello.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
print "Content-Type: text/plain"
print
print "Hello world!"
/Users/hoge/Sites% chmod 755 hello.py- http://localhost/~hoge/hello.py にアクセスするとHello world!と表示される
April 19, 2012
MacのWeb共有でPythonのCGIを実行する環境
Related Posts
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment