So this is driving me crazy I have python3 and modwsgi and apache and a virtual host, that work great, as I have several other wsgi scripts that work fine on the server. I also have a django app that works great when I run the dev server.
I have checked that "ldd mod_wsgi.so" is linked correctly against python3.5
Whenever I try to access my site, I get an error and the apache log states: ImportError: No module named 'protectionprofiles' protection profiles is mysite name the following is my virtual host config
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName <my ip>
WSGIScriptAlias /certs /var/www/scripts/CavsCertSearch/CavsCertSearch/certstrip.wsgi
WSGIScriptAlias /testcerts /var/www/scripts/CavsCertSearchTest/CavsCertSearch/certstriptest.wsgi
WSGIScriptAlias /protectionprofiles /var/www/protectionprofiles/protectionprofiles/wsgi.py
<Directory /var/www/protectionprofiles/protectionprofiles>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
my site app is the protection profiles alias. I have no idea what the issue is I have tried following dozens of different apache tutorials and none of them seem to work. Any help is greatly appreciated.
------ To add something else I tried -------- so I added the following 2 commands inside the virtual host
WSGIDaemonProcess protectionprofiles python-path=/var/www/protectionprofiles/
WSGIProcessGroup protectionprofiles
and no I get a different error
Error was: No module named 'django.db.backends.postgresql'
which is my backend, but the dev server works fine? Below is my database configuration
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'USER': 'myuser',
'PASSWORD': 'abcd1234',
'HOST': '127.0.0.1',
'PORT': '5432',
'NAME': 'protectionprofile',
}
}
----Another error ---- Occasional I get
RuntimeError: populate() isn't reentrant
---- Another error!!--- Now when I update
WSGIDaemonProcess protectionprofiles python-path=/var/www/protectionprofiles/:/usr/lib/python3/dist-packages/django
I get
ImportError: cannot import name 'SimpleCookie'
---Another wierd thng is that when I have
WSGIProcessGroup protectionprofiles
enabled I dont get the error that it can't find the module "protectionprofiles" but when then non of my other wsgi scripts work!. They only work when thats no in there. Any explanation of that would be very helpful
populate()error is a side effect of the error occurring on trying to load the WSGI application. So that can be ignored at this point. - Graham Dumpletonpsycopg2installed? - Graham Dumpletonmod_wsgi.somodule and runlddon it to see what it is linked to modwsgi.readthedocs.io/en/develop/user-guides/… - Graham Dumpleton