pip で mod_wsgi のインストールを試みたらエラーが発生した

環境

実行コマンド

pip install mod_wsgi

エラー

RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.

原因

apxs コマンドがないことが原因。

解決

mod_wsgi のインストールの前に apxs コマンドを含むパッケージをインストールする。

yum info httpd-devel

The httpd-devel package contains the APXS binary (以下略)

sudo yum -y install httpd-devel

pip install mod_wsgi