I would like to install a Django website on my Ubuntu VPS with Apache and mod_wsgi. I use a virtualenv. But when I go the mysite.com I get a 500 Internal Server Error and the error.log tells me this:
[Sun Jan 25 18:42:36 2015] [error] [client xx.xx.xx.xx] File "/usr/local/lib/python2.7/dist-packages/django/core/cache/backends/memcached.py", line 155, in __init__
[Sun Jan 25 18:42:36 2015] [error] [client xx.xx.xx.xx] import memcache
[Sun Jan 25 18:42:36 2015] [error] [client xx.xx.xx.xx] ImproperlyConfigured: Error importing module django.contrib.sessions.middleware: "No module named memcache"
It told me that memcached is not installed, but it seems that it looks at the wrong python/site-packages path, not the one of my virtualenv. I have installed memcached in my virtualenv.
Here is my VirtualHost for "mysite"
<VirtualHost *:80>
ServerName www.mysite.com
ServerAlias mysite.com
ServerAdmin [email protected]
Alias /uploads/ /var/www/mysite/uploads/
Alias /static/ /var/www/mysite/myapp/static/
WSGIDaemonProcess mysite python-path=/var/www/mysite:/root/.virtualenvs/mysite_env/lib/python3.2/site-packages
WSGIProcessGroup mysite
WSGIScriptAlias / /var/www/mysite/mysite/wsgi.py
<Directory /var/www/mysite/myapp/static>
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/mysite/uploads>
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/mysite/mysite>
<Files wsgi.py>
Order allow,deny
Allow from all
</Files>
</Directory>
</VirtualHost>
I don't know if that can help but I would precise that I currently run other PHP websites in this VPS, and each website has its own VirtualHost file.
Any help would be greatly appreciated!