|
List Info
Thread: Decoupling HTTP and interface
|
|
| Decoupling HTTP and interface |

|
2008-03-24 14:08:04 |
So I'm building a RESTful server in Perl to run under
Apache2 and
mod_perl 2. And it occurs to me that my favorite method of
debugging,
perl -d, is not available in this setup, as all the Perl
code is being
executed by Apache and mod_perl, which are setting up their
own
environment that I can't duplicate easily. So then it
occurs to me
that the better thing to do would be to work out the
behaviour outside
of Apache and mod_perl altogether. I could then just make
up GET
strings on the command line or whatever. For Apache's part,
I could
write my mod_perl handlers to call the subs from my text
interface.
So, before I go reinventing the wheel, has anyone done this
already?
Is there some code out there already that I can integrate
into this
project?
KP
--
GPG public key fingerpint: 1A12 04B6 0C80 306A B292 14FD
2C7A 1037 F666 46A7
_______________________________________________
kc mailing list
kc pm.org
http://mail.pm
.org/mailman/listinfo/kc
|
|
| Re: Decoupling HTTP and interface |

|
2008-03-24 14:27:06 |
|
I know that if you want to use an existing framework like Catalyst or
Jifty you can deploy to different kinds of web servers interchangeably
by just tweaking your configuration or running a different command. For
example, Jifty is typically tested using HTTP::Server::Simple and then
deployed using FastCGI (I believe there is a mod_perl implementation is
also available). I'm pretty certain that Catalyst has a similar set of
options available (been a couple years, so my memory is a little fuzzy).
If you don't want to use a framework, then I don't know of
anything. In such cases, I've only ever written my own abstractions and
haven't contributed those abstractions back to CPAN (I know, I'm a
failure).
Cheers, Andrew
On Mon, Mar 24, 2008 at 2:08 PM, Kit Peters < popefelix  gmail.com" >popefelix gmail.com> wrote:
So I'm building a RESTful server in Perl to run under Apache2 and
mod_perl 2. And it occurs to me that my favorite method of debugging,
perl -d, is not available in this setup, as all the Perl code is being
executed by Apache and mod_perl, which are setting up their own
environment that I can't duplicate easily. So then it occurs to me
that the better thing to do would be to work out the behaviour outside
of Apache and mod_perl altogether. I could then just make up GET
strings on the command line or whatever. For Apache';s part, I could
write my mod_perl handlers to call the subs from my text interface.
So, before I go reinventing the wheel, has anyone done this already?
Is there some code out there already that I can integrate into this
project?
KP
--
GPG public key fingerpint: 1A12 04B6 0C80 306A B292 14FD 2C7A 1037 F666 46A7
_______________________________________________
kc mailing list
kc pm.org">kc pm.org
http://mail.pm.org/mailman/listinfo/kc
|
| Re: Decoupling HTTP and interface |
  United States |
2008-03-24 14:47:12 |
On Mon, 24 Mar 2008 14:08:04 -0500
"Kit Peters" <popefelix gmail.com> wrote:
> So I'm building a RESTful server in Perl to run under
Apache2 and
> mod_perl 2. And it occurs to me that my favorite
method of debugging,
> perl -d, is not available in this setup, as all the
Perl code is being
> executed by Apache and mod_perl, which are setting up
their own
> environment that I can't duplicate easily. So then it
occurs to me
> that the better thing to do would be to work out the
behaviour outside
> of Apache and mod_perl altogether. I could then just
make up GET
> strings on the command line or whatever. For Apache's
part, I could
> write my mod_perl handlers to call the subs from my
text interface.
>
> So, before I go reinventing the wheel, has anyone done
this already?
> Is there some code out there already that I can
integrate into this
> project?
You can use Apache: B from
CPAN to allow you to do debugging
on a mod_perl process. I happen to be the maintainer of
that
module these days, so let me know if you have any
problems. ( FYI
it doesn't work with Perl 5.10 yet, I haven't had a chance
to
sort out the bugs ).
One bit of advice however, make sure you run httpd -X so
that
every browser request goes to the same backend of you'll
drive
yourself nuts.
But yes, in general you want to use a framework like
Catalyst,
Jifty, Gantry, etc. which do a lot more for you than just
make debugging a bit easier.
-------------------------------------------------------
Frank Wiles, Revolution Systems, LLC.
Personal : frank wiles.org http://www.wiles.org
Work : frank revsys.com http://www.revsys.com
_______________________________________________
kc mailing list
kc pm.org
http://mail.pm
.org/mailman/listinfo/kc
|
|
| Re: Decoupling HTTP and interface |
  United States |
2008-03-24 14:56:45 |
Kit Peters wrote:
> So I'm building a RESTful server in Perl to run under
Apache2 and
> mod_perl 2. And it occurs to me that my favorite
method of debugging,
> perl -d, is not available in this setup,
I'm the 3rd vote for Catalyst.
In Catalyst, you devel everything using the awesome
"dev server," which
is built into Catalyst and can be run using the command-line
perl
debugger (-d) anytime you want. Then when you're ready to
roll to
production you run the same code, but under mod_perl/Apache
instead (or
fastCGI/Apache or fastCGI/lightHTTPD, or other options).
This is how we do web stuff nowadays.
j
_______________________________________________
kc mailing list
kc pm.org
http://mail.pm
.org/mailman/listinfo/kc
|
|
[1-4]
|
|