in reply to mod_perl questions

Single process mode is usually started by calling httpd with a -X parameter. If you don't see warn output in the error_log, it's either not getting to your warn statement or you're looking in the wrong error_log. You might be interested in this book, which you can read on-line or buy on paper.

Replies are listed 'Best First'.
Re^2: mod_perl questions
by artemave (Beadle) on Mar 30, 2007 at 10:26 UTC
    > Single process mode is usually started by calling httpd with a -X parameter

    This I know, but on Windows apache is controlled as service. Any idea how to tell the service to run a single mode?

    > If you don't see warn output in the error_log, it's either not getting to your warn statement
    package Apache2::Hello; use strict; use warnings; use Apache2::RequestRec(); # for $r->content_type use Apache2::RequestIO(); # for $r->puts use Apache2::Const qw/:common/; use Apache2::Reload; sub handler { my $r = shift; my $time = scalar localtime(); my $package = __PACKAGE__; $r->content_type('text/html'); warn 'darn'; $r->puts(<<"END"); <HTML><BODY> <H3>Hello</H3> Hello from <B>$package</B>! The time is $time. </BODY></HTML> END return Apache2::Const::OK; } 1;
    You think?

    > or you're looking in the wrong error_log

    There is only one I know. Configured by ErrorLog parameter in httpd.conf
    Besides, die messages go there as they should.

    Thanks,
    Artem.
      Have you confirmed that the handler code you showed is getting run? Is there any chance you have more than one apache installed on your system? Another possibility is that you might have changed the LogLevel setting from its default.

      I can't help you with the Windows service question since I don't use Windows. I'd suggest you check the docs that came with your build or ask on the mod_perl list. Randy Kobes is pretty good about helping out Windows users on the list.

        > Have you confirmed that the handler code you showed is getting run?

        Yes

        Is there any chance you have more than one apache installed on your system?

        Nope.

        Another possibility is that you might have changed the LogLevel setting from its default.

        I tried defferent ones.

        > I'd suggest you check the docs that came with your build or ask on the mod_perl list.

        Damn. I should have thought about it on my own. Thanx ;)

        One more thing. It really pisses off: when there is a syntax error, apache says 'Can't load module...' but does not mention the reason at all. So it becomes a complicated quest to correct such issues.

        Thanx,
        Artem.