mod_python のインストール

まずは下準備の yum install をしておく。

[paraches@centos myTest]$ sudo yum install httpd-devel

いっぱいインストールされた。
次にソースをダウンロードして展開。

[paraches@centos python26]$ wget http://ftp.kddilabs.jp/infosystems/apache/httpd/modpython/mod_python-3.3.1.tgz
[paraches@centos python26]$ tar zxvf mod_python-3.3.1.tgz 
[paraches@centos python26]$ cd mod_python-3.3.1
[paraches@centos mod_python-3.3.1]$ ls
COPYRIGHT  LICENSE      NOTICE     configure.in  examples    src
CREDITS    Makefile.in  README     dist          install-sh  test
Doc        NEWS         configure  doc-html      lib
[paraches@centos mod_python-3.3.1]$ 

これで configure に挑戦。
python の場所の指定は新しく入れた 2.6.6 の方にしておく。

[paraches@centos mod_python-3.3.1]$ ./configure --with-python=/usr/local/bin/python --with-apxs=/usr/sbin/apxs
<省略>
checking for flex... /usr/bin/flex
found /usr/bin/flex, we'll use this. Use --with-flex to specify another.
checking flex version... configure: WARNING: Flex version 2.5.4 found.
    Version 2.5.31 or greater is required.  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 the correct flex version. See the README for more information.
<省略>
[paraches@centos mod_python-3.3.1]$ 

微妙に怒られてる…。flex のバージョンが 2.5.31 以上なのだけど、インストールされているのは 2.5.4 だって。ま、良いけど…って感じなのでそのまま進む!

[paraches@centos mod_python-3.3.1]$ make
<省略>
Now su and make install
  (or, if you only want to perform a partial install,
   you can use make install_dso and make install_py_lib)

[paraches@centos mod_python-3.3.1]$ 

というわけで、無事に make できた!
で、make install

[paraches@centos mod_python-3.3.1]$ sudo make install
[paraches@centos mod_python-3.3.1]$ 

無事終了!

せっかくなのでテストもしてみた。

[paraches@centos mod_python-3.3.1]$ cd test
[paraches@centos test]$ python test.py
<省略>
----------------------------------------------------------------------
Ran 68 tests in 19.758s

OK
  Stopping Apache...
     /usr/sbin/httpd -k stop -f /home/paraches/myTest/python26/mod_python-3.3.1/test/conf/test.conf
.
----------------------------------------------------------------------
Ran 6 tests in 44.771s

OK
[paraches@centos test]$ 

はい、OK!