Проблема с mod_perl

Запросы на решение проблем

Модератор: ykolesnikov

Ответить
tyesman
OTRS Новобранец
Сообщения: 39
Зарегистрирован: 16 ноя 2015, 16:14

Проблема с mod_perl

Сообщение tyesman » 12 янв 2016, 15:38

Доброго дня коллеги.
При обновлении OTRS c 3.0.x до 4 возникла проблема, точнее их много, но пока самая актуальная связанная с работой модуля mod_perl.

В конфиге apache дефолтовая настройка для ОТРС:

Код: Выделить всё

<IfModule mod_perl.c>
    Perlrequire /opt/otrs/scripts/apache2-perl-startup.pl
    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload
    DirectoryIndex index.pl index.html
        <Location /otrs>
           ErrorDocument 403 /otrs/index.pl
           SetHandler  perl-script
           PerlResponseHandler ModPerl::Registry
           Options +ExecCGI
           PerlOptions +ParseHeaders
           PerlOptions +SetupEnv
        </Location>
    <Location /otrs/nph-genericinterface.pl>
        PerlOptions -ParseHeaders
    </Location>
</IfModule>
В ходе работы было выявлено, что не все прикрепленные к заявкам файлы открываются в ОТРС.

В FIREBUG можно увидеть, что при обращении к прикрепленному файлу сервер возвращает 500 Internal Server Error

Заголовок ответа:

Код: Выделить всё

HTTP/1.1 500 Internal Server Error
Date: Tue, 12 Jan 2016 12:05:03 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_perl/2.0.9dev Perl/v5.16.3
Content-Length: 17243
Cache-Control: max-age=0, no-store
Connection: close
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name="=?windows-1251?Q?имя_файла_изменено
Заголовок запроса:

Код: Выделить всё

GET /otrs/index.pl?Action=AgentTicketAttachment;ArticleID=ххх;FileID=3 HTTP/1.1
Host: ххх.ru
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://ххх/otrs/index.pl?Action=AgentTicketZoom;TicketID=ххх
Cookie: OTRSAgentInterface=ххх
Connection: keep-alive
В логе апача только такая ошибка:

Код: Выделить всё

[Tue Jan 12 15:03:36.603219 2016] [core:error] [pid 29422] [client xx.xx.xx.xx:33512] Premature end of script headers: index.pl, referer: https://xxx.ru/otrs/index.pl?Action=AgentTicketZoom;TicketID=ххх
[Tue Jan 12 15:03:36.603271 2016] [perl:warn] [pid 29422] /otrs/index.pl did not send an HTTP header
Правильного решения пока не нашел, но думаю что что-то не так с заголовками или как-то не корректно обрабатываются прикрепленные файлы application/vnd.openxmlformats-officedocument.spreadsheetml.sheet в OTRS.

Если в конфиге апача в секции <IfModule mod_perl.c> закомментировать и добавить AddHandler cgi-script .cgi, то все файлы доступны и их можно скачать.

Код: Выделить всё

 
#SetHandler  perl-script
#PerlResponseHandler ModPerl::Registry
AddHandler cgi-script .cgi
Ответ сервера в таком случае выглядит иначе:

Код: Выделить всё

HTTP/1.1 200 OK
Date: Tue, 12 Jan 2016 12:06:05 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_perl/2.0.9dev Perl/v5.16.3
Content-Disposition: attachment;  filename="блабла-имя-файла-именено.xlsx
X-UA-Compatible: IE=edge,chrome=1
X-Frame-Options: SAMEORIGIN
Content-Length: 17243
Cache-Control: max-age=0, no-store
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name="=?windows-1251?Q?блаблабла_имя_файла_в_виндовой_кодировке"
Кто силен в mod_perl, что не так в настройках модуля?
В этой же заявке есть другой файл pdf, и от загружается нормально с активированными опциями "SetHandler perl-script"

Ответить