[Catalyst] Catalyst + RHTMLO

2007-09-04 Thread Tobias Kremer
Is anybody here using Catalyst + RHTMLO, especially Rose::HTML::Form, to handle
forms? If yes, I'd like to know what your glue code (init forms from db,
re-fill from $c-req-params etc.) looks like because RHTMLO has a somewhat
different approach to handling things and I have the feeling that I'm doing
things overly complicated.

Other than that, I really like the way RHTMLO works and would love to see
something like a Catalyst::Controller::RHTMLO module which works similar to the
other form controllers out there. The existing C::C::Rose module is tied to RDBO
and thus of no use for me because I very much prefer DBIC.

Thanks for any hints!

--Tobias

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: Catalyst::Plugin::DBIC::QueryLog

2007-09-04 Thread Matt S Trout
On Tue, Sep 04, 2007 at 01:19:31AM +, Fayland Lam wrote:
 Matt S Trout wrote:
 On Sat, Sep 01, 2007 at 04:08:09AM +, Fayland Lam wrote:
 hi, guys.
 
 since I can't touch Cory Watson by [EMAIL PROTECTED] mailto:[EMAIL 
 PROTECTED]
 so I wonder if this module is fine?
 
 No, it's awful. There's no reason at all for this to be a plugin.
 
 I'd suggest you make it a mixin for Catalyst::Model::DBIC::Schema instead.
 
 
 but it depends on every request. it start at the sub prepare and end 
 before finalize_body. due to my limited knowledge, I'm not sure if it's 
 OK as a mixin for Catalyst::Model::DBIC::Schema

I'm sure it is.

You just have a per-request query log.

That's trivial with Catalyst::Component::InstancePerContext.
 
 
 (otherwise how do you deal with two DBIC models each with their own
 querylog etc. etc.)
 
 that's right. but there is more than one way to do it. :)

Yes, but yours is wrong.

We've documented this clearly in ExtendingCatalyst - if it doesn't need
to affect the request cycle, it shouldn't be a plugin.

Please send me an htpasswd line so I can set up Model::DBIC::Schema::QueryLog
dirs for you (or consider just submitting a patch to M::DBIC::Schema itself,
which I'd be happy to help with)

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical DirectorWant a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst + RHTMLO

2007-09-04 Thread Matt S Trout
On Tue, Sep 04, 2007 at 11:31:57AM +0200, Tobias Kremer wrote:
 Is anybody here using Catalyst + RHTMLO, especially Rose::HTML::Form, to 
 handle
 forms? If yes, I'd like to know what your glue code (init forms from db,
 re-fill from $c-req-params etc.) looks like because RHTMLO has a somewhat
 different approach to handling things and I have the feeling that I'm doing
 things overly complicated.
 
 Other than that, I really like the way RHTMLO works and would love to see
 something like a Catalyst::Controller::RHTMLO module which works similar to 
 the
 other form controllers out there. The existing C::C::Rose module is tied to 
 RDBO
 and thus of no use for me because I very much prefer DBIC.

The ::Rose author seemed perfectly willing to make it work with DBIC, but
since he doesn't use DBIC he doesn't know what you'd need (just like I couldn't
write it due to not using RHTMLO :).

Maybe if you try and outline what you'd like from an API POV something could
be done?

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical DirectorWant a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: Catalyst::Plugin::DBIC::QueryLog

2007-09-04 Thread Fayland Lam

see attachment. check if it's OK?

now it's not per request any more. hmm, after several requests,

Total SQL Time: 1.033088 seconds
Total Queries: 115

it will increasing. hmm, how to make it as per request?

