You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Philip Mak <pm...@aaanime.net> on 2004/01/24 03:50:49 UTC

%config in Apache::ASP->Loader

>From tuning.html:

> The %config args, are the config options that you want set that
> affect compilation. These options include Debug, Global,
> GlobalPackage, DynamicIncludes, StatINC, StatINCMatch, XMLSubsMatch,
> and XMLSubsStrict.

If I leave the %config hash empty, will Apache::ASP->Loader use the
values of Global and GlobalPackage from httpd.conf? Or do I have to
set those manually to the same values that I have in httpd.conf?

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: %config in Apache::ASP->Loader

Posted by Josh Chamas <jo...@chamas.com>.
Philip Mak wrote:
> BTW, http://www.apache-asp.org/tuning.html#Precompile says "The
> %config args, are the config options that you want set that affect
> compilation. These options include Debug, Global, GlobalPackage,
> DynamicIncludes, StatINC, StatINCMatch, XMLSubsMatch, and
> XMLSubsStrict." I think that list of options should also include
> IncludesDir and UseStrict.
> 

Thanks.  I'll have the docs updated in a future release.

Regards,

Josh

________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checker                 http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: %config in Apache::ASP->Loader

Posted by Philip Mak <pm...@aaanime.net>.
On Sat, Jan 24, 2004 at 02:28:04PM -0800, Josh Chamas wrote:
> >Hrm, I guess with the way configuration files are parsed, at the time
> >startup.pl is being executed it does not have access to the PerlSetVar
> >configurations?
> >
> 
> Even if it did ( of which I am not so sure ), it would not
> necessarily know which PerlSetVar to merge for which files that
> would correspond to the same set of ASP files at runtime.  One could
> imagine many different ASP applications with different PerlSetVar
> settings in the same httpd.conf

I wonder if in the following case...

<VirtualHost 1.2.3.4>
ServerName site1.com
PerlSetVar Global /home/site1/global
PerlRequire startup.pl
</VirtualHost>

<VirtualHost 1.2.3.4>
ServerName site2.com
PerlSetVar Global /home/site2/global
PerlRequire startup.pl
</VirtualHost>

the two different startup.pls could somehow read the correct value of
Global, since their own PerlRequire statements are inside different
<VirtualHost> containers. I don't know how it works, though... I think
I'll ask on the mod_perl list.

> >I tried that (I assume you meant Debug -1 in httpd.conf, not the
> >Loader() %config?), but I got lost in the sheer volume of output. Is
> >there a string (e.g. "compiling") that I can grep for?
> 
> If you find that things are "parsing" at runtime, then they are not 
> precompiled.

They were parsing. It turned out that I had forgotten to set UseStrict
and IncludesDir in %config, and had also forgotten to include ~/inc
(that's my IncludesDir; for some reason those scripts didn't get
compiled, even though other scripts which did get compiled called
them) in the Loader path.

After fixing my configuration I tried it again and it doesn't say
"parsing" in the error_log anymore. Thanks!

BTW, http://www.apache-asp.org/tuning.html#Precompile says "The
%config args, are the config options that you want set that affect
compilation. These options include Debug, Global, GlobalPackage,
DynamicIncludes, StatINC, StatINCMatch, XMLSubsMatch, and
XMLSubsStrict." I think that list of options should also include
IncludesDir and UseStrict.

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: %config in Apache::ASP->Loader

Posted by Josh Chamas <jo...@chamas.com>.
Philip Mak wrote:
> On Sat, Jan 24, 2004 at 11:07:30AM -0800, Josh Chamas wrote:
> 
>>>If I leave the %config hash empty, will Apache::ASP->Loader use the
>>>values of Global and GlobalPackage from httpd.conf? Or do I have to
>>>set those manually to the same values that I have in httpd.conf?
>>
>>You have to set them manually to the same values that you have in
>>httpd.conf.
> 
> 
> Hrm, I guess with the way configuration files are parsed, at the time
> startup.pl is being executed it does not have access to the PerlSetVar
> configurations?
> 

Even if it did ( of which I am not so sure ), it would not necessarily know
which PerlSetVar to merge for which files that would correspond to the
same set of ASP files at runtime.  One could imagine many different ASP
applications with different PerlSetVar settings in the same httpd.conf

Since we are at startup, we don't have access to <Location>, <Directory>,
.htaccess configs that would resolve a

> I tried that (I assume you meant Debug -1 in httpd.conf, not the
> Loader() %config?), but I got lost in the sheer volume of output. Is
> there a string (e.g. "compiling") that I can grep for?
> 

If you find that things are "parsing" at runtime, then they are not precompiled.

> 
> So, that means if I use a script via $main::Response->Include(), I
> should make sure that script is explicitly compiled by the Loader()
> call?
> 

Right, or change the call to $Response->Include if its being called in
a normal script.

Regards,

Josh

________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checker                 http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: %config in Apache::ASP->Loader

Posted by Philip Mak <pm...@aaanime.net>.
On Sat, Jan 24, 2004 at 11:07:30AM -0800, Josh Chamas wrote:
> >If I leave the %config hash empty, will Apache::ASP->Loader use the
> >values of Global and GlobalPackage from httpd.conf? Or do I have to
> >set those manually to the same values that I have in httpd.conf?
> 
> You have to set them manually to the same values that you have in
> httpd.conf.

Hrm, I guess with the way configuration files are parsed, at the time
startup.pl is being executed it does not have access to the PerlSetVar
configurations?

> To confirm whether the Loader() config really worked, set Debug -1
> while running Apache::ASP a script, so that you can see that the
> scripts have already been compiled for the first requests against
> your site.

I tried that (I assume you meant Debug -1 in httpd.conf, not the
Loader() %config?), but I got lost in the sheer volume of output. Is
there a string (e.g. "compiling") that I can grep for?

> Also note that includes will be compiled as well, if they are loaded
> with <!--#include ... --> or $Response->Include, but not if they are
> loaded with $main::Response->Include as the parser is not smart
> enough to pick those up when Loader() is called.

So, that means if I use a script via $main::Response->Include(), I
should make sure that script is explicitly compiled by the Loader()
call?

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: %config in Apache::ASP->Loader

Posted by Josh Chamas <jo...@chamas.com>.
Philip Mak wrote:
>>>From tuning.html:
> 
> 
>>The %config args, are the config options that you want set that
>>affect compilation. These options include Debug, Global,
>>GlobalPackage, DynamicIncludes, StatINC, StatINCMatch, XMLSubsMatch,
>>and XMLSubsStrict.
> 
> 
> If I leave the %config hash empty, will Apache::ASP->Loader use the
> values of Global and GlobalPackage from httpd.conf? Or do I have to
> set those manually to the same values that I have in httpd.conf?
> 

You have to set them manually to the same values that you have in httpd.conf.

To confirm whether the Loader() config really worked, set Debug -1
while running Apache::ASP a script, so that you can see that the scripts
have already been compiled for the first requests against your site.

Also note that includes will be compiled as well, if they are loaded
with <!--#include ... --> or $Response->Include, but not if they are
loaded with $main::Response->Include as the parser is not smart enough
to pick those up when Loader() is called.

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checker                 http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org