The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

GX::Engine::Apache2 - Apache2 / mod_perl 2.x engine component

SYNOPSIS

    package MyApp::Engine;
    
    use GX::Engine::Apache2;
    
    MyApp::Engine->setup(
        max_request_size         => 1048576,
        max_request_memory_usage => 16384
    );
    
    1;

DESCRIPTION

This module provides the GX::Engine::Apache2 class which extends the GX::Engine class.

METHODS

Constructor

new

Returns the engine component instance.

    $engine = $engine_class->new;
Returns:
Exceptions:

Public Methods

setup

Sets up the engine component.

    $engine_class->setup( %options );
Options:
  • buffer_size ( integer )

    Defaults to 8192 bytes.

  • max_request_memory_usage ( integer )

    Defaults to 16384 bytes.

  • max_request_size ( integer )

    Defaults to 1048576 bytes.

Exceptions:

Internal Methods

finalize_response_headers

Handler.

    $engine->finalize_response_headers( $context );
Arguments:

process_request_body

Handler.

    $engine->process_request_body( $context );
Arguments:

process_request_headers

Handler.

    $engine->process_request_headers( $context );
Arguments:

send_response

Handler.

    $engine->send_response( $context );
Arguments:

EXPORTS

Application Class

handler

Internal method.

    $application_class->handler( $request_record );
Arguments:

Context Class

request_record

Returns the current request record.

    $request_record = $context->request_record;
Returns:

I/O ADAPTORS

For internal use only.

  • Input stream class

    GX::Engine::Apache2::InputStream

  • Output stream class

    GX::Engine::Apache2::OutputStream

  • Error stream class

    GX::Engine::Apache2::ErrorStream

SERVER SETUP

Example (Apache/2.2.13 on openSUSE 11.2):

/etc/apache2/default-server.conf:

  LoadModule perl_module /usr/lib/apache2/mod_perl.so
  
  <VirtualHost *:80>
  
      ServerName localhost
  
      DocumentRoot /srv/www/myapp/public
  
      <Directory /srv/www/myapp/public>
          Order Deny,Allow
          Allow from All
      </Directory>
  
      PerlOptions +Parent
  
      PerlSwitches -I /srv/www/myapp/lib
  
      PerlModule MyApp
  
      <Location />
          SetHandler perl-script
          PerlResponseHandler MyApp
          DirectorySlash Off
      </Location>
  
      <Location /static>
          SetHandler None
      </Location>
  
      <Location /favicon.ico>
          SetHandler None
      </Location>
  
      <Location /error>
          SetHandler None
      </Location>
  
  </VirtualHost>

LIMITATIONS

This module currently only supports the Apache Prefork MPM (mpm_prefork_module).

SEE ALSO

AUTHOR

Jörg A. Uzarek <uzarek@runlevelnull.de>

COPYRIGHT AND LICENSE

Copyright (c) 2009-2011 Jörg A. Uzarek.

This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.