Thanks, mst. (I'll send u a htpasswd line after all is OK.)


Matt S Trout wrote:

On Tue, Sep 04, 2007 at 01:19:31AM +, Fayland Lam wrote:

Matt S Trout wrote:

On Sat, Sep 01, 2007 at 04:08:09AM +, Fayland Lam wrote:

hi, guys.

since I can't touch Cory Watson by [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
so I wonder if this module is fine?

No, it's awful. There's no reason at all for this to be a plugin.

I'd suggest you make it a mixin for Catalyst::Model::DBIC::Schema instead.


but it depends on every request. it start at the sub prepare and end 
before finalize_body. due to my limited knowledge, I'm not sure if it's 
OK as a mixin for Catalyst::Model::DBIC::Schema


I'm sure it is.

You just have a per-request query log.

That's trivial with Catalyst::Component::InstancePerContext.
 

(otherwise how do you deal with two DBIC models each with their own
querylog etc. etc.)

that's right. but there is more than one way to do it. :)


Yes, but yours is wrong.

We've documented this clearly in ExtendingCatalyst - if it doesn't need
to affect the request cycle, it shouldn't be a plugin.

Please send me an htpasswd line so I can set up Model::DBIC::Schema::QueryLog
dirs for you (or consider just submitting a patch to M::DBIC::Schema itself,
which I'd be happy to help with)




--
Fayland Lam // http://www.fayland.org/
package Catalyst::Model::DBIC::Schema::QueryLog;

use warnings;
use strict;
use vars qw/$VERSION/;
$VERSION = '0.01';

use base 'Catalyst::Model::DBIC::Schema';
__PACKAGE__-mk_accessors('querylog');

use DBIx::Class::QueryLog;
use DBIx::Class::QueryLog::Analyzer;

sub new {
my $self = shift-NEXT::new(@_);

my $schema = $self-schema;

my $querylog = new DBIx::Class::QueryLog();
$self-querylog($querylog);

$schema-storage-debugobj( $querylog );
$schema-storage-debug(1);

return $self;
}

sub querylog_analyzer {
my $self = shift;

my $ann = new DBIx::Class::QueryLog::Analyzer({ querylog = $self-querylog 
});
return $ann;
}

1; # End of Catalyst::Model::DBIC::Schema::QueryLog
__END__

=head1 NAME

Catalyst::Model::DBIC::Schema::QueryLog - The great new 
Catalyst::Model::DBIC::Schema::QueryLog!

=head1 SYNOPSIS

  package MyApp::Model::FilmDB;
  use base qw/Catalyst::Model::DBIC::Schema::QueryLog/;

  __PACKAGE__-config(
  schema_class = 'MyApp::Schema::FilmDB',
  connect_info = [
DBI:...,
username,
password,
{AutoCommit = 1}
  ]
  );

=head1 METHODS

=over 4

=item querylog

an instance of DBIx::Class::QueryLog.

=item querylog_analyzer

an instance of DBIx::Class::QueryLog::Analyzer.

=back

=head1 EXAMPLE CODE

  div class=featurebox
h3Query Log Report/h3
[% SET total = c.model('DBIC').querylog.time_elapsed | format('%0.6f') %]
divTotal SQL Time: [% total | format('%0.6f') %] seconds/div
[% SET qcount = c.model('DBIC').querylog.count %]
divTotal Queries: [% qcount %]/div
[% IF qcount %]
divAvg Statement Time: [% (c.model('DBIC').querylog.time_elapsed / 
qcount) | format('%0.6f') %] seconds./div
div
 table class=table1
  thead
   tr
th colspan=35 Slowest Queries/th
   /tr
  /thead
  tbody
   tr
thTime/th
th%/th
thSQL/th
   /tr
   [% SET i = 0 %]
   [% FOREACH q = c.model('DBIC').querylog_analyzer.get_sorted_queries %]
   tr class=[% IF loop.count % 2 %]odd[% END %]
th class=sub[% q.time_elapsed | format('%0.6f') %]
td[% ((q.time_elapsed / total ) * 100 ) | format('%i') %]%/td
td[% q.sql %]/td
   /th/tr
   [% IF i == 5 %]
[% LAST %]
   [% END %]
   [% SET i = i + 1 %]
   [% END %]
  /tbody
 /table
/div
[% END %]
  /div

=head1 SEE ALSO

LCatalyst::Model::DBIC::Schema

LDBIx::Class::QueryLog

=head1 AUTHOR

Fayland Lam, C fayland at gmail.com 

=head1 COPYRIGHT  LICENSE

Copyright 2007 Fayland Lam, all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: Catalyst::Plugin::DBIC::QueryLog

2007-09-04 Thread Jonathan Rockway
Fayland Lam wrote:
 see attachment. check if it's OK?

 now it's not per request any more. hmm, after several requests,
mst wrote:
 That's trivial with Catalyst::Component::InstancePerContext.

He intended for you to use that. 

It implements the per-request magic for you with some clever use of
ACCEPT_CONTEXT and the stash.  Basically, it calls your builder method
if you don't already have an instance in $c-stash.  Since that gets
cleared every request, you get your per-request.

So, try again :)  You're almost there :)

Regards,
Jonathan Rockway



signature.asc
Description: OpenPGP digital signature
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: Catalyst::Plugin::DBIC::QueryLog

2007-09-04 Thread Fayland Lam

Jonathan Rockway wrote:

Fayland Lam wrote:

see attachment. check if it's OK?

now it's not per request any more. hmm, after several requests,

mst wrote:

That's trivial with Catalyst::Component::InstancePerContext.


He intended for you to use that. 


It implements the per-request magic for you with some clever use of
ACCEPT_CONTEXT and the stash.  Basically, it calls your builder method
if you don't already have an instance in $c-stash.  Since that gets
cleared every request, you get your per-request.

So, try again :)  You're almost there :)



