WSGI ERROR :Target WSGI script cannot be loaded as Python module - django

I am trying to deploy a Django application using apache and i am getting the following error
[Fri Oct 08 07:55:44.393237 2021] [wsgi:error] [pid 12424:tid 140450959271680] mod_wsgi (pid=12424): Target WSGI script '/home/preinstall/hx_preinstaller/hx_preinstaller/wsgi.py' cannot be loaded as Python module.
[Fri Oct 08 07:55:44.393281 2021] [wsgi:error] [pid 12424:tid 140450959271680] mod_wsgi (pid=12424): Exception occurred processing WSGI script '/home/preinstall/hx_preinstaller/hx_preinstaller/wsgi.py'.
[Fri Oct 08 07:55:44.393408 2021] [wsgi:error] [pid 12424:tid 140450959271680] Traceback (most recent call last):
[Fri Oct 08 07:55:44.393430 2021] [wsgi:error] [pid 12424:tid 140450959271680] File "/home/preinstall/hx_preinstaller/hx_preinstaller/wsgi.py", line 12, in <module>
[Fri Oct 08 07:55:44.393435 2021] [wsgi:error] [pid 12424:tid 140450959271680] from django.core.wsgi import get_wsgi_application
[Fri Oct 08 07:55:44.393446 2021] [wsgi:error] [pid 12424:tid 140450959271680] ModuleNotFoundError: No module named 'django'
My apache virtual host
<VirtualHost *:80>
DocumentRoot /home/preinstall/hx_preinstaller
ErrorLog ${APACHE_LOG_DIR}/preinstall_error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/preinstall/hx_preinstaller/hx_preinstaller>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
<Directory /home/preinstall/hx_preinstaller>
Require all granted
</Directory>
WSGIDaemonProcess preinstall python-path=/home/preinstall/hx_preinstaller:/home/preinstall/.local/lib/python3.6/site-packages
WSGIProcessGroup preinstall
WSGIPassAuthorization On
WSGIScriptAlias / /home/preinstall/hx_preinstaller/hx_preinstaller/wsgi.py
</VirtualHost>
What should i do?..

Maybe its a python version mismatch , or you didnt add correctly the python path to the appache.conf .
go check this post to know more about this error ->>> link

Related

Error: (Internal server error) Django apache2 - mod_wsgi

I'm trying to deploy my django application on my remote server, but I'm getting an http 500 internal server error.
Here are the configurations I made:
Structure file
/home/ubuntu/project/env (virtualenv folder)
bin
include
lib
/home/ubuntu/project/
|- manage.py
| - env
| - my_project
/home/ubuntu/project/my_project
|__init__.py
|settings.py
|urls.py
|wsgi.py
Fichier 000-default.conf
<VirtualHost *:80>
WSGIDaemonProcess myproject python-home=/home/ubuntu/project/env python-
path=/home/ubuntu/project/my_project
WSGIProcessGroup myproject
WSGIScriptAlias / /home/ubuntu/project/my_project/wsgi.py
<Directory /home/ubuntu/project/my_project>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
Error log
[Fri Dec 30 11:28:18.988904 2022] [wsgi:error] [pid 31289:tid 140473618372288] [remote
41.82.143.41:50428] File "/home/ubuntu/project/my_project/wsgi.py", line 12, in <module>
[Fri Dec 30 11:28:18.988915 2022] [wsgi:error] [pid 31289:tid 140473618372288] [remote
41.82.143.41:50428] from django.core.wsgi import get_wsgi_application
[Fri Dec 30 11:28:18.988933 2022] [wsgi:error] [pid 31289:tid 140473618372288] [remote
41.82.143.41:50428] ModuleNotFoundError: No module named 'django'
[Fri Dec 30 11:28:19.164861 2022] [wsgi:error] [pid 31289:tid 140473651943104] [remote
41.82.143.41:50427] mod_wsgi (pid=31289): Failed to exec Python script file
'/home/ubuntu/project/my_project/wsgi.py'.
[Fri Dec 30 11:28:19.164958 2022] [wsgi:error] [pid 31289:tid 140473651943104] [remote
41.82.143.41:50427] mod_wsgi (pid=31289): Exception occurred processing WSGI script
'/home/ubuntu/project/my_project/wsgi.py'.
[Fri Dec 30 11:28:19.165130 2022] [wsgi:error] [pid 31289:tid 140473651943104] [remote
41.82.143.41:50427] Traceback (most recent call last):
[Fri Dec 30 11:28:19.165172 2022] [wsgi:error] [pid 31289:tid 140473651943104] [remote
41.82.143.41:50427] File "/home/ubuntu/project/my_project/wsgi.py", line 12, in <module>
[Fri Dec 30 11:28:19.165183 2022] [wsgi:error] [pid 31289:tid 140473651943104] [remote
41.82.143.41:50427] from django.core.wsgi import get_wsgi_application
[Fri Dec 30 11:28:19.165212 2022] [wsgi:error] [pid 31289:tid 140473651943104] [remote
41.82.143.41:50427] ModuleNotFoundError: No module named 'django'
I then used this process : make custom versions of Python and mod_wsgi ourselves.
apt install apache2 apache2-dev
wget https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.9.4
tar xvfz 4.9.4
cd mod_wsgi-4.9.4
./configure --with-python=[your python path]
## For example: ./configure --with-python=/usr/bin/python3.10
sudo make
sudo make install
## Finally:
sudo systemctl reload apache2
I use python 3.10 and apache2
and the error still persists (500 internal server error)
I do not know what to do ???
I found the answer by adding to my wsgi.py file the path where django is installed

