django - Apache2 can not load wsgi.py -
i using ubuntu 14.10 x86_64 system softwares in below:
- python 3.4
- apache2
- libapache2-mod-wsgi-py3
- django1.8
i created project django1.8 @ path:
/var/www/html/koorimeo
i've noticed django-admin startproject generate wsgi.py file default , haven't change content.
i configured apache2 under official document(how use django apache , mod_wsgi) details:
i modified 000-default.conf don't want setup virtual host. , added:
#000-default.conf <virtualhost *:80> ... <directory /var/www/html/koorimeo/koorimeo> <files wsgi.py> require granted </files> </directory> ... </virtualhost>
after declare wsgialias , wsgipythonpath in apache2.conf:
#apache2.conf #i want leave "/" other use... wsgiscriptalias /koorimeo /var/www/html/koorimeo/koorimeo/wsgi.py wsgipythonpath /var/www/html/koorimeo/koorimeo
after finished setting files restarted apache2 service , login 127.0.0.1/koorimeo, returned 500 error message... looked error log file , these error message:
bing@k-lab:/var/log/apache2$ tail error.log [sat apr 25 14:35:31.214661 2015] [:notice] [pid 16997:tid 140004070725504] mod_python: creating 8 session mutexes based on 6 max processes , 25 max threads. [sat apr 25 14:35:31.214705 2015] [:notice] [pid 16997:tid 140004070725504] mod_python: using mutex_directory /tmp [sat apr 25 14:35:31.232634 2015] [:warn] [pid 16997:tid 140004070725504] mod_wsgi: compiled python/3.4.0. [sat apr 25 14:35:31.232682 2015] [:warn] [pid 16997:tid 140004070725504] mod_wsgi: runtime using python/2.7.6. [sat apr 25 14:35:31.232766 2015] [mpm_event:notice] [pid 16997:tid 140004070725504] ah00489: apache/2.4.7 (ubuntu) mod_python/3.3.1 python/2.7.6 mod_wsgi/3.4 configured -- resuming normal operations [sat apr 25 14:35:31.232786 2015] [core:notice] [pid 16997:tid 140004070725504] ah00094: command line: '/usr/sbin/apache2' [sat apr 25 14:35:32.234958 2015] [core:notice] [pid 16997:tid 140004070725504] ah00051: child pid 18325 exit signal aborted (6), possible coredump in /etc/apache2 [sat apr 25 14:35:32.235070 2015] [core:notice] [pid 16997:tid 140004070725504] ah00051: child pid 18326 exit signal aborted (6), possible coredump in /etc/apache2 [sat apr 25 14:35:34.041184 2015] [:error] [pid 18599:tid 140003960342272] [client 127.0.0.1:51134] mod_wsgi (pid=18599): target wsgi script '/var/www/html/koorimeo/koorimeo/wsgi.py' cannot loaded python module., referer: http://localhost/ [sat apr 25 14:35:34.041279 2015] [:error] [pid 18599:tid 140003960342272] [client 127.0.0.1:51134] mod_wsgi (pid=18599): exception occurred processing wsgi script '/var/www/html/koorimeo/koorimeo/wsgi.py'., referer: http://localhost/
according these message found apache2 can not find module:
/var/www/html/koorimeo/wsgi.py
so copy path , try me clear wheather file exist:
bing@k-lab:/var/log/apache2$ ls /var/www/html/koorimeo/koorimeo/wsgi.py -l
and system returned message told me file exists...
-rw-rw-r-- 1 bing bing 389 4月 25 14:21 /var/www/html/koorimeo/koorimeo/wsgi.py
and make sure i've installed libapache2-mod-wsgi-py3, did find wsgi.so in proper location.
i've found wsgi.load in modes-enable , pointed wsgi.so in right place:
loadmodule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
so... confused...
please tell me why can't apache2 find wsgi.py file?
remove mod_python apache if not using it.
your mod_wsgi module compiled python 3.4.0, mod_python compiled 2.7.6. because mod_python using different version overriding python version used , stop mod_wsgi working.
read many sections in documentation starting at:
Comments
Post a Comment