Thank God. it works now. :)
plz have a check, then I'll commit it to Catalyst trunk and release as a 
CPAN module.


Thanks for your help.




Regards,
Jonathan Rockway





___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/



--
Fayland Lam // http://www.fayland.org/
package Catalyst::Model::DBIC::Schema::QueryLog;

use warnings;
use strict;
use vars qw/$VERSION/;
$VERSION = '0.01';

use base 'Catalyst::Model::DBIC::Schema';
__PACKAGE__-mk_accessors('querylog');

use DBIx::Class::QueryLog;
use DBIx::Class::QueryLog::Analyzer;
use Moose;
with 'Catalyst::Component::InstancePerContext';

sub querylog_analyzer {
my $self = shift;

my $ann = new DBIx::Class::QueryLog::Analyzer( { querylog = 
$self-querylog } );
return $ann;
}

sub build_per_context_instance {
my ($self, $c) = @_;

my $schema = $self-schema;

my $querylog = new DBIx::Class::QueryLog();
$self-querylog($querylog);

$schema-storage-debugobj( $querylog );
$schema-storage-debug(1);

return $self;
}

1; # End of Catalyst::Model::DBIC::Schema::QueryLog
__END__

=head1 NAME

Catalyst::Model::DBIC::Schema::QueryLog - DBIx::Class::QueryLog Model Class

=head1 SYNOPSIS

  package MyApp::Model::FilmDB;
  use base qw/Catalyst::Model::DBIC::Schema::QueryLog/;

  __PACKAGE__-config(
  schema_class = 'MyApp::Schema::FilmDB',
  connect_info = [
DBI:...,
username,
password,
{AutoCommit = 1}
  ]
  );

=head1 DESCRIPTION

Generally, you should check the document of LCatalyst::Model::DBIC::Schema. 
this module use base of it, and only provide extra two methods below.

=head1 METHODS

=over 4

=item querylog

an instance of DBIx::Class::QueryLog.

=item querylog_analyzer

an instance of DBIx::Class::QueryLog::Analyzer.

=back

=head1 EXAMPLE CODE

  div class=featurebox
