Below, I'm trying to install mod_wsgi.
[root@server]# ./configure --with-python=/usr/local/bin/python2.7
checking for apxs2... no
checking for apxs... no
checking Apache version... ./configure: line 1704: apxs: command not found
./configure: line 1704: apxs: command not found
./configure: line 1705: apxs: command not found
./configure: line 1708: /: is a directory
./configure: line 1877: apxs: command not found
configure: creating ./config.status
config.status: error: cannot find input file: Makefile.in
I'm following the tutorial here to install mod_wsgi for Python 2.7. I had the virtualenv working with a Django installation but I was getting a 500 error which logged:
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] mod_wsgi (pid=1314): Target WSGI script '/var/www/virtualenv-2.7/mysite/mysite/wsgi.py' cannot be loaded as Python module.
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] mod_wsgi (pid=1314): Exception occurred processing WSGI script '/var/www/virtualenv-2.7/mysite/mysite/wsgi.py'.
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] Traceback (most recent call last):
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] File "/var/www/virtualenv-2.7/mysite/mysite/wsgi.py", line 13, in <module>
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] from django.core.wsgi import get_wsgi_application
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] File "/var/www/virtualenv-2.7/lib/python2.7/site-packages/django/core/wsgi.py", line 2, in <module>
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] from django.core.handlers.wsgi import WSGIHandler
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] File "/var/www/virtualenv-2.7/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 11, in <module>
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] from django import http
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] File "/var/www/virtualenv-2.7/lib/python2.7/site-packages/django/http/__init__.py", line 2, in <module>
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] from django.http.request import (HttpRequest, QueryDict,
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] File "/var/www/virtualenv-2.7/lib/python2.7/site-packages/django/http/request.py", line 11, in <module>
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] from django.conf import settings
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] File "/var/www/virtualenv-2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 9, in <module>
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] import importlib
[Sat Jan 10 21:50:06 2015] [error] [client 182.118.60.114] ImportError: No module named importlib
Meanwhile, python
in virtualenv had version 1.7 and import django
worked fine. So I decided to uninstall mod_wsgi
which yum
installed for me, and decided to do it manually so that I knew the right version was getting installed.