logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: CAP-AnyTemplate & mod_perl: msg#00274

lang.perl.modules.cgi-appplication

Subject: Re: CAP-AnyTemplate & mod_perl

On Mon, 18 Jul 2005, Michael Graham <magog@xxxxxxxxxxxx> wrote:
>
>> >> Trying to get CA plus some plugins working under mod_perl.
>> >> CAP-AnyTemplate (v0.07) works fine as part of regular cgi script, but
>> >> when run under mod_perl:
>> >
>> >> $self->template->config(
>> >> Configs->AT_CONFIG,
>> >> );
>> >
>> >Do you put the call to $self->template->config inside of your
>> >application's setup or cgiapp_init methods? Or is it outside all
>> >methods?
>> >
>> It is part of cgiapp_init(). Incidentally, AT_CONFIG is inside package
>> Configs, which I did not make clear in my original message (though
>> obvious I hope).
>
>Hmmm.. your error messages indicate the HTML::Template driver is being
>used, so it really does look like $self->template is not getting its
>config data properly (and so it is falling back to the defaults).
>
>Could you try something like the following and verify that
>Configs->AT_CONFIG contains what you think it contains at init time?
>
> sub cgiapp_init {
> my $self = shift;
>
> # ... other init stuff goes here ...
>
> my $at_config = Configs->AT_CONFIG;
>
> use Data::Dumper;
> print STDERR Dumper $at_config;
>
> $self->template->config(
> $at_config
> );
> }
>
>And then look at the error log.
Now this is potentially very interesting! First invocation of app after
server restart loads template OK, and Data::Dumper(Configs->AT_CONFIG)
says:

$VAR1 = {
'default_type' => 'TemplateToolkit',
'TemplateToolkit' => {
'INTERPOLATE' => '1',
'WRAPPER' => 'hilis.tmpl',
'TAG_STYLE' => 'asp'
},
'include_paths' => [
'/127.0.0.1/perl/hilis4/templates',
'/127.0.0.1/perl/hilis4/templates/HILIS4'
]
};

But second and subsequent invocations (ie hit browser reload button) get
error message, and Data::Dumper says:

$VAR1 = {
'TemplateToolkit' => {
'INTERPOLATE' => '1',
'WRAPPER' => 'hilis.tmpl',
'TAG_STYLE' => 'asp'
}
};

ie part of the AT_CONFIG is missing (default_type and include_paths).
That could explain why it is defaulting to HTML::Template and cannot
then find a template file. But what is causing this behaviour?

>I tried duplicating your setup here and it does seem to work for me.
>Here's what I did:
I will try your setup tomorrow when I have a little time, but I don't
recognise your PerlHandler code so maybe I have not set Apache/mod_perl
up correctly? There is no mention of my module in httpd.conf or
perl.conf, I just invoke the application via the browser, and Apache
knows to run applications from the /127.0.0.1/perl/ directory using
'PerlResponseHandler ModPerl::Registry' (mod_perl 1.99). Perhaps this is
the problem?
--
Richard Jones
Leeds, UK
mailto:ra.jones@xxxxxxxxxxxxxxx

---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
krysalis.sandbo...    web.zope.zwiki/...    gnome.apps.gnum...    xfree86.newbie/...    editors.vim/200...    mozilla.enigmai...    boot-loaders.gr...    network.vnc.ult...    redhat.release....    java.geronimo.u...    os.netbsd.devel...    horde.wicked/20...    linux.lsb.discu...    ietf.ips/2005-0...    alsa.devel/2002...    user-groups.lin...    package-managem...    debian.devel.da...    security.cyrus....    video.gstreamer...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation