문제

나는 mod_python (Rhel 5) 대신 mod_wsgi로 django 사이트를 실행하려고합니다. 나는 내 모든 사이트에서 이것을 시도했지만 같은 문제를 겪습니다. 모든 사람이 추천하는 표준 방식으로 구성했지만 사이트에 대한 요청은 단순히 시간 초과입니다.

Apache Conf :

<VirtualHost 74.54.144.34>
    DocumentRoot /wwwclients/thymeandagain
    ServerName thymeandagain4corners.com
    ServerAlias www.thymeandagain4corners.com
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    CustomLog /var/log/httpd/thymeandagain_access_log combined
    ErrorLog /var/log/httpd/thymeandagain_error_log
    LogLevel error
    WSGIScriptAlias / /wwwclients/thymeandagain/wsgi_handler.py
    WSGIDaemonProcess thymeandagain user=admin group=admin processes=1 threads=16
    WSGIProcessGroup thymeandagain
</VirtualHost>

wsgi_handler.py :

import sys
import os

sys.path.append("/wwwclients")
os.environ['DJANGO_SETTINGS_MODULE'] = 'thymeandagain.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

데몬 mod_wsgi는 스폰되어 있어야합니다. 따라서 시간을 초과하는 요청을 요청하고 로그에서 "WSGI 데몬 프로세스에 연결할 수 없습니다"오류가 발생합니다. WSGIDAEMONPROCESS 지침에 대한 데몬의 생성을 막는 것이 있습니까? 도움을 주셔서 감사합니다 ...

편집 : 오류 로그에서 이것을 얻습니다.

[WARN@1227228322.174175] mcm_server_readable():2582: timeout: Operation now in progress: select(2) call timed out for read(2)able fds
[INFO@1227228322.174263] mcm_get_line():1592
[WARN@1227227903.249626] mcm_server_readable():2582: timeout: Operation now in progress: select(2) call timed out for read(2)able fds
[INFO@1227227903.249712] mcm_get_line():1592
[Thu Nov 20 21:18:17 2008] [notice] caught SIGTERM, shutting down
[Thu Nov 20 21:18:18 2008] [notice] Digest: generating secret for digest authentication ...
[Thu Nov 20 21:18:18 2008] [notice] Digest: done
[Thu Nov 20 21:18:18 2008] [notice] mod_python: Creating 4 session mutexes based on 8 max processes and 64 max threads.
[Thu Nov 20 21:18:18 2008] [notice] Apache/2.2.3 (Red Hat) mod_python/3.2.8 Python/2.4.3 mod_wsgi/2.1-BRANCH configured -- resuming normal operations
도움이 되었습니까?

해결책

문제는 mod_python이 mod_wsgi와 잘 어울리지 않는다는 것입니다. 나는 몇 주 전에 비슷한 문제에 빠졌고 mod_python 포함을 언급 한 직후 모든 것이 나에게 일하기 시작했습니다.

검색해보십시오 modwsgi.org "mod_python"을위한 Wiki, 나는 누군가가 댓글에 이것에 대해 이야기하고 있다고 믿는다.

다른 팁

실제 문제는 Apache Log 디렉토리에 대한 권한입니다. Apache/mod_wsgi에게 데몬 프로세스와 통신하는 데 사용되는 Unix 소켓의 대체 위치를 사용하도록 지시해야합니다. 보다:

http://code.google.com/p/modwsgi/wiki/configurationiss#location_of_unix_sockets

여기 django를 mod_wsgi와 통합하는 방법에 대한 자세한 설명입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top