I've been working on this same error for the last few days, and can't seem 
to find any way around it. I'm trying to use a virtual environment with my 
python install in order to move my Flask app into production. When I 
restart my webserver (sudo service apache2 restart), I don't get anything 
reaction from the server when I point my browser to www.example.com. 

I'm using Ubuntu14.04, Apache/2.4.7 (Ubuntu), Python 2.7.6, & mod_wsgi 
4.4.8. This is a designated server, and when I run python manage.py 
runserver (to launch a development environment) I can access the page at 
www.example.com:5000 (served at 0:0:0:0:5000), so internally python is 
working OK.

I ran mod_wsgi-express start-server to test the wsgi installation and was 
outputted 

Server URL         : http://localhost:8000
Server Root        : /tmp/mod_wsgi-localhost:8000:1000
Server Conf        : /tmp/mod_wsgi-localhost:8000:1000/httpd.conf
Error Log File     : /tmp/mod_wsgi-localhost:8000:1000/error_log
Request Capacity   : 5 (1 process * 5 threads)
Request Timeout    : 60 (seconds)
Queue Backlog      : 100 (connections)
Queue Timeout      : 45 (seconds)
Server Capacity    : 20 (event/worker), 20 (prefork)
Server Backlog     : 500 (connections)
Locale Setting     : en_US.UTF-8

Which leads me to believe the installation is working find. Here are the 
contents of both my WSGI Configuration:

import sys, os
# activate_this = '/var/www/myApp/venv/bin/activate.py'
# execfile(activate_this, dict(__file__=activate_this))
ALLDIRS = ['/var/www/myApp/venv/bin/activate_this.py']
import site
# Remember original sys.path.
prev_sys_path = list(sys.path)
# Add each new site-packages directory.
for directory in ALLDIRS
  site.addsitedir(directory)
# Reorder sys.path so new directories at the front.
new_sys_path = []
for item in list(sys.path):
    if item not in prev_sys_path:
        new_sys_path.append(item)
      sys.path.remove(item)
sys.path[:0] = new_sys_path
sys.path.insert(0, '/var/www/MyApp'
os.chdir("/var/www/MyApp")
from MyApp import app as application

and my Apache configuration: 

WSGIPythonHome /var/www/myApp/venv/bin/activate
<VirtualHost *:80>
        ServerName example.com
                 ServerAdmin [email protected]      
                 WSGIScriptAlias / /var/www/myApp/myApp.wsgi
<Directory /var/www/myApp/>
            WSGIProcessGroup myApp
           WSGIApplicationGroup %{GLOBAL
            Order allow,deny
            Allow from all
      </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
</VirtualHost>


I'm at a loss. When I run sudo service apache2 restart, and check my logs 
in /var/log/apache2/error.log all I have is thousands of lines of "Import 
Error: no module named site", because it is outputting it about once every 
second.

Any help or a reference to this problem would really be appreciated, 
otherwise I'll make sure to try and update this if I figure it out in the 
meantime. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to