apache - Why does page hang/timeout with apache2, mod_wsgi, django, in virtual environment and under non-privileged user -


when go 52.1.65.249, page hangs or times out. have django project located under non-root user @ /home/usrbkto/bkto/projbkto.

i have same problem on 2 servers running ubuntu 14.04 , python 2.7.8 , ubuntu 15.04 , python 2.7.9. believe mod_wsgi on pypi compiled using python 2.7.8, server running python 2.7.9 downloaded github , compiled using version of python on server. working fine until updated packages @ once, i'm not sure package update broke things. suspect has fact i'm not using new version of mod_wsgi correctly, i'm not sure , want keep django project under non-root user without access apache files.

my custom conf file @ /etc/apache2/sites-available/bkto.conf is:

wsgiscriptalias / /home/usrbkto/bkto/projbkto/projbkto/wsgi.py wsgipythonhome /home/usrbkto/vent wsgipythonpath /home/usrbkto/bkto/projbkto  loglevel info   <directory /home/usrbkto/bkto/projbkto/projbkto> <files wsgi.py> require granted </files> </directory>  alias /media/ /home/usrbkto/bkto/projbkto/media/ alias /static/ /home/usrbkto/bkto/projbkto/static/  <directory /home/usrbkto/bkto/projbkto/static> require granted </directory>  <directory /home/usrbkto/bkto/projbkto/media> require granted </directory> 

the apache error.log is:

[mon jun 01 05:14:41.082545 2015] [mpm_event:notice] [pid 32630:tid 140666831587200] ah00489: apache/2.4.10 (ubuntu) mod_wsgi/4.4.12 python/2.7.9 configured -- resuming normal operations [mon jun 01 05:14:41.082692 2015] [mpm_event:info] [pid 32630:tid 140666831587200] ah00490: server built: mar  9 2015 11:53:48 [mon jun 01 05:14:41.082713 2015] [core:notice] [pid 32630:tid 140666831587200] ah00094: command line: '/usr/sbin/apache2' [mon jun 01 05:14:41.083297 2015] [wsgi:info] [pid 32634:tid 140666831587200] mod_wsgi (pid=32634): python home /home/usrbkto/venv. [mon jun 01 05:14:41.083401 2015] [wsgi:info] [pid 32634:tid 140666831587200] mod_wsgi (pid=32634): initializing python. [mon jun 01 05:14:41.089325 2015] [wsgi:info] [pid 32632:tid 140666831587200] mod_wsgi (pid=32632): python home /home/usrbkto/venv. [mon jun 01 05:14:41.089442 2015] [wsgi:info] [pid 32632:tid 140666831587200] mod_wsgi (pid=32632): initializing python. [mon jun 01 05:14:41.181394 2015] [wsgi:info] [pid 32634:tid 140666831587200] mod_wsgi (pid=32634): attach interpreter ''. [mon jun 01 05:14:41.181479 2015] [wsgi:info] [pid 32634:tid 140666831587200] mod_wsgi (pid=32634): adding '/home/usrbkto/bkto/projbkto' path. [mon jun 01 05:14:41.182781 2015] [wsgi:info] [pid 32634:tid 140666831587200] mod_wsgi (pid=32634): imported 'mod_wsgi'. [mon jun 01 05:14:41.186652 2015] [wsgi:info] [pid 32632:tid 140666831587200] mod_wsgi (pid=32632): attach interpreter ''. [mon jun 01 05:14:41.186718 2015] [wsgi:info] [pid 32632:tid 140666831587200] mod_wsgi (pid=32632): adding '/home/usrbkto/bkto/projbkto' path. [mon jun 01 05:14:41.212429 2015] [wsgi:info] [pid 32632:tid 140666831587200] mod_wsgi (pid=32632): imported 'mod_wsgi'. [mon jun 01 05:14:47.101220 2015] [wsgi:info] [pid 32634:tid 140666698360576] mod_wsgi (pid=32634): create interpreter 'ip-172-31-4-180.ec2.internal|'. [mon jun 01 05:14:47.102574 2015] [wsgi:info] [pid 32634:tid 140666698360576] mod_wsgi (pid=32634): adding '/home/usrbkto/bkto/projbkto' path. [mon jun 01 05:14:47.104087 2015] [wsgi:info] [pid 32634:tid 140666698360576] [client 64.94.31.206:47918] mod_wsgi (pid=32634, process='', application='ip-172-31-4-180.ec2.internal|'): loading wsgi script '/home/usrbkto/bkto/projbkto/projbkto/wsgi.py'. [mon jun 01 05:16:46.847615 2015] [wsgi:info] [pid 32632:tid 140666612999936] mod_wsgi (pid=32632): create interpreter 'ip-172-31-4-180.ec2.internal|'. [mon jun 01 05:16:46.848995 2015] [wsgi:info] [pid 32632:tid 140666612999936] mod_wsgi (pid=32632): adding '/home/usrbkto/bkto/projbkto' path. [mon jun 01 05:16:46.850506 2015] [wsgi:info] [pid 32632:tid 140666612999936] [client 166.137.244.128:61084] mod_wsgi (pid=32632, process='', application='ip-172-31-4-180.ec2.internal|'): loading wsgi script '/home/usrbkto/bkto/projbkto/projbkto/wsgi.py'. 

the wsgi.py file @ /home/usrbkto/bkto/projbkto/projbkto/wsgi.py is:

""" wsgi config projbkto project.  exposes wsgi callable module-level variable named ``application``.  more information on file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """  import os os.environ.setdefault("django_settings_module", "projbkto.settings")  django.core.wsgi import get_wsgi_application application = get_wsgi_application() 

the mod_wsgi versions of pypi source code , not binaries. mod_wsgi on pypi compiled python version doesn't make sense compiled on own system using whatever python version have.

anyway, read , try remedy given:

this usual fix lock ups caused python c extensions aren't coded work in sub interpreters.

also stop using embedded mode , use daemon mode instead:

if these don't help, indicate whether reproducible or random.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -