Can you show me how this can be configured then without using $PerlConfig
JkWorkerProperty worker.list=myWorker
JkWorkerProperty worker.myWorker.port=$workerPort
JkWorkerProperty worker.myWorker.host=127.0.0.1
JkWorkerProperty worker.myWorker.type=ajp13
JkWorkerProperty worker.myWorker.secret=secretword
If I try
push @JkWorkerProperty, "worker.list=myWorker";
it doesn't setup right.
This is rather unique because it's valid apache syntax but not that common
I'm now using $PerlConfig to work around this but I'd like to know if there
was another way.
This is how I'm
<Perl>
my $logDir = $ENV{'X_LOGDIR'};
my $workerPort = $ENV{'X_WORKER_PORT'};
$PerlConfig .=<<END;
JkWorkerProperty worker.list=myWorker
JkWorkerProperty worker.myWorker.port=$workerPort
JkWorkerProperty worker.myWorker.host=127.0.0.1
JkWorkerProperty worker.myWorker.type=ajp13
JkWorkerProperty worker.myWorker.secret=secretword
JkLogFile $logDir/mod_jk.log
JkLogLevel debug
JkShmFile $logDir/jk-runtime-status
END
Please note in order to do the $ENV above I have to have this.
<Perl>
# repopulate %ENV
for (`env`) {
next unless /^X_/;
/(.*)=(.*)/;
$ENV{$1} = $2;
push @PassEnv, $1;
#print "$_\n";
}
this essentially puts back what mod_perl took out of %ENV upon startup and it
seems to remain in %ENV across all Perl Sections. I have not seen any example
where PassEnv can be used instead of the above approach.
---
http://perl.apache.org/docs/1.0/guide/config.html#Apache_Configuration_in_Perl
http://perl.apache.org/docs/1.0/guide/porting.html#Passing_ENV_variables_to_CGI
"The Perl %ENV is cleared during startup, but the C environment is left intact.
With a combo of forking `env` and <Perl> sections you can do even do wildcards
matching. For example, this passes all environment variables that begin with
the letter H:"
---
What is the correct way to define a variable that can hold state that will
survive across Perl Sections but yet won't end up in the httpd configuration?
Do I have to declare a my and use $ENV everytime I need to refer to these
variables in a Perl Section?
Unfortunately with the mod_perl setup I'm using I cannot use
Apache::PerlSections->dump so it's hard to verify things.
Quoting Robert Nicholson <[EMAIL PROTECTED]>:
> So can you or somebody else post a complete httpd.conf that makes use
> of $PerlConfig then?
>
> On Aug 1, 2006, at 2:24 PM, Andreas J. Koenig wrote:
>
> >>>>>> On Tue, 1 Aug 2006 13:56:31 -0500, [EMAIL PROTECTED] said:
> >
> >> That resulted in errors at least in my case.
> >
> > You did read that I said you need SVN recent for apache2?
> >
> > --
> > andreas
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.