Search code examples
mod-perl2mod-perl-registry

CGI script runned with ModPerl::Registry doesn't print result on html page, just download it


Here is my sandbox https://github.com/pavelsr/mod_perl_sandbox

When I make docker-compose up then go to http://localhost:3000/env.pl resulted html is downloaded, not served.

Under CGI mode (with removed -DMODPERL in docker-compose) everything works fine.

Seems like ModPerl::Registry does not process Content-type: text/html

What I need to do fix in httpd.conf ?

Adding PerlOptions +ParseHeaders wil not fix the problem


Solution

  • Fixed. PerlOptions +ParseHeaders was inside <Location tag so was not working. To fix it you should move ParseHeaders to <Directory or set globally.

    https://github.com/pavelsr/mod_perl_sandbox - work example of how to run same perl script under CGI and mod_perl