так, посондрэ.
Мигрировали мы на другой сервер, где стоит 1.4.7
на mod_wsgi поплевали и каким-то образом прикрутили. Но, таки есть одно НО.
Приложение не запускается:)
вот такую лабуду мне пишет в логи:
PS: <SOME_ALIAS> - некий стринг с хостом сервера "наружу". Это константа и везде она одинаковая. Решил скрыть, что б гугло не просканировало
[Tue Sep 24 14:14:02 2013] [error] Exception KeyError: KeyError(34401711104,) in <module 'threading' from '/usr/local/lib/python2.7/threading.pyc'> ignored
[Tue Sep 24 14:14:02 2013] [error] Exception KeyError: KeyError(34401711104,) in <module 'threading' from '/usr/local/lib/python2.7/threading.pyc'> ignored
[Tue Sep 24 14:14:06 2013] [error] [client 192.168.0.36] mod_wsgi (pid=33255): Exception occurred processing WSGI script '/usr/local/www/<SOME_ALIAS>/django.wsgi'.
[Tue Sep 24 14:14:06 2013] [error] [client 192.168.0.36] Traceback (most recent call last):
[Tue Sep 24 14:14:06 2013] [error] [client 192.168.0.36] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
[Tue Sep 24 14:14:06 2013] [error] [client 192.168.0.36] self.load_middleware()
[Tue Sep 24 14:14:06 2013] [error] [client 192.168.0.36] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware
[Tue Sep 24 14:14:06 2013] [error] [client 192.168.0.36] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Tue Sep 24 14:14:06 2013] [error] [client 192.168.0.36] ImproperlyConfigured: Error importing middleware tracker.middleware: "No module named tracker.middleware"
[Tue Sep 24 14:14:07 2013] [error] [client 192.168.0.36] mod_wsgi (pid=33256): Exception occurred processing WSGI script '/usr/local/www/<SOME_ALIAS>/django.wsgi'.
Т.е, как видим, оно не импортит мидлварю. Какого фига - понятия не имею. Файл middleware.py лежит в корне проекта.
теперь настройки апача:
<VirtualHost *:80>
ServerAdmin some@email
ServerName trckr
ServerAlias <SOME_ALIAS>
WSGIScriptAlias / "/usr/local/www/<SOME_ALIAS>/django.wsgi"
<Directory />
Order allow,deny
Allow from All
Options FollowSymLinks
AllowOverride None
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
Order allow,deny
Allow from All
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
</Directory>
<Directory /usr/local/www/<SOME_ALIAS>>
Order allow,deny
Allow from All
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
<Directory "/usr/local/www/<SOME_ALIAS/static">
Order allow,deny
Allow from all
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
</Directory>
WSGIDaemonProcess trckr processes=2 maximum-requests=100 threads=2
WSGIProcessGroup trckr
CustomLog /var/log/httpd/trckr-access.log combined
ErrorLog /var/log/httpd/trckr-errors.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/httpd/trckr-access.log combined
Alias /admin/media/ "/usr/local/lib/python2.7/site-packages/django/contrib/admin/static/"
Alias /static/ "/usr/local/www/>SOME_ALIAS>/static/"
<Location "/">
Order allow,deny
Allow from all
</Location>
<Location "/cgi-bin">
SetHandler None
</Location>
<Location "/static">
SetHandler None
</Location>
<Location "/media">
SetHandler None
</Location>
</VirtualHost>
ну и сам django.wsgi:
import os, sys, site
sys.path.insert(0, os.path.dirname(__file__))
#site.addsitedir('/usr/local/lib/python2.7/site-packages')
os.environ['DJANGO_SETTINGS_MODULE'] = 'tracker.settings'
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
зы: сервак люто работает на фряхе