【Debian】Apacheにmod_pythonを組み込む
ApacheでDjangoアプリを動かすには、mod_pythonとやらがいるらしい。
mod_perlの様な感じで、起動時にメモリにプログラムを読み込んで動作するらしい。
(参考:http://djangoproject.jp/doc/ja/1.0/howto/deployment/modpython.html)
Debian環境なので、apt-getしてみる。
apt-get install mod_python
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
E: パッケージ mod_python が見つかりません
無いって。。。
じゃあwgetでとってくる。
wget http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz
archive.apache.org をDNSに問いあわせています... 140.211.11.131
archive.apache.org|140.211.11.131|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 447954 (437K) [application/x-tar]
`mod_python-3.3.1.tgz' に保存中
100%[================================================>] 447,954 309K/s 時間 1.4s
2012-08-18 20:19:32 (309 KB/s) - `mod_python-3.3.1.tgz' へ保存完了 [447954/447954]
やったmod_pythonゲットした。
解凍。
tar xfz mod_python-3.3.1.tgz
さて、これをどうするか調べるか。
cd mod_python-3.3.1
./configure --with-python=/usr/bin/python2.6
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for main in -lm... yes
checking for an ANSI C-conforming const... yes
checking your blood pressure... a bit high, but we can proceed
configure: checking whether apxs is available...
checking for --with-apxs... no
checking for apxs in /usr/local/apache/sbin... no
checking for apxs in your PATH... checking for apxs... no
checking for apxs2 in your PATH... checking for apxs2... no
configure: WARNING: **** apxs was not found, DSO compilation will not be available.
configure: WARNING: **** You can use --with-apxs to specify where your apxs is.
configure: error: Neither static nor DSO option available, there is no point in continuing.
apxsが無いって。
http://kitajima-antenna.seesaa.net/article/121370094.htmlを参考に。
apache2-prefork-devに含まれるらしい。
sudo apt-get upgrade
sudo apt-get install apache2-prefork-dev
入った。
再び。。。。
cd mod_python-3.3.1
./configure --with-python=/usr/bin/python2.6
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
~
~
~
configure: WARNING: flex not found
You can generally ignore this warning unless you need to regenerate
psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c,
use --with-flex to specify the location of flex.
See the README for more information.
~
~
~
今度はflexが無いと。。。
apt-get install flex
でflex追加して。
再チャレンジ。
cd mod_python-3.3.1
./configure --with-python=/usr/bin/python2.6
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
~
~
~
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating Doc/Makefile
config.status: creating src/include/mod_python.h
config.status: creating test/Makefile
config.status: creating test/testconf.py
config.status: creating dist/setup.py
config.status: creating dist/Makefile
いったっぽいのかな?
では、、、、、
make
~
~
make[1]: *** [mod_python.so] エラー 1
make[1]: ディレクトリ `/root/hoge/mod_python-3.3.1/src' から出ます
make: *** [do_dso] エラー 2
くそう。。。
では、http://www.abetake.com/index.php?mod_python%203.3.1とhttp://d.hatena.ne.jp/paraches/20080123を参考に。。。
vi /root/hoge/mod_python-3.3.1/src/connobject.c
./configure --with-apxs=/usr/bin/apxs2
make
いった!!!
make install
よし。
とりあえずapacheの設定はまた後日!
GIANT ESCAPE R3とRX3
奥さんのR3と私のRX3。
最近乗ってないな。。。
もう少し涼しくなったら、車にサイクルキャリアつけて
遠出して乗りたい。
今のところは、特に問題なく乗れてますが、R3とRX3はホイールとタイヤが違うので空気圧が異なります。
たまに空気圧間違えそうになって焦ります。
ポパイBW300MH&MGブルドッグ40ポンド
普段利用しているポパイBW300MH&MGブルドッグ40ポンドでの走行映像です。
アブガルシアのRevoLTXとHKC-611LS MGS
誕生日プレゼントとして、アブガルシアのRevoLTXとHKC-611LS MGSを頂きました。
初ベイトフィネスタックルです。
購入後、3回ボート釣行で使用した感想。
(40cm弱までしかつれてないですが。。。)
まずロッド。
6フィート1インチは少し短めかなと思っていたけれど、ボートでは取り回しが良くて使いやすい。
ベイトフィネス用なので当然なのですが、柔らかいティップとそこそこしっかりしたバットでジグヘッドワッキーやノーシンカーのキャスト~フッキングまでそつなくこなす印象。
いい感じ。
で、リール。。。。
最近DCブレーキのベイトリールしか使っていなかったので、使い始めからしばらくはバックラッシュが増えた。。。
慣れたら、キャスト~リーリング~キャスト~リーリングがとても楽。
もちろんスピニングより太めのラインを巻いているので、ラインブレイクもあまり気にしなくていいし。
飛距離はスピニングには負けるけれど、ボートを流しながらのキャストがかなり楽になった。
奥さんどうもありがとうございます。
【Debian】Python+Djangoの各種チュートリアル的な。
まずはここから。
http://www.python.jp/doc/2.7/tutorial/index.html
2.djangoチュートリアル(djangoproject.jp)
http://djangoproject.jp/doc/ja/1.0/index.html
で、次はここ。
3.CodeZineのdjangoチュートリアル(前編・後編)
http://codezine.jp/article/detail/4065
http://codezine.jp/article/detail/4264
【Debian】Python+Django+PostgreSQL
最近、Debian+Python+Django+PostgreSQLの環境で
開発の勉強をはじめてみた。
あっ、DebianはVirtualBox上で。
とりあえず、PythonのチュートリアルとDjangoのチュートリアルを
一通り流してみたけれど、はしょられているところでちょいちょい詰まった。
詳細はまた気が向いたら書く。
スーパーユーザー忘れたときは、
python manage.py createsuperuser
で新たに作る。
VirtualBox上のDebian内のPython開発サーバーに外部からアクセスする場合は、
python manage.py runserver 0.0.0.0:8000
のようにするといいらしい。