mercurial+mod_wsgi+apacheで 500エラーになる

mercurialリポジトリを公開するためにWebサーバを構築していたところ、下記エラーと遭遇した
Abort: /path/to/hgweb.config: not a Mercurial bundle file

いろいろ調べたところ、pythonmercurialモジュールのバージョンが古いときにこのエラーがでるらしいとのことなので、pipを使ってバージョンをあげることにした

まずはpipのインストール

# wget http://peak.telecommunity.com/dist/ez_setup.py
# python ez_setup.py
# easy_install pip

続いてmercurialのバージョンアップ

# pip freeze
mercurial==1.4
# pip install --upgrade mercurial
Wheel installs require setuptools >= 0.8 for dist-info support.
pip's wheel support requires setuptools >= 0.8 for dist-info support.
Storing debug log for failure in /root/.pip/pip.log

と、ここで別のエラーが発生した
どうやらeasy_installのバージョンが古いということなので、easy_installもバージョンアップする

# easy_install --version
setuptools 0.6
# pip uninstall pip
# wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
# python ez_setup.py
# easy_install --version
setuptools 2.1
# easy_install pip

再度mercurialのバージョンアップ

# pip install --upgrade mercurial
Python headers are required to build Mercurial but weren't found in /usr/include/python2.6/Python.h

                                                                              • -

Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/mercurial
Storing debug log for failure in /root/.pip/pip.log

今度はpython.hがないと言われたので、インストールする

# yum install python-devel

再度mercurialのバージョンアップ

# pip install --upgrade mercurial
Successfully installed mercurial
Cleaning up...
# pip freeze
mercurial==2.8.2

これで無事にバージョンアップ完了
この状態で再度アクセスしてみたところ、無事リポジトリが表示された