h3Query Log Report/h3
[% SET total = c.model('DBIC').querylog.time_elapsed | format('%0.6f') %]
divTotal SQL Time: [% total | format('%0.6f') %] seconds/div
[% SET qcount = c.model('DBIC').querylog.count %]
divTotal Queries: [% qcount %]/div
[% IF qcount %]
divAvg Statement Time: [% (c.model('DBIC').querylog.time_elapsed / 
qcount) | format('%0.6f') %] seconds./div
div
 table class=table1
  thead
   tr
th colspan=35 Slowest Queries/th
   /tr
  /thead
  tbody
   tr
thTime/th
th%/th
thSQL/th
   /tr
   [% SET i = 0 %]
   [% FOREACH q = c.model('DBIC').querylog_analyzer.get_sorted_queries %]
   tr class=[% IF loop.count % 2 %]odd[% END %]
th class=sub[% q.time_elapsed | format('%0.6f') %]
td[% ((q.time_elapsed / total ) * 100 ) | format('%i') %]%/td
td[% q.sql %]/td
   /th/tr
   [% IF i == 5 %]
[% LAST %]
   [% END %]
   [% SET i = i + 1 %]
   [% END %]
  /tbody
 /table
/div
[% END %]
  /div

=head1 SEE ALSO

LCatalyst::Model::DBIC::Schema

LDBIx::Class::QueryLog

=head1 AUTHOR

Fayland Lam, C fayland at gmail.com 

=head1 COPYRIGHT  LICENSE

Copyright 2007 Fayland Lam, all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: Catalyst::Plugin::DBIC::QueryLog

2007-09-04 Thread Matt S Trout
On Tue, Sep 04, 2007 at 12:02:14PM +, Fayland Lam wrote:
 Jonathan Rockway wrote:
 Fayland Lam wrote:
 see attachment. check if it's OK?
 
 now it's not per request any more. hmm, after several requests,
 mst wrote:
 That's trivial with Catalyst::Component::InstancePerContext.
 
 He intended for you to use that. 
 
 It implements the per-request magic for you with some clever use of
 ACCEPT_CONTEXT and the stash.  Basically, it calls your builder method
 if you don't already have an instance in $c-stash.  Since that gets
 cleared every request, you get your per-request.
 
 So, try again :)  You're almost there :)
 
 
 Thank God. it works now. :)
 plz have a check, then I'll commit it to Catalyst trunk and release as a 
 CPAN module.

Beautiful.

fayland++

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical DirectorWant a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] uri_for adding :443 to URL when HTTPS=on

2007-09-04 Thread Charlie Garrison

Good evening,

On 3/9/07 at 7:54 PM +0100, Matt S Trout 
[EMAIL PROTECTED] wrote:


 The above error makes sense in the context of 
frontend/backend  apache with rewrite rules.
  RewriteRule ^/login(.*)$ 
http://%{HTTP_HOST}:8627/progs/login$1 [P]
 RewriteRule ^/progs/(.*)$
http://%{HTTP_HOST}:8627/progs/$1 [P]


That's kinda broken, it's relying on the request header which a browser
could easily cock up.


Fair enough, although I've seen heaps of examples using 
%{HTTP_HOST} so I followed along.



I suspect %{REMOTE_HOST} would be better (see the mod_rewrite docs for
more info)


REMOTE_HOST seems to be the client host name, not the server. So 
I don't think that's the one you meant. Did you mean SERVER_NAME 
instead? Since SERVER_NAME seems to give the value I expect, 
I'll switch to using that. Still doesn't really solve the core 
issue though.


When I generate a URI string with $c-uri_for(...) and HTTPS=on, 
then I get :443 as part of the URI string. What can I do in my 
Catalyst config (or elsewhere) to prevent :443 being included in 
the URI string?


Thanks,
Charlie

--
   Charlie Garrison  [EMAIL PROTECTED]
   PO Box 141, Windsor, NSW 2756, Australia

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] uri_for adding :443 to URL when HTTPS=on

2007-09-04 Thread Matt S Trout
On Tue, Sep 04, 2007 at 11:24:43PM +1000, Charlie Garrison wrote:
 Good evening,
 
 On 3/9/07 at 7:54 PM +0100, Matt S Trout 
 [EMAIL PROTECTED] wrote:
 
  The above error makes sense in the context of 
 frontend/backend  apache with rewrite rules.
   RewriteRule ^/login(.*)$ 
 http://%{HTTP_HOST}:8627/progs/login$1 [P]
  RewriteRule ^/progs/(.*)$
 http://%{HTTP_HOST}:8627/progs/$1 [P]
 
 That's kinda broken, it's relying on the request header which a browser
 could easily cock up.
 
 Fair enough, although I've seen heaps of examples using 
 %{HTTP_HOST} so I followed along.
 
 I suspect %{REMOTE_HOST} would be better (see the mod_rewrite docs for
 more info)
 
 REMOTE_HOST seems to be the client host name, not the server. So 
 I don't think that's the one you meant. Did you mean SERVER_NAME 
 instead? Since SERVER_NAME seems to give the value I expect, 
 I'll switch to using that.

Damn. Yes, sorry.

Rewrite setup configs always fall out of my head if I don't do one for a
few days.

 Still doesn't really solve the core 
 issue though.

I thought the core issue was that your rewrite rules were broken?

 When I generate a URI string with $c-uri_for(...) and HTTPS=on, 
 then I get :443 as part of the URI string. What can I do in my 
 Catalyst config (or elsewhere) to prevent :443 being included in 
 the URI string?

Have you checked to see what your webserver's giving Catalyst? I'm not
sure this isn't just uri_for naively working with what the webserver gives
it.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical DirectorWant a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] uri_for adding :443 to URL when HTTPS=on

2007-09-04 Thread Charlie Garrison

Good morning,

On 4/9/07 at 4:44 PM +0100, Matt S Trout 
[EMAIL PROTECTED] wrote:


 REMOTE_HOST seems to be the client host name, not the 
server. So  I don't think that's the one you meant. Did you 
mean SERVER_NAME  instead? Since SERVER_NAME seems to give the 
value I expect,  I'll switch to using that.


Damn. Yes, sorry.

Rewrite setup configs always fall out of my head if I don't do one for a
few days.


Or even a few hours for some of us.  ;-)


 Still doesn't really solve the core  issue though.


I thought the core issue was that your rewrite rules were broken?


Sorry for not being clear. I was giving that info as background 
and to show how I was working around the issue.


 When I generate a URI string with $c-uri_for(...) and 
HTTPS=on,  then I get :443 as part of the URI string. What can 
I do in my  Catalyst config (or elsewhere) to prevent :443 
being included in  the URI string?


Have you checked to see what your webserver's giving Catalyst? I'm not
sure this isn't just uri_for naively working with what the webserver gives
it.


To confirm, I'm using a rewrite rule such as:

# uses custom port on backend to indicate https - sets HTTPS=on
# Catalyst app base is /progs
RewriteRule ^/progs/(.*)$   
http://%{SERVER_NAME}:8627/progs/$1 [P]


I'm printing this to error_log (request for 
https://www.resultsplus.com.au/progs/):

INFO - ***Root::auto HTTPS: on
INFO - ***Root::auto HTTP_HOST: www.resultsplus.com.au:8627
INFO - ***Root::auto c-req-path:
INFO - ***Root::auto c-req-secure: 1
INFO - ***Root::auto c-req-base: https://www.resultsplus.com.au:443/progs/
INFO - ***Root::auto c-req-uri: https://www.resultsplus.com.au:443/progs/
INFO - ***Root::auto c-req-uri-scheme: https
INFO - ***Root::auto c-req-uri-opaque: //www.resultsplus.com.au:443/progs/
INFO - ***Root::auto c-req-uri-port: 443
INFO - ***Root::auto c-req-uri-host_port: www.resultsplus.com.au:443
INFO - ***Root::auto c-uri_for: https://www.resultsplus.com.au:443/progs/

I believe this is an issue with the URI module adding port 443 
since the port in the request is not the 'standard' https port. 
Assuming that is accurate, what is the correct way in Catalyst 
to 'correct' the URI value? Is it a bug or something I need to 
be doing differently?


Thanks,
Charlie

--
   Charlie Garrison  [EMAIL PROTECTED]
   PO Box 141, Windsor, NSW 2756, Australia

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] FastCGI config for standalone mode

2007-09-04 Thread Matt S Trout
On Thu, Aug 30, 2007 at 11:42:51PM +0100, Will Hawes wrote:
 I've set up a Catalyst app with Apache2 and FastCGI using the config
 described under Standalone server mode at
 http://search.cpan.org/~jrockway/Catalyst-Manual-5.701002/lib/Catalyst/Manual/Cookbook.pod#Standalone_server_mode.
 Everything works fine when the FastCGI server is running via the helper
 script and I can use the app without problems.
 
 The docs state that when the backend FastCGI server is down, Apache will
 return a 502 error. The suggestion is to use an ErrorDocument directive to
 display a down for maintenance page when this is the case. However, Apache
 is actually returning a 500 error, not a 502. Apache's error log contains
 only the following:

This may be a stupid suggestion.

But wouldn't it be more useful to just trap 500s for a general sorry page
and have a static page httpd.conf you can use during maint?

It's not like your fcgi server should ever really be down except when
you're fucking with the backend DB or whatever

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical DirectorWant a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] FastCGI config for standalone mode

2007-09-04 Thread Will Hawes
On 04/09/07, Matt S Trout [EMAIL PROTECTED] wrote:
 On Thu, Aug 30, 2007 at 11:42:51PM +0100, Will Hawes wrote:
  I've set up a Catalyst app with Apache2 and FastCGI using the config
  described under Standalone server mode at
  http://search.cpan.org/~jrockway/Catalyst-Manual-5.701002/lib/Catalyst/Manual/Cookbook.pod#Standalone_server_mode.
  Everything works fine when the FastCGI server is running via the helper
  script and I can use the app without problems.
 
  The docs state that when the backend FastCGI server is down, Apache will
  return a 502 error. The suggestion is to use an ErrorDocument directive to
  display a down for maintenance page when this is the case. However, Apache
  is actually returning a 500 error, not a 502. Apache's error log contains
  only the following:

 This may be a stupid suggestion.

 But wouldn't it be more useful to just trap 500s for a general sorry page
 and have a static page httpd.conf you can use during maint?

 It's not like your fcgi server should ever really be down except when
 you're fucking with the backend DB or whatever

That's a perfectly good suggestion IMO. The question was really only
down to curiosity and the discrepancy between what the Catalyst docs
say and what I'm seeing in practice, not any specific desire to catch
502 errors. Just wondered whether I'm missing a trick as usual, or
whether the docs need altering.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] new catalyst site - art calendar

2007-09-04 Thread Barry Hoggard
I've finally launched all sections of my site:

http://www.artcal.net/

It was originally a CGI::Application/TT app running under mod_perl,
and now it's a Catalyst App running under mod_perl.  It's the first
week of a very big art season in NYC, and we just sent out the weekly
newsletter with the list of openings.  I'm expecting page views in the
6-10K per day range.  I'm staying with mod_perl rather than
lighttpd/fastcgi until I can convert the other applications that run
on that server.

The admin and public sites are separate apps running with a shared
schema directory.  I use HTML::FormFu plus jquery calendar and
clockpick for the date and time entry on the backend, and Imager to
reformat images.

I'm also using a number of feeds such as flickr, blip.tv, and
bloglines citations to show related materials.  An example of an
exhibition with all 3 is here (scoll down):

http://www.artcal.net/event/view/6/4980

Thanks for Carl for all of the HTML::FormFu help, and MST in
particular for catalyst and DBIC help.


-- 
Barry Hoggard

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/