| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
編集の要約なし
==Django 運用環境の構築==
[[Django][Python]]
{{amazon|4048672096}}
*python 2.6.2 r262
<&lt;blockquote>&gt;Pythonを 2.4 から 2.6にしていたため、yumで取得したバイナリとは Pythonのバージョンが異なり失敗。以下、ソースからコンパイルを行う。2.4 なら問題ない。<&lt;/blockquote>&gt;
# yum install mod_python
Parsing package install arguments
Resolving Dependencies
--> &gt; Populating transaction set with selected packages. Please wait. ---> &gt; Downloading header for mod_python to pack into transaction set.
mod_python-3.2.8-3.1.i386 100% |=========================| 26 kB 00:00
---> &gt; Package mod_python.i386 0:3.2.8-3.1 set to be updated --> &gt; Running transaction check
Dependencies Resolved
====Windows 用に以下のサイトでバイナリが配布されている====
*http://ftp.riken.jp/net/apache/httpd/modpython/win/3.3.1/
<&lt;blockquote>&gt;Python2.6 用は提供されていない模様 2010/01/21時点<&lt;/blockquote>&gt;
===ソースからインストール===
*http://httpd.apache.org/modules/python-download.cgi
=====/etc/httpd/conf/httpd.conf に以下の記述を追加=====
<&lt;Directory "/var/www/html/pytest">&gt;
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
<&lt;/Directory>&gt;
LoadModule python_module /usr/lib/httpd/modules/mod_python.so
*以下を追記
**[http://www.python.jp/doc/contrib/modpython/dir-other-pp.html PythonPath ディレクティブ]でプロジェクトのパスを指定
<&lt;Location "/py/mysite">&gt;
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "sys.path+['/var/www/html/py']"
PythonDebug On
<&lt;/Location>&gt;
*ソースコードからコンパイルした場合、以下も忘れずに追記
=====以下のエラー=====
<&lt;blockquote>&gt;yum でバイナリをインストールしたため、以下のエラー。ソースコードから再インストールを行う。<&lt;/blockquote>&gt;
*現在の環境は、もともとPython2.4 がデフォルトで入っていたところに、[Django インストール] [2.6を入れいている]が、mod_python 自体もバイナリは Python2.4 でコンパイルされている?
Mod_python error: "PythonHandler django.core.handlers.modpython"

案内メニュー