Flask app on Apache 2 gives internal server error

I get the following error when running my website on apache2/ubuntu:
ModuleNotFoundError: No module named 'FlaskApp'
[Sun Jan 24 23:04:52.381039 2021] [wsgi:error] [pid 25239] [client 190.160.166.19:49593] mod_wsgi (pid=25239): Target WSGI script '/var/www/FlaskApp/flaskapp.wsgi' cannot be loaded as Python module., referer: https://www.publimundo.cl/
[Sun Jan 24 23:04:52.381091 2021] [wsgi:error] [pid 25239] [client 190.160.166.19:49593] mod_wsgi (pid=25239): Exception occurred processing WSGI script '/var/www/FlaskApp/flaskapp.wsgi'., referer: https://www.publimundo.cl/
[Sun Jan 24 23:04:52.381163 2021] [wsgi:error] [pid 25239] [client 190.160.166.19:49593] Traceback (most recent call last):, referer: https://www.publimundo.cl/
[Sun Jan 24 23:04:52.381180 2021] [wsgi:error] [pid 25239] [client 190.160.166.19:49593] File "/var/www/FlaskApp/flaskapp.wsgi", line 7, in <module>, referer: https://www.publimundo.cl/
[Sun Jan 24 23:04:52.381185 2021] [wsgi:error] [pid 25239] [client 190.160.166.19:49593] from FlaskApp import app as application, referer: https://www.publimundo.cl/
This is my virtual host configuration:
<VirtualHost *:443>
ServerAdmin admin#publimundo.cl
ServerName www.publimundo.cl
WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
SSLEngine on
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
SSLProtocol all -SSLv2 -SSLv3
Timeout 300
KeepAlive On
MaxKeepAliveRequests 0
KeepAliveTimeout 20
ErrorLog /var/log/site_logs/publimundo-error.log
CustomLog /var/log/site_logs/publimundo-access.log combined
<Directory "/var/www/FlaskApp">
AllowOverride All
Allow from All
Require all granted
Options +FollowSymLinks
</Directory>
Alias /static /var/www/FlaskApp/publimundo/static
<Directory "/var/www/FlaskApp/publimundo/static">
AllowOverride All
Allow from All
Require all granted
Options +FollowSymLinks
</Directory>
#Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/publimundo.cl/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/publimundo.cl/privkey.pem
</VirtualHost>
Also the content of flaskapp.wsgi is:
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/FlaskApp/")
from FlaskApp import app as application
application.secret_key = 'some secret key here'
what can be the root of the problem? I have tried many answers on stackoverflow but did not help.
Found my error. The flaskapp.wsgi should be as follows:
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/FlaskApp/")
from publimundo import app as application
application.secret_key = 'some secret key here'

apache2 python 3.4.3 ubuntu error wsgi no module named

