Cataly...Apache(3pm)

πŸ“¦
version 1.16 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Cataly...Apache (3pm) ✨

okay so bestie, welcome to the Catalyst::Engine::Apache page β€” that's a Perl module doc, 3pm section, and we're about to make Apache play nice with Catalyst πŸ’–


πŸŽ€ NAME πŸŽ€

Catalyst::Engine::Apache β€” literally just the Catalyst Apache Engines. that's it, that's the name, no cap.


🌸 SYNOPSIS 🌸

okay so for actual example Apache configs, go read the docs for whichever engine matches your Apache version, mkay? here's the lineup:

  • Catalyst::Engine::Apache::MP13 β€” mod_perl 1.3x, the vintage one 🫢
  • Catalyst::Engine::Apache2::MP19 β€” mod_perl 1.99x
  • Catalyst::Engine::Apache2::MP20 β€” mod_perl 2.x, the modern girlie ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

these classes hand you mod_perl support for Catalyst. that's the whole vibe. slay.


πŸ’… METHODS πŸ’…

$c->engine->apache

returns an Apache, Apache::RequestRec or Apache2::RequestRec object, and which one you get totally depends on your mod_perl version. also!! this method is available as $c->apache too, so you can be lazy about it πŸ’œ

$c->engine->return

so if you need to return something that is not OK from the mod_perl handler, you can set any other Apache constant in this method. but bestie, listen to me:

only use this if you genuinely know what you're doing, or bad things may happen! 😭 not a drill.

like, for example, to return DECLINED in mod_perl 2:

use Apache2::Const -compile => qw(DECLINED);
$c->engine->return( Apache2::Const::DECLINED );

πŸ” NOTES ABOUT LOCATIONMATCH πŸ”

the Apache engine will try to figure out the correct base path if your app is running inside a LocationMatch block. like, for example:

<LocationMatch ^/match/(this|that)*>
    SetHandler          modperl
    PerlResponseHandler MyApp
</LocationMatch>

this will correctly set the base path to '/match/this/' or '/match/that/', depending on which path was actually used for the request. iconic behaviour, honestly πŸ‘‘

but sometimes that's not what you want, and that's valid. so you can disable this behavior by adding this to your configuration:

PerlSetVar CatalystDisableLocationMatch 1

NOTES ON NON-STANDARD PORTS

if you wanna run your site on a non-standard port you'll need to use the Port Apache config rather than Listen. do that and the correct port gets added to urls created using uri_for. πŸ“

Port 8080

πŸ‘‘ OVERLOADED METHODS πŸ‘‘

this class overloads some methods from Catalyst::Engine. look at her go:

  • prepare_request($r)
  • prepare_connection
  • prepare_query_parameters
  • prepare_headers
  • prepare_path
  • read_chunk
  • finalize_body
  • finalize_headers
  • write

🌈 SEE ALSO 🌈

Catalyst Catalyst::Engine. that's the duo, iykyk πŸ’–


πŸ’œ AUTHORS πŸ’œ

the literal legends who made this:

  • Sebastian Riedel <sri@cpan.org>
  • Christian Hansen <ch@ngmedia.com>
  • Andy Grundman <andy@hybridized.org>
  • Tomas Doran <bobtfish@bobtfish.net>

this software is copyright (c) 2010 by The AUTHORS.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. πŸ’…


and that's the whole page bestie 🫢 this was perl v5.36.0, dated 2022-12-06 β€” go forth and configure your Apache, you got this πŸ’–βœ¨

πŸ“¦ where this page comes from