Questions tagged [mod-perl2]

mod-perl2 is an Apache2 web server module. The module improves the performance of Perl CGI scripts. Scripts are loaded into memory on the first invocation and added to the Apache process. On each subsequent invocation the script is run directly with no need for loading and parsing.

162 questions
1
vote
1 answer

mod_perl2: Use module by its location and not by its name

I am having 2 directories in my Apache webserver. PerlModule HandlerA PerlModule HandlerB Options FollowSymLinks Order deny,allow AllowOverride All SetHandler perl-script PerlHandler…
chris01
  • 10,921
  • 9
  • 54
  • 93
1
vote
1 answer

How to get "my" VHOST in code executed by PerPostConfigRequire?

I'm hosting multiple instances of the same web app in different versions using the same instance of HTTPd and one VHOST per instance/version of web app currently. I would like to use mod_perl's PostConfigRequire to implement a handler pre-loading…
Thorsten Schöning
  • 3,501
  • 2
  • 25
  • 46
1
vote
1 answer

Why is my section variable only available sometimes under mod_perl?

In httpd.conf I have: $MyPackage::foo = { ... }; According to the docs, this should, since it's qualified, persist into my perl scripts, which are run with the modperl handler. And sometimes they do. But then all I need to do is…
Kev
  • 15,899
  • 15
  • 79
  • 112
1
vote
3 answers

Is "local our" the thing to use in object modules under mod_perl2, or only in scripts?

To tailor your scripts toward mp2, avoiding the need for any compatibility wrappers and such, it's said that you're supposed to declare variables using "local our" rather than "my". What about in modules? sub new { local our $type = shift; …
Kev
  • 15,899
  • 15
  • 79
  • 112
1
vote
3 answers

Apache 2 on VM *sometimes* not finding mods-enabled directory

I'm running Apache 2 on an Ubuntu 10.04 server VM (ESXi 4.1) and getting something very weird: Sometimes the mods-enabled directory is found. Sometimes it's not. It seems to not be about 75% not found. Nothing is changed in between. Here's some…
Dodger
  • 142
  • 2
  • 10
1
vote
0 answers

Access Apache environment variables from mod_perl without %ENV

I using Apache 2.2 and mod_perl 2.0.4. I want to retrieve the value of an environment variable named "A_VARIABLE" in a mod_perl handler which was set in an Apache configuration file as: SetEnv A_VARIABLE "some value" In the mod_perl documentation…
Rossman
  • 180
  • 2
  • 14
1
vote
3 answers

Where can I find code profiling and/or code coverage modules that work with mod_perl2?

Is there a way to get this functionality under mod_perl2? And can it be triggered via web requests as opposed to the command line? Or do I need to fake whatever $ENV variables and query strings and cookies that my script requires and use the…
Kev
  • 15,899
  • 15
  • 79
  • 112
1
vote
1 answer

Issue while compiling apache2 with mod_perl

perl Makefile.PL MP_USE_STATIC=1 \ MP_AP_PREFIX=/tmp/https2.2.34 \ MP_AP_CONFIGURE=“—with-mpm=prefork \ —prefix=/tmp/apache-2.2.34 \ -enable-modules=‘ssl rewrite info alias auth_basic usertrack so’” ERROR from evaluation of…
Itsme
  • 59
  • 6
1
vote
2 answers

How can I access the Apache server configuration in a BEGIN block in mod_perl?

I've been trying to switch from using PerlSetEnv to using custom configuration directives. I have my configuration module with a copy of set_val from the docs: sub set_val { local our ($key, $self, $parms, $arg) = @_; $self->{$key} = $arg; …
Kev
  • 15,899
  • 15
  • 79
  • 112
1
vote
2 answers

How to modify post request content using mod_perl

How to modify post request content using mod_perl's filter/handler? I can read request content in PerlResponseHandler but how do I "attach" modified content back into request? Also, I don't want to do this in PerlResponseHandler as I want requested…
keeping_it_simple
  • 439
  • 1
  • 11
  • 31
1
vote
1 answer

run lxr perl module as scripts under apache 2.4

I have been trying to get it right for the past couple of days, but could not. I am not a LAMP guy. I installed Apache 2 from the default Ubuntu repositories. Here is the contents of the /etc/apache2 directory: /etc/apache2$ ls apache2.conf …
feeling_lonely
  • 6,665
  • 4
  • 27
  • 53
1
vote
1 answer

JSON::XS under mod_perl fails with POST requests

I am using the default install of Apache and mod_perl on Ubuntu 16.04.1 LTS, I also have reproduced this with the default JSON::XS and I updated to the latest from CPAN JSON-XS-3.02. The code below works in all cases if I am not using mod_perl. …
Severun
  • 2,893
  • 1
  • 16
  • 22
1
vote
1 answer

What happens AFTER Apache says "Script timed out before returning headers" to the running script?

I have a Perl web app served by Apache httpd using plain mod_cgi or optionally mod_perl with PerlHandler ModPerl::Registry. Recently the app encountered the error Script timed out before returning headers on some invocations and behaved differently…
Thorsten Schöning
  • 3,501
  • 2
  • 25
  • 46
1
vote
1 answer

How to install mod_perl 2.0.10 in Apache 2.4 on OS X El Capitan?

Build problems with a completely new install of mod_perl. Here are the versions of my software. OS X El Capitan 10.11. Recently upgraded from OS X Yosemite 10.10. Xcode 7.1. Apache 2.4.16. This is the Apache version that was included with…
1
vote
1 answer

Determining if the HTTP scheme is https or http in mod_perl2?

I need to work out if an incoming request is using SSL in a mod_perl environment - how can I do this reliably?
Mr Foo Foo
  • 19
  • 2