I try deploying Django in apache2 with python 3.4, but send error 500.
apache error.log:
[Sat May 13 15:56:53.638802 2017] [mpm_event:notice] [pid 3610:tid 140692947613568] AH00489: Apache/2.4.12 (Ubuntu) mod_wsgi/4.3.0 Python/3.4.3+ configured -- resuming normal operations
[Sat May 13 15:56:53.638897 2017] [core:notice] [pid 3610:tid 140692947613568] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 13 15:56:56.622523 2017] [wsgi:error] [pid 3613:tid 140692834260736] [remote 181.75.140.109:26259] mod_wsgi (pid=3613): Target WSGI script '/var/www/html/reportado-plataforma/reportalo/wsgi.py' cannot be loaded as Python module.
[Sat May 13 15:56:56.622610 2017] [wsgi:error] [pid 3613:tid 140692834260736] [remote 181.75.140.109:26259] mod_wsgi (pid=3613): Exception occurred processing WSGI script '/var/www/html/reportado-plataforma/reportalo/wsgi.py'
[Sat May 13 15:56:56.622646 2017] [wsgi:error] [pid 3613:tid 140692834260736] [remote 181.75.140.109:26259] Traceback (most recent call last):
[Sat May 13 15:56:56.622842 2017] [wsgi:error] [pid 3613:tid 140692834260736] [remote 181.75.140.109:26259] File "/var/www/html/reportado-plataforma/reportalo/wsgi.py", line 12, in <module>
[Sat May 13 15:56:56.622851 2017] [wsgi:error] [pid 3613:tid 140692834260736] [remote 181.75.140.109:26259] from django.core.wsgi import get_wsgi_application
[Sat May 13 15:56:56.622876 2017] [wsgi:error] [pid 3613:tid 140692834260736] [remote 181.75.140.109:26259] ImportError: No module named 'django'
I installed
sudo apt-get install python3-pip apache2 libapache2-mod-wsgi-py3
my VirtualHost:
WSGIScriptAlias / /var/www/html/reportado-plataforma/reportalo/wsgi.py
WSGIDaemonProcess reportalo python-path=/var/www/html/reportado-plataforma:/root/env/lib/python3.4/site-packages
WSGIProcessGroup reportalo
WSGIPassAuthorization On
virtualhost directory:
<Directory /var/www/html/reportado-plataforma/reportalo>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
my environment:
appdirs==1.4.3
Django==1.11.1
django-cors-headers==2.0.2
django-filter==1.0.2
django-geoposition==0.3.0
django-location-field==2.0.3
djangorestframework==3.6.2
djangorestframework-gis==0.11.1
Markdown==2.6.8
olefile==0.44
packaging==16.8
Pillow==4.1.1
psycopg2==2.7.1
pyparsing==2.2.0
pytz==2017.2
six==1.10.0
uWSGI==2.0.15
The user that Apache runs your code as is unlikely to have the ability to see anything under the /root directory. Usually only root can see into that directory. Place your application Python virtual environment somewhere else.
Also read:
http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html
for the recommended way of setting up a Python virtual environment with mod_wsgi. Use python-home as documented and not python-path.

My Apache WSGI Flask web-app cannot import its internal python module

