in reply to Weird HTML::Mason error

Where in httpd.conf did you put it? can you post the surrounding lines as well?

Replies are listed 'Best First'.
Re^2: Weird HTML::Mason error
by tomazos (Deacon) on Aug 01, 2005 at 15:40 UTC
    I cut it down to the minimum...

    ServerType standalone ServerRoot "/home/andrew/apache" PidFile /home/andrew/apache/logs/httpd.pid ScoreBoardFile /home/andrew/apache/logs/httpd.scoreboard Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 15 MinSpareServers 5 MaxSpareServers 10 StartServers 5 MaxClients 150 MaxRequestsPerChild 0 LoadModule perl_module libexec/libperl.so ClearModuleList AddModule mod_so.c AddModule mod_perl.c Port 1810 User nobody Group nobody ServerAdmin andrew@tomazos.com DocumentRoot "/home/andrew/web/ikb" PerlModule HTML::Mason::ApacheHandler # <-- FAILS HERE

    The same error as original post originating from the PerlModule line.

    -Andrew.


    Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com
      PerlModule is not used for setting Apache handlers; for that you need PerlHandler.

      See the example from the Mason book.

        Yes, I know, but even when I dont use a PerlModule to load HTML::Mason::ApacheHandler in httpd.conf it still doesn't work.

        It fails when the handler gets called and HTML::Mason::ApacheHandler is loaded at runtime with the same error:

        [Mon Aug 1 10:01:09 2005] [error] unknown field \n passed to construc +tor for class HTML::Mason::ExceptionCompilation failed in require at +(eval 5) line 3.\n [Mon Aug 1 10:01:09 2005] [error] Can't locate object method "make_ah +" via package "Apache" (perhaps you forgot to load "Apache"?) at (eva +l 31) line 6.\n

        -Andrew.


        Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com
      Try using a wrapper as suggested in the Mason manual, for example:
      #!/usr/bin/perl # handler.pl package HTML::Mason; use HTML::Mason; use HTML::Mason::ApacheHandler; use strict; { package HTML::Mason::Commands; use DBI (); use CGI (); } DBI->install_driver('mysql'); CGI->compile(':standard'); my $ah = HTML::Mason::ApacheHandler->new( comp_root => '/path/to/comp/root', data_dir => '/path/to/data/dir' ); sub handler { my ($r) = @_; return $ah->handle_request($r); } 1;
      Load it from httpd.conf:
      PerlRequire /path/to/handler.pl
      Speaking of httpd.conf, here's part of yours:
      > KeepAlive On
      > ...
      > MaxClients 150
      
      You should configure apache properly for mod_perl. Generally you want keepalive turned off and maxclients set to something your server can handle based on the size of your apache children.

      --
      perl -MO=Deparse -e"u j t S n a t o e h r , e p l r a h k c r e"