XSendFile не будет обслуживать файлы в Apache 2.2

Я использую mod_xsendfile (v0.12) для обслуживания статических файлов, где Django контролирует доступ к файлам на основе пользователей и разрешений.

В В моем файле conf у меня есть:

XSendFile On
XSendFilePath e:/documents/


  Order allow,deny
  Allow from all

В моем коде django я установил заголовки следующим образом:

assert(isinstance(filename, FieldFile))

xsendfile = filename.name
if(platform.system() == 'Windows'):
    xsendfile = xsendfile.replace('\\', '/')

response = HttpResponse()
response['X-Sendfile'] = xsendfile
mimetype = mimetypes.guess_type(xsendfile)[0]
response['Content-Type'] = mimetype
response['Content-Length'] = filename.size

И в моем файле журнала я получил:

[Fri Oct 22 08:54:22 2010] [error] [client 192.168.20.34] (20023)The given path
was above the root path: xsendfile: unable to find file:
e:/Documents/3/2010-10-20/TestDocument.pdf

В этой версии mod_xsendfile ,

XSendFileAllowAbove On

генерирует ошибку:

Invalid command 'XSendFileAllowAbove', perhaps misspelled or defined by a module
not included in the server configuration

Я предположил, что это произошло из-за того, что они добавили белый список XSendFilePath . Кто-нибудь еще заставил это работать?

9
задан boatcoder 18 March 2013 в 18:15
поделиться