My Flask and mod_wsgi app seems to be breaking ports. Every month or so my 
page will stop loading and I get a "Google Chrome could not connect to " 
message, but moving it to a new port fixes it. I've checked the apache log 
and there doesn't seem to be anything wrong there. If I stop apache from 
listening to the port and run my dev version of the Flask app on one of the 
ports that the live version has previously used I get the same "Google 
Chrome could not connect to " message. While apache is listening Netstat 
shows that the port is being listened to by apache and lsof -i returns a 
bunch of apache processes that are using the port. I'm not sure if any of 
that is normal for mod_wsgi. If I remove the port from apache both netstat 
and lsof return nothing but the port still doesn't work for mod_wsgi or 
flask.

Here is the mod_wsgi part of my apache config file with the ip, domain, and 
user/group changed

<VirtualHost 0.0.0.0:8880>ServerName test.example.comDocumentRoot /var/www/html
WSGIDaemonProcess dash user=user group=group threads=5
WSGIScriptAlias / /var/www/html/dash/dashboard.wsgi
<Directory /var/www/html/dash>
    WSGIProcessGroup dash
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all</Directory>
# records regular flask errorsErrorLog /var/www/html/dash/error.logLogLevel warn

Here is my wsgi file

import osimport sys
# location of flask app
sys.path.insert(0, '/var/www/flask/dashboard')

from dashboard import app as application
# logs python errors at production.logif not application.debug:
    import logging
    this_dir = os.path.dirname(__file__)
    log_file = os.path.join(this_dir, 'production.log')
    file_handler = logging.FileHandler(log_file)
    file_handler.setLevel(logging.WARNING)
    application.logger.addHandler(file_handler)


-- 
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/groups/opt_out.

Reply via email to