I have developed Flask-Web-App which runs fine if I use python command-line directly. However, when I deployed to Apache2 with mod-wsgi it can't import its internal modules. I have read all the relevant posts similar to mine but couldn't figure out the issue yet. Firstly, I tried all below:
1 - Made sure all files and sub-folder under the application folder have rwx permission for www-data ("the Apache2 service account").
2 - Added the module path to the Apache config file using: WSGIPythonPath /var/www/FlaskApp/FlaskApp/Base/:/var/www/FlaskApp/FlaskApp/Base/Form/:/var/www/FlaskApp/FlaskApp/Base/Model/ (see below:)
3 - Added the module path to sys.path variable in wsgi script.
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/FlaskApp/")
sys.path.append('/var/www/FlaskApp/FlaskApp/Base/')
sys.path.append('/var/www/FlaskApp/FlaskApp/Base/Form/')
sys.path.append('/var/www/FlaskApp/FlaskApp/Base/Model/')
from FlaskApp import app as application
application.secret_key = 'as345kj34h5kljj34sy'
All my internal imports are in init.py which starts up the application like below:
# internal imports
import Base.Model as Model
from Base import Constant as cnst
from Base.Form import UserRegistrationForm, ProductForm
.
.
.
if __name__ == "__main__":
app.run()
I just don't have any other idea what else I might have possibly missed. Again everything works just fine when using the python interpreter from command-line.
You help is MUCH MUCH appreciate it.
Regards,
Mehdi/Mike
Error.log
[Fri Sep 09 22:59:43.068802 2016] [mpm_event:notice] [pid 10719:tid 139878768617344] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Fri Sep 09 22:59:43.068872 2016] [core:notice] [pid 10719:tid 139878768617344] AH00094: Command line: '/usr/sbin/apache2'
[Fri Sep 09 22:59:47.926252 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] mod_wsgi (pid=10720): Target WSGI script '/var/www/FlaskApp/flaskapp.wsgi' cannot be loaded as Python module.
[Fri Sep 09 22:59:47.926300 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] mod_wsgi (pid=10720): Exception occurred processing WSGI script '/var/www/FlaskApp/flaskapp.wsgi'.
[Fri Sep 09 22:59:47.926325 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] Traceback (most recent call last):
[Fri Sep 09 22:59:47.926343 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] File "/var/www/FlaskApp/flaskapp.wsgi", line 10, in <module>
[Fri Sep 09 22:59:47.926403 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] from FlaskApp import app as application
[Fri Sep 09 22:59:47.926414 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] File "/var/www/FlaskApp/FlaskApp/__init__.py", line 22, in <module>
[Fri Sep 09 22:59:47.926848 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] from Base.Form import UserRegistrationForm, ProductForm
[Fri Sep 09 22:59:47.926889 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] File "/var/www/FlaskApp/FlaskApp/Base/Form/__init__.py", line 1, in <module>
[Fri Sep 09 22:59:47.926975 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] from UserRegistrationForm import UserRegistrationForm
[Fri Sep 09 22:59:47.927007 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] File "/var/www/FlaskApp/FlaskApp/Base/Form/UserRegistrationForm.py", line 2, in <module>
[Fri Sep 09 22:59:47.927098 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] from Base.Model import db_session, User
[Fri Sep 09 22:59:47.927156 2016] [:error] [pid 10720:tid 139878671300352] [client ::1:55866] ImportError: No module named Base.Model
flaskapp.wsgi
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/FlaskApp/")
sys.path.append('/var/www/FlaskApp/FlaskApp/Base/')
sys.path.append('/var/www/FlaskApp/FlaskApp/Base/Form/')
sys.path.append('/var/www/FlaskApp/FlaskApp/Base/Model/')
from FlaskApp import app as application
application.secret_key = 'as345kj34h5kljj34sy'
FlaskApp.conf
WSGIPythonPath /var/www/FlaskApp/FlaskApp/Base/:/var/www/FlaskApp/FlaskApp/Base/Form/:/var/www/FlaskApp/FlaskApp/Base/Model/
<VirtualHost *:80>
ServerName localhost
ServerAdmin admin#eynaksara.com
WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
<Directory /var/www/FlaskApp/FlaskApp/>
Order allow,deny
Allow from all
</Directory>
Alias /static /var/www/FlaskApp/FlaskApp/static
<Directory /var/www/FlaskApp/FlaskApp/static/>
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Instead of:
WSGIPythonPath /var/www/FlaskApp/FlaskApp/Base/:/var/www/FlaskApp/FlaskApp/Base/Form/:/var/www/FlaskApp/FlaskApp/Base/Model/
<VirtualHost *:80>
ServerName localhost
ServerAdmin admin#eynaksara.com
WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
<Directory /var/www/FlaskApp/FlaskApp/>
Order allow,deny
Allow from all
</Directory>
Alias /static /var/www/FlaskApp/FlaskApp/static
<Directory /var/www/FlaskApp/FlaskApp/static/>
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
try using:
<VirtualHost *:80>
ServerName localhost
ServerAdmin admin#eynaksara.com
WSGIDaemonProcess myapp python-path=/var/www/FlaskApp/FlaskApp
WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi process-group=myapp application-group=%{GLOBAL}
<Directory /var/www/FlaskApp>
<Files flaskapp.wsgi>
Order allow,deny
Allow from all
</Files>
</Directory>
Alias /static /var/www/FlaskApp/FlaskApp/static
<Directory /var/www/FlaskApp/FlaskApp/static/>
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Changes made are:
Use mod_wsgi daemon mode not embedded mode. See http://blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html
Correct Apache directory access authorisation. That it worked as you had it suggests you have lax security settings elsewhere in Apache configuration as what you had shouldn't have worked. Have changed it to preferred mechanism, but you should work out why your Apache configuration has it allowing Apache to serve up any file in the file system.
Set the correct Python module search path. Done on the daemon process group since switched to that.
For use of Python main (application) interpreter context in daemon process group to avoid issues with third party extension modules for Python that will not work in sub interpreters.

