I've been trying for a while to get this sorted out and still no luck. Upon restart, apache logs ImportError: No module named site.
My machine has two python installations, 2.6 and 2.7. I was having issues previously with mod_wsgi being compiled for 2.6, so I recompiled for 2.7 and it looks like it's compiled correctly: [Sat Feb 01 01:13:39 2014] [notice] Apache/2.2.26 (Unix) DAV/2 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
Here's my httpd.conf
WSGISocketPrefix /var/run/apache2
WSGIPythonHome /usr/lib64/python2.7/
WSGIPythonPath /home/ec2-user/[redacted]:/usr/lib64/python2.7/site-packages:/usr/lib64/python2.7
<VirtualHost *:80>
DocumentRoot /home/ec2-user/[redacted]
ServerName 54.203.106.173
ErrorLog /home/ec2-user/[redacted]/logs/apache_error.log
CustomLog /home/ec2-user/[redacted]/logs/apache_access.log combined
WSGIScriptAlias / /home/ec2-user/[redacted]/apache/django.wsgi
Alias /static/ /home/ec2-user/[redacted]/static/
<Directory /home/ec2-user/[redacted]/media>
Order deny,allow
Allow from all
</Directory>
<Directory /home/ec2-user/[redacted]/apache>
Order deny,allow
Allow from all
</Directory>
LogLevel warn
</VirtualHost>
and django.wsgi:
--------------------------
import os,sys
sys.path.append('/home/ec2-user/[redacted]')
#sys.path.append('/usr/lib/python2.7')
apache_configuration = os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
sys.path.append('/Volumes/Mac OS X/Projects')
sys.path.append('/Volumes/Mac OS X/')
os.environ['DJANGO_SETTINGS_MODULE'] = '[redacted].settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
--------------------------------
Looks like my library isn't being referenced correctly, but I've included that in the PythonPath. Any help is much appreciated. Thanks.