utham hoode | 12 Sep 2011 09:22

mod_perl - separate PERL interpreter for each LocationMatch

Hi All,

     

    I have written a mod_perl proxy server which redirects the HTTP traffic to a webserver.

    I have pasted the snippet below.  

    In the apache worker thread, is enable. In the httpd.conf two <LocationMatch> are configured

 

http://ipaddress/path1/

http://ipaddress/path2/

 

After starting the http server if i open any URL from the browser, same “TEST_VAR” is being printed

for both the URLs.

 

If I call path1 first, then for both the URLs 100 is printed.

If I call path2 first, then for both the URLs 200 is printed.

(that is its taking the first called Path, after httpd is started)

 

#----------------------------Startup.pl --------------------------------------------#

#startup.pl

 

use lib qw(/home/test1/libs);

 

1;

 

#---------------------------------

 

#---------------------------- httpd.conf---------------------------------------------#

 

 

# httpd.conf

 

PerlRequire /home/test1/startup.pl

 

#http://ipaddress/path1/

<LocationMatch /path1/>

     SetEnvIf Request_URI "/" TEST_VAR=100

     SetHandler perl-script

     PerlResponseHandler Module::Test

</LocationMatch>

 

#http://ipaddress/path2/

<LocationMatch /path2/>

     SetEnvIf Request_URI "/" TEST_VAR=200

     SetHandler perl-script

     PerlResponseHandler Module::Test

</LocationMatch>

 

#-------------------------------------------------------------------------------#

 

 

#---------------------------- Test.pm ---------------------------------------------#

 

# Test.pm

 

package Module::Test;

 

use strict;

 

use Apache2::Const qw(:methods :http :common);

use Apache2::Log ();

use Apache2::URI ();

 

 

my $param = env_variable();

 

sub handler

{

 

   Apache2::ServerRec::warn($param);

   print "Value".$param;

   return Apache2::Const::OK;

}

 

 

sub env_variable

{

 

      # Configuration loading from a file during startup

 

      my $endpointURL = $ENV{'TEST_VAR'};

 

      return $endpointURL;

}

 

1;

 

#--------------------------------------------------------------------------------

 

 

But I tried with <VirtualHost> option and it is working fine as PerlOptions +Parent is present.

But since the port numbers are different firefox will now allow simulataneous access to

both URL from same webpage.

 

 

#http://ipaddress:8080/path1/

<VirtualHost *:8080>

    SetEnvIf Request_URI "/" TEST_VAR=100

    PerlRequire /home/test1/startup.pl

 

    PerlOptions +Parent

     <LocationMatch /path2/>

          SetHandler perl-script

          PerlResponseHandler Module::Test

     </LocationMatch>

</VirtualHost>

 

 

#http://ipaddress:8085/path2/

<VirtualHost *:8085>

    SetEnvIf Request_URI "/" TEST_VAR=200

    PerlRequire /home/test1/startup.pl

 

    PerlOptions +Parent

     <LocationMatch /path2/>

          SetHandler perl-script

          PerlResponseHandler Module::Test

     </LocationMatch>

</VirtualHost>

 

Please help me with this, Thanks in advance.

Regards,

uttam

 

Torsten Förtsch | 12 Sep 2011 10:18
Picon
Gravatar

Re: mod_perl - separate PERL interpreter for each LocationMatch