Apache Wsgi virtualHost, Django virtual env "no module named django.core.wsgi"

I have seen plenty of previous messages related to my problem, but no answer could get rid of my "500 Server internal Error" so I try to post my conf to get help.
Error Message:
[Fri Jun 24 17:05:23.631270 2016] [authz_core:error] [pid 15187:tid 140715758237440] [client 127.0.0.1:47873] AH01630: client denied by server configuration: /home/www/waves/
[Fri Jun 24 17:05:23.631568 2016] [:error] [pid 15186:tid 140715648984832] ['/home/marc/.virtualenvs/waves/lib/python2.7/site-packages', '/home/www/waves', '/usr/local/lib/python2.7/dist-packages/setuptools-20.6.7-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
[Fri Jun 24 17:05:23.631660 2016] [:error] [pid 15186:tid 140715648984832] [remote 127.0.0.1:50665] mod_wsgi (pid=15186): Target WSGI script '/home/www/waves/waves_services/wsgi.py' cannot be loaded as Python module.
[Fri Jun 24 17:05:23.631675 2016] [:error] [pid 15186:tid 140715648984832] [remote 127.0.0.1:50665] mod_wsgi (pid=15186): Exception occurred processing WSGI script '/home/www/waves/waves_services/wsgi.py'.
[Fri Jun 24 17:05:23.631686 2016] [:error] [pid 15186:tid 140715648984832] [remote 127.0.0.1:50665] Traceback (most recent call last):
[Fri Jun 24 17:05:23.631710 2016] [:error] [pid 15186:tid 140715648984832] [remote 127.0.0.1:50665] File "/home/www/waves/waves_services/wsgi.py", line 18, in
[Fri Jun 24 17:05:23.631731 2016] [:error] [pid 15186:tid 140715648984832] [remote 127.0.0.1:50665] from django.core.wsgi import get_wsgi_application
[Fri Jun 24 17:05:23.631743 2016] [:error] [pid 15186:tid 140715648984832] [remote 127.0.0.1:50665] ImportError: No module named django.core.wsgi
My django app do not load in apache wsgi mode, I tried many solutions but still don't work. Here is my confs files :
Virtual host :
<VirtualHost *:80>
ServerName dev.www.waves.com
ServerAlias www.waves.com
ServerAdmin webmaster#waves.com
DocumentRoot /home/www/waves
Alias media/ /home/www/waves/media/
Alias static/ /home/www/waves/static/
<Directory /home/www/waves>
Require all granted
</Directory>
<Directory /home/www/waves/staticfiles>
Require all granted
</Directory>
<Directory /home/www/waves/media>
Require all granted
</Directory>
WSGIDaemonProcess waves python-path=/home/marc/.virtualenvs/waves/lib/python2.7/site-packages:/home/www/waves
WSGIProcessGroup waves
WSGIScriptAlias /waves /home/www/waves/waves_services/wsgi.py
<Directory /home/www/waves/waves_services>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
<Directory /home/marc/.virtualenvs/waves/lib/python2.7/>
Require all granted
</Directory>
My wsgy.py content :
from __future__ import unicode_literals
import os
import sys
import site
print sys.path
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "waves_services.settings.production")
application = get_wsgi_application()
I traced to sys.path content in apache error log, and the virtualenv in in sys.path.
Django is installed in this virtualenv (I had first tried to install django 'globally' but the error was just moved to the first 'application specific' import : environ contained in my settings file.
The virtual env was created with virtualenvwrapper (any impact ?)
I tried as well to change ownership of virtualenv file, changed 'execution' flag as well, but still I get this ... 500 Server Error.
I would be grateful to get a clue of what is happening !
thanxs
Several things to check for.
Make sure that the virtualenv has django (pip freeze | grep django)
Check if apache user can access the virtualenv by checking the folder permissions
if you are using apache 2.4 + change the following
Order deny,allow
Allow from all
to
Require all granted
Edit suggested by #marcoooo (OP) : don't put virtualenv base dir under any home dir which do not have 'x' flag, apache www-data user won't be able to activate the virtualenv either.... Many thanxs to e4c5 for his help, and saved my day (and nights)