On Monday, 12 September 2011 09:22:57 utham hoode wrote:
> Hi All,         I have written a mod_perl proxy server which redirects
> the HTTP traffic to a webserver.    I have pasted the snippet below. 
>     In the apache worker thread, is enable. In the httpd.conf two
> <LocationMatch> are configured
> http://ipaddress/path1/http://ipaddress/path2/ After starting the
> http server if i open any URL from the browser, same “TEST_VAR” is
> being printedfor both the URLs. If I call path1 first, then for both
> the URLs 100 is printed.If I call path2 first, then for both the URLs
> 200 is printed.(that is its taking the first called Path, after httpd
> is started) #----------------------------Startup.pl
> --------------------------------------------##startup.pl use lib
> qw(/home/test1/libs); 1; #---------------------------------
> #----------------------------
> httpd.conf---------------------------------------------#  #
> httpd.conf PerlRequire /home/test1/startup.pl
> #http://ipaddress/path1/<LocationMatch /path1/≥     SetEnvIf
> Request_URI "/" TEST_VAR=100     SetHandler perl-script    
> PerlResponseHandler Module::Test</LocationMatch>
> #http://ipaddress/path2/<LocationMatch /path2/≥     SetEnvIf
> Request_URI "/" TEST_VAR=200     SetHandler perl-script    
> PerlResponseHandler Module::Test</LocationMatch>
> #--------------------------------------------------------------------
> -----------#  #---------------------------- Test.pm
> ---------------------------------------------# # Test.pm package
> Module::Test; use strict; use Apache2::Const qw(:methods :http
> :common);use Apache2::Log ();use Apache2::URI ();  my $param =
> env_variable(); sub handler{    Apache2::ServerRec::warn($param);  
> print "Value".$param;   return Apache2::Const::OK;}  sub
> env_variable{       # Configuration loading from a file during
> startup       my $endpointURL = $ENV{'TEST_VAR'};       return
> $endpointURL;} 1;
> #--------------------------------------------------------------------
> ------------  But I tried with <VirtualHost> option and it is working
> fine as PerlOptions +Parent is present.But since the port numbers are
> different firefox will now allow simulataneous access toboth URL from
> same webpage.  #http://ipaddress:8080/path1/<VirtualHost *:8080>   
> SetEnvIf Request_URI "/" TEST_VAR=100    PerlRequire
> /home/test1/startup.pl     PerlOptions +Parent     <LocationMatch
> /path2/≥          SetHandler perl-script          PerlResponseHandler
> Module::Test     </LocationMatch></VirtualHost> 
> #http://ipaddress:8085/path2/<VirtualHost *:8085>    SetEnvIf
> Request_URI "/" TEST_VAR=200    PerlRequire /home/test1/startup.pl   
>  PerlOptions +Parent     <LocationMatch /path2/≥          SetHandler
> perl-script          PerlResponseHandler Module::Test    
> </LocationMatch></VirtualHost> Please help me with this, Thanks in
> advance.Regards,uttam

Could you please resend the mail with proper line breaks? Otherwise, it's 
indecipherable, at least for me.

Torsten Förtsch

--

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

utham hoode | 12 Sep 2011 11:04

RE: mod_perl - separate PERL interpreter for each LocationMatch


Hi All,

I have written a mod_perl proxy server which redirects the HTTP traffic to
a webserver.
In the apache worker thread is enable. In the httpd.conf two
are configured
http://ipaddress/path1/
http://ipaddress/path2/
After starting the http server if i open any URL from the browser same
TEST_VAR is being printed
for both the URLs.
If I call path1 first then for both the URLs 100 is printed.
If I call path2 first then for both the URLs 200 is printed.

#startup.pl
use lib qw(/home/test1/libs);
1;

#---------------------------------

# httpd.conf
PerlRequire /home/test1/startup.pl
#http://ipaddress/path1/

SetEnvIf Request_URI "/" TEST_VAR=100
SetHandler perl-script
PerlResponseHandler Module::Test

#http://ipaddress/path2/

SetEnvIf Request_URI "/" TEST_VAR=200
SetHandler perl-script
PerlResponseHandler Module::Test

#Test.pm
#--------------------------------------------------------------------
package Module::Test;
use strict;
use Apache2::Const qw(:methods :http :common);
use Apache2::Log ();
use Apache2::URI ();

my $param = env_variable();
sub handler
{
Apache2::ServerRec::warn($param);
print "Value".$param;
return Apache2::Const::OK;
}

sub env_variable
{
# Configuration loading from a file during startup
my $endpointURL = $ENV{'TEST_VAR'};
return $endpointURL;
}
1;
#--------------------------------------------------------------------------------

But I tried with option and it is working fine as PerlOptions
+Parent is present.
But since the port numbers are different firefox will now allow simulataneous
access to
both URL from same webpage.

#http://ipaddress:8080/path1/

SetEnvIf Request_URI "/" TEST_VAR=100
PerlRequire /home/test1/startup.pl
PerlOptions +Parent

SetHandler perl-script
PerlResponseHandler Module::Test

#http://ipaddress:8085/path2/

SetEnvIf Request_URI "/" TEST_VAR=200
PerlRequire /home/test1/startup.pl
PerlOptions +Parent

SetHandler perl-script
PerlResponseHandler Module::Test

Regards,
uttam

----------------------------------------
> From: torsten.foertsch <at> gmx.net
> To: modperl <at> perl.apache.org
> Subject: Re: mod_perl - separate PERL interpreter for each LocationMatch
> Date: Mon, 12 Sep 2011 10:18:59 +0200
> CC: uttamhoode <at> live.com
>
> On Monday, 12 September 2011 09:22:57 utham hoode wrote:
> > Hi All, I have written a mod_perl proxy server which redirects
> > the HTTP traffic to a webserver. I have pasted the snippet below.
> > In the apache worker thread, is enable. In the httpd.conf two
> > are configured
> > http://ipaddress/path1/http://ipaddress/path2/ After starting the
> > http server if i open any URL from the browser, same “TEST_VAR” is
> > being printedfor both the URLs. If I call path1 first, then for both
> > the URLs 100 is printed.If I call path2 first, then for both the URLs
> > 200 is printed.(that is its taking the first called Path, after httpd
> > is started) #----------------------------Startup.pl
> > --------------------------------------------##startup.pl use lib
> > qw(/home/test1/libs); 1; #---------------------------------
> > #----------------------------
> > httpd.conf---------------------------------------------# #
> > httpd.conf PerlRequire /home/test1/startup.pl
> > #http://ipaddress/path1/ SetEnvIf
> > Request_URI "/" TEST_VAR=100 SetHandler perl-script
> > PerlResponseHandler Module::Test
> > #http://ipaddress/path2/ SetEnvIf
> > Request_URI "/" TEST_VAR=200 SetHandler perl-script
> > PerlResponseHandler Module::Test
> > #--------------------------------------------------------------------
> > -----------# #---------------------------- Test.pm
> > ---------------------------------------------# # Test.pm package
> > Module::Test; use strict; use Apache2::Const qw(:methods :http
> > :common);use Apache2::Log ();use Apache2::URI (); my $param =
> > env_variable(); sub handler{ Apache2::ServerRec::warn($param);
> > print "Value".$param; return Apache2::Const::OK;} sub
> > env_variable{ # Configuration loading from a file during
> > startup my $endpointURL = $ENV{'TEST_VAR'}; return
> > $endpointURL;} 1;
> > #--------------------------------------------------------------------
> > ------------ But I tried with option and it is working
> > fine as PerlOptions +Parent is present.But since the port numbers are
> > different firefox will now allow simulataneous access toboth URL from
> > same webpage. #http://ipaddress:8080/path1/
> > SetEnvIf Request_URI "/" TEST_VAR=100 PerlRequire
> > /home/test1/startup.pl PerlOptions +Parent > /path2/≥ SetHandler perl-script PerlResponseHandler
> > Module::Test
> > #http://ipaddress:8085/path2/ SetEnvIf
> > Request_URI "/" TEST_VAR=200 PerlRequire /home/test1/startup.pl
> > PerlOptions +Parent SetHandler
> > perl-script PerlResponseHandler Module::Test
> > Please help me with this, Thanks in
> > advance.Regards,uttam
>
> Could you please resend the mail with proper line breaks? Otherwise, it's
> indecipherable, at least for me.
>
> Torsten Förtsch
>
> --
> Need professional modperl support? Hire me! (http://foertsch.name)
>
> Like fantasy? http://kabatinte.net 		 	   		  
Torsten Förtsch | 12 Sep 2011 11:52
Picon
Gravatar

Re: mod_perl - separate PERL interpreter for each LocationMatch

On Monday, 12 September 2011 11:04:35 utham hoode wrote:
> I have written a mod_perl proxy server which redirects the HTTP
> traffic to a webserver.
> In the apache worker thread is enable. In the httpd.conf two
> are configured
> http://ipaddress/path1/
> http://ipaddress/path2/
> After starting the http server if i open any URL from the browser same
> TEST_VAR is being printed
> for both the URLs.
> If I call path1 first then for both the URLs 100 is printed.
> If I call path2 first then for both the URLs 200 is printed.

I am still a bit at a loss what you are trying to do here. The phrase 
"modperl proxy server that redirects" is quite ambiguous:

- a modperl handler that works in the response phase, mangles the request 
a bit before sending it to a backend server. On the way back the response 
from the backend is again a bit mangled perhaps and sent to the client

- on the other hand it may be a server that sends out HTTP redirects to 
point the browser to the correct server using HTTP 3xx codes.

- and thirdly it may be a piece of code working in a phase between 
maptostorage and fixup that modifies the request configuration to have it
handled by mod_proxy.

- perhaps there are a few more possible meanings

Generally, apache creates an individual configuration for each request. 
At first it looks up the virtual server config. Then it merges into that 
one all the <Location> <Directory> <Files> blocks that are applicable.

So, you can set a certain environment variable for one request to value1 
and for another to value2. But you have to have a distinguishing mark.

> #startup.pl
> use lib qw(/home/test1/libs);
> 1;
> 
> #---------------------------------
> 
> # httpd.conf
> PerlRequire /home/test1/startup.pl
> #http://ipaddress/path1/
> 
> SetEnvIf Request_URI "/" TEST_VAR=100
> SetHandler perl-script
> PerlResponseHandler Module::Test
> 
> #http://ipaddress/path2/
> 
> SetEnvIf Request_URI "/" TEST_VAR=200
> SetHandler perl-script
> PerlResponseHandler Module::Test

In the snippet above I do not see any such mark. You set TEST_VAR to 100 
and to 200 if the request URI is /. That does not make sense.

> 
> #Test.pm
> #--------------------------------------------------------------------
> package Module::Test;
> use strict;
> use Apache2::Const qw(:methods :http :common);
> use Apache2::Log ();
> use Apache2::URI ();
> 
> my $param = env_variable();

Here you use a global variable that is set only once for the lifetime of 
the interpreter when the module is compiled. $param is not set for each 
request.

> sub handler
> {
> Apache2::ServerRec::warn($param);
> print "Value".$param;
> return Apache2::Const::OK;
> }
> 
> sub env_variable
> {
> # Configuration loading from a file during startup
> my $endpointURL = $ENV{'TEST_VAR'};
> return $endpointURL;
> }
> 1;
> #---------------------------------------------------------------------
> -----------
> 
> But I tried with option and it is working fine as PerlOptions
> +Parent is present.
> But since the port numbers are different firefox will now allow
> simulataneous access to
> both URL from same webpage.
> 
> #http://ipaddress:8080/path1/
> 
> SetEnvIf Request_URI "/" TEST_VAR=100
> PerlRequire /home/test1/startup.pl
> PerlOptions +Parent
> 
> SetHandler perl-script
> PerlResponseHandler Module::Test
> 
> 
> 
> #http://ipaddress:8085/path2/
> 
> SetEnvIf Request_URI "/" TEST_VAR=200
> PerlRequire /home/test1/startup.pl
> PerlOptions +Parent
> 
> SetHandler perl-script
> PerlResponseHandler Module::Test

+Parent is a VHost level option like:

<VirtualHost ...>
  PerlOptions +Parent
  ...
</VirtualHost>

The virtual host then gets it's own perl interpreter. It has been 
requested a few times to make it possible to change the interpreter per 
request configuration but nobody has got around to do the work yet. 
Something along these lines would be good:

<PerlInterpreter MyInterpreter>
PerlSwitches ...
PerlRequire ...
PerlModule ...
</PerlInterpreter>

<PerlInterpreter OtherInterpreter>
PerlSwitches ...
PerlRequire ...
PerlModule ...
</PerlInterpreter>

<Location /...>
PerlUseInterpreter MyInterpreter
</Location>

Torsten Förtsch

--

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

utham hoode | 12 Sep 2011 13:03

RE: mod_perl - separate PERL interpreter for each LocationMatch


----------------------------------------
> From: torsten.foertsch <at> gmx.net
> To: modperl <at> perl.apache.org
> Subject: Re: mod_perl - separate PERL interpreter for each LocationMatch
> Date: Mon, 12 Sep 2011 11:52:57 +0200
> CC: uttamhoode <at> live.com
>
> On Monday, 12 September 2011 11:04:35 utham hoode wrote:
> > I have written a mod_perl proxy server which redirects the HTTP
> > traffic to a webserver.
> > In the apache worker thread is enable. In the httpd.conf two
> > are configured
> > http://ipaddress/path1/
> > http://ipaddress/path2/
> > After starting the http server if i open any URL from the browser same
> > TEST_VAR is being printed
> > for both the URLs.
> > If I call path1 first then for both the URLs 100 is printed.
> > If I call path2 first then for both the URLs 200 is printed.
>
> I am still a bit at a loss what you are trying to do here. The phrase
> "modperl proxy server that redirects" is quite ambiguous:

Thanks for the quick response.
Sorry for not providing all the details. Actual proxy program is working fine withsingle
<LocationMatch>. I wrote Test.pm just to demonstrate the issue.

>
> - a modperl handler that works in the response phase, mangles the request
> a bit before sending it to a backend server. On the way back the response
> from the backend is again a bit mangled perhaps and sent to the client
>
> - on the other hand it may be a server that sends out HTTP redirects to
> point the browser to the correct server using HTTP 3xx codes.
>
> - and thirdly it may be a piece of code working in a phase between
> maptostorage and fixup that modifies the request configuration to have it
> handled by mod_proxy.
>
> - perhaps there are a few more possible meanings
>
> Generally, apache creates an individual configuration for each request.
> At first it looks up the virtual server config. Then it merges into that
> one all the <Location> <Directory> <Files> blocks that are applicable.
>
> So, you can set a certain environment variable for one request to value1
> and for another to value2. But you have to have a distinguishing mark.
>
> > #startup.pl
> > use lib qw(/home/test1/libs);
> > 1;
> >
> > #---------------------------------
> >
> > # httpd.conf
> > PerlRequire /home/test1/startup.pl
> > #http://ipaddress/path1/
> >
> > SetEnvIf Request_URI "/" TEST_VAR=100
> > SetHandler perl-script
> > PerlResponseHandler Module::Test
> >
> > #http://ipaddress/path2/
> >
> > SetEnvIf Request_URI "/" TEST_VAR=200
> > SetHandler perl-script
> > PerlResponseHandler Module::Test
>
> In the snippet above I do not see any such mark. You set TEST_VAR to 100
> and to 200 if the request URI is /. That does not make sense.

I tried this but did not work.
SetEnvIf Request_URI "/path1/" TEST_VAR=100
and 
SetEnvIf Request_URI "/path2/" TEST_VAR=200

>
> >
> > #Test.pm
> > #--------------------------------------------------------------------
> > package Module::Test;
> > use strict;
> > use Apache2::Const qw(:methods :http :common);
> > use Apache2::Log ();
> > use Apache2::URI ();
> >
> > my $param = env_variable();
>
> Here you use a global variable that is set only once for the lifetime of
> the interpreter when the module is compiled. $param is not set for each
> request.

Here is the problem. Both path1 and path2 are sharing same global variable $param.Is there any way to avoid
that?. Because In the actual proxy program I am reading aconfiguration file and storing it in a global
variable. For path1 and path2 configuration file is different. I can place the variable inside sub
handler {}so that for  each request program loads the configuration file.I think this will reduce the performance.

>
> > sub handler
> > {
> > Apache2::ServerRec::warn($param);
> > print "Value".$param;
> > return Apache2::Const::OK;
> > }
> >
> > sub env_variable
> > {
> > # Configuration loading from a file during startup
> > my $endpointURL = $ENV{'TEST_VAR'};
> > return $endpointURL;
> > }
> > 1;
> > #---------------------------------------------------------------------
> > -----------
> >
> > But I tried with option and it is working fine as PerlOptions
> > +Parent is present.
> > But since the port numbers are different firefox will now allow
> > simulataneous access to
> > both URL from same webpage.
> >
> > #http://ipaddress:8080/path1/
> >
> > SetEnvIf Request_URI "/" TEST_VAR=100
> > PerlRequire /home/test1/startup.pl
> > PerlOptions +Parent
> >
> > SetHandler perl-script
> > PerlResponseHandler Module::Test
> >
> >
> >
> > #http://ipaddress:8085/path2/
> >
> > SetEnvIf Request_URI "/" TEST_VAR=200
> > PerlRequire /home/test1/startup.pl
> > PerlOptions +Parent
> >
> > SetHandler perl-script
> > PerlResponseHandler Module::Test
>
> +Parent is a VHost level option like:
>
> <VirtualHost ...>
> PerlOptions +Parent
> ...
> </VirtualHost>
>
> The virtual host then gets it's own perl interpreter. It has been
> requested a few times to make it possible to change the interpreter per
> request configuration but nobody has got around to do the work yet.
> Something along these lines would be good:
    I wish below feature is supported.

>
> <PerlInterpreter MyInterpreter>
> PerlSwitches ...
> PerlRequire ...
> PerlModule ...
> </PerlInterpreter>
>
> <PerlInterpreter OtherInterpreter>
> PerlSwitches ...
> PerlRequire ...
> PerlModule ...
> </PerlInterpreter>
>
> <Location /...>
> PerlUseInterpreter MyInterpreter
> </Location>
>
> Torsten Förtsch
>
> --
> Need professional modperl support? Hire me! (http://foertsch.name)
>
> Like fantasy? http://kabatinte.net
 		 	   		  
Torsten Förtsch | 12 Sep 2011 13:36
Picon
Gravatar

Re: mod_perl - separate PERL interpreter for each LocationMatch

On Monday, 12 September 2011 13:03:30 utham hoode wrote:
> Here is the problem. Both path1 and path2 are sharing same global
> variable $param.Is there any way to avoid that?. Because In the
> actual proxy program I am reading aconfiguration file and storing it
> in a global variable. For path1 and path2 configuration file is
> different. I can place the variable inside sub handler {}so that for
>  each request program loads the configuration file.I think this will
> reduce the performance.

how about

=httpd.conf=========================================
<LocationMatch "^/path1">
  SetEnv CFG /path/to/config1.conf
</LocationMatch>

<LocationMatch "^/path2">
  SetEnv CFG /path/to/config2.conf
</LocationMatch>
====================================================

=the handler========================================
my %config;

sub handler {
  my ($r)= <at> _;

  my $cfg=$r->subprocess_env->{CFG} or
    die "No config file configured for ".$r->uri;

  $cfg=($config{$cfg}||=read_cfg $cfg);
  ...
}
====================================================

Thus, the global %config is used as a cache for the configurations of the 
various URIs. The actual file is read only on the first request.

All the configurations can even be pre-populated at startup time.

Note however, that since the config is read only once it can be changed 
only by starting up a new interpreter. If that's a problem you can 
monitor file modification times for example. If I were you I'd use an 
MMapDB object.

Torsten Förtsch

--

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

Jeff Pang | 16 Sep 2011 06:12
Picon

about ModPerl::Registry

Hello,

When my CGI scripts are moved to run under ModPerl::Registry, and when the script is changed, should I
restart Apache each time?
I was thinking ModPerl::Registry  is running the similiar way like PHP, but when php script is modified it
doesn't need to restart the webserver.

Thanks.

--
  Jeff Pang
  jeffpang <at> mail.ru
Scott Gifford | 17 Sep 2011 05:33
Gravatar

Re: about ModPerl::Registry

On Fri, Sep 16, 2011 at 12:12 AM, Jeff Pang <jeffpang <at> mail.ru> wrote:

Hello,

When my CGI scripts are moved to run under ModPerl::Registry, and when the script is changed, should I restart Apache each time?

Hi Jeff,

In general you do, but look at modules like Apache2::Reload for ways to detect changed files then automatically reload the appropriate modules.

The approach I usually use is to develop and test under CGI, then move to my mod_perl environment once it is working reliably, and restart my server.  In my experience, that seems to be the most foolproof method.
 
Hope this helps,

------Scott.

Perrin Harkins | 17 Sep 2011 19:56

Re: about ModPerl::Registry

2011/9/16 Scott Gifford <sgifford <at> suspectclass.com>:
> On Fri, Sep 16, 2011 at 12:12 AM, Jeff Pang <jeffpang <at> mail.ru> wrote:
>>
>> Hello,
>>
>> When my CGI scripts are moved to run under ModPerl::Registry, and when the
>> script is changed, should I restart Apache each time?
>
> Hi Jeff,
> In general you do, but look at modules like Apache2::Reload for ways to
> detect changed files then automatically reload the appropriate modules.

This is true for modules, but for scripts running under Registry, it
should not be necessary.  They are recompiled when the file changes.

- Perrin

Carla von Reitzenstein | 19 Sep 2011 19:38

problem with mod_perl and twiki

Hello,

I tried to use my TWiki under mod_perl, but after enabling mod_perl the design is broken.
To enable mod_perl I've added the following to my twiki configfile for apache:
 <FilesMatch "^(?!configure)[a-z.]+$">
   SetHandler perl-script
   PerlResponseHandler ModPerl::Registry
   PerlSendHeader On
   PerlOptions +ParseHeaders
</FilesMatch>

The error log gives the following error for any picture in the TWiki:
[Mon Sep 19 19:16:11 2011] [error] Unrecognized character \\x10 in column 241 at /var/www/twiki/pub/TWiki/TWikiDocGraphics/group.gif line 1.\n

and for Javascript code:
[Mon Sep 19 19:16:10 2011] [error] syntax error at /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js line 2, near "#line 1 /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js\n// TWiki namespace\n"\nsyntax error at /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js line 4, near ") {"\nsyntax error at /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js line 10, near "head["\nsyntax error at /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js line 13, near "head["\nsyntax error at /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js line 17, near "}\n        }"\nsyntax error at /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js line 22, near "// Get all "\nsyntax error at /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js line 31, near "elms["\nsyntax error at /var/www/twiki/pub/TWiki/TWikiJavascripts/twikilib.js line 37, near ";\n}"\n


I'd be glad about any suggestion.

Thanks,
Carla


Gmane