in reply to Apache and HTML::Mason::CGIHandler, Not being called?

Not having used Mason, I'm "shooting in the dark", but have you made sure that your cgi directory is defined correctly in you httpd.conf file? The htaccess file shown is only to do with html files and has no bearing on the .cgi file shown. Also, do you have perl installed?

You say you had problems installing mod_perl...can you provide some detail? The install process is very straightforward on Win32, providing that you're using activestate's distro and you've set the repository correctly in PPM (all of the required instuctions are at mod_perl).

rdfield

  • Comment on Re: Apache and HTML::Mason::CGIHandler, Not being called?

Replies are listed 'Best First'.
Re: Re: Apache and HTML::Mason::CGIHandler, Not being called?
by Flame (Deacon) on Oct 30, 2002 at 20:34 UTC

    Sit down, this could take a while as I'm not quite sure how to explain the problems I've had with mod_perl :)

    I have tried their PPM method of installation to no avail... while I get all the Apache perl modules, mod_perl itself never installs (I followed their instructions down to a copy-paste.) I attempted to manualy build my own, only to discover that MS-VC++ can't do what MS-DevStuido can, so I can't build it myself. Thus, I had to give up on mod_perl (unless I overlooked an option).

    So, HTML::Mason has a module designed to simulate mod_perl, HTML::Mason::CGIHandler, which you can supposedly tell Apache to use instead of referencing the file itself... the problem is, it's still referencing the file itself. Ie: http://localhost.com/School/test.html

    htdocs/School/test.html contains: <% 1+1 %>

    If mason reads it, it should come out 2, with nothing else. Just 2. Instead I get <% 1+1 %> printed out. So... something is going wrong somewhere along the line. (That .htaccess file is also in htdocs/School)

    Also, I do have the latest version of ActivePerl, though I haven't attempted to install mod_perl since a couple minor revisions ago (circa February release, attempted install only a week ago) The cgi directory is the default, and the one that the installer setup automaticaly.

    I hope this clears a few things up, anything else I should provide?

    Thanks for the suggestions.



    My code doesn't have bugs, it just develops random features.

    Flame ~ Lead Programmer: GMS | GMS

      As I said, I've never used Mason, but from your description it looks like the handler is not being called - which from my understanding would mean that your <FilesMatch> directive is incorrect. You might want to check the access log to make sure that the html file specified is being processed correctly.

      On the mod_perl front, there is one tricky step which is often missed out, so I'll list the steps I use to install mod_perl in Win32 boxen:

      • Download the binary Apache distribution (version 1.3.27 as I haven't progressed to 2.0 yet) from here
      • Run the downloaded installer exe, which by default will install apache in c:\program files\apache group\apache
      • Download the latest activestate Perl distro from Activestate (the .msi file is best)
      • Install the perl msi file, which by default ends up in c:\perl
      • Run cmd if on a WinNT, W2K etc box or command on a 9x box
      • Run ppm at the command line
      • At the PPM prompt enter repository add mod_perl http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer
      • At the PPM prompt enter install mod_perl
      • Eventually it will ask where to install the mod_perl library, enter c:/program files/apache group/apache/modules (if this doesn't work, find mod_perl.so and copy it manually into this directory)
      • Uncomment the perl module lines in the apache httpd.conf (if they're not there add the lines LoadModule modules/mod_perl.so and AddModule mod_perl.c to the appropriate sections)
      • Set up an appropriate perl handler:
        Alias /perl/ "/some/dir/on/my/disk/" <Location /perl> SetHandler perl-script PerlHandler Apache::Registry AddHandler perl-script .pl Options +ExecCGI PerlSendHeader On </Location>
      • and any .pl files in your /some/dir/on/my/disk/ directory will be handled by mod_perl.
      Hope this helps.

      rdfield

      Update: Corrected reference from mod_perl.dll to mod_perl.so

        "You might want to check the access log to make sure that the html file specified is being processed correctly."

        I'm going to re-install Apache (upgrade as well), and try to follow your instructions, but how would I check if the html file was being processed correctly?

        BTW: I was using Apache 1.3.20 if that helps...





        My code doesn't have bugs, it just develops random features.

        Flame ~ Lead Programmer: GMS | GMS

        Well, I just tried "install mod_perl" again (I have tried this method before) and this is the majority of the output:

        Installing E:\Perl\site\lib\mod_perl_method_handlers.pod Installing E:\Perl\site\lib\mod_perl.pod Installing E:\Perl\site\lib\mod_perl_tuning.pod Installing E:\Perl\site\lib\mod_perl_traps.pod Installing E:\Perl\site\lib\mod_perl_hooks.pm Installing E:\Perl\site\lib\cgi_to_mod_perl.pod Installing E:\Perl\site\lib\.cvsignore Installing E:\Perl\site\lib\Apache.pm Installing E:\Perl\site\lib\Bundle\Apache.pm Installing E:\Perl\site\lib\Apache\Registry.pm Installing E:\Perl\site\lib\Apache\PerlSections.pm Installing E:\Perl\site\lib\Apache\PerlRun.pm Installing E:\Perl\site\lib\Apache\Debug.pm Installing E:\Perl\site\lib\Apache\MyConfig.pm Installing E:\Perl\site\lib\Apache\ExtUtils.pm Installing E:\Perl\site\lib\Apache\src.pm Installing E:\Perl\site\lib\Apache\Symdump.pm Installing E:\Perl\site\lib\Apache\Status.pm Installing E:\Perl\site\lib\Apache\RedirectLogFix.pm Installing E:\Perl\site\lib\Apache\Include.pm Installing E:\Perl\site\lib\Apache\StatINC.pm Installing E:\Perl\site\lib\Apache\RegistryBB.pm Installing E:\Perl\site\lib\Apache\test.pm Installing E:\Perl\site\lib\Apache\FakeRequest.pm Installing E:\Perl\site\lib\Apache\SizeLimit.pm Installing E:\Perl\site\lib\Apache\Resource.pm Installing E:\Perl\site\lib\Apache\RegistryNG.pm Installing E:\Perl\site\lib\Apache\httpd_conf.pm Installing E:\Perl\site\lib\Apache\.cvsignore Installing E:\Perl\site\lib\Apache\SIG.pm Installing E:\Perl\site\lib\Apache\Options.pm Installing E:\Perl\site\lib\Apache\fork.pm Installing E:\Perl\site\lib\Apache\Opcode.pm Installing E:\Perl\site\lib\Apache\RegistryLoader.pm Installing E:\Perl\site\lib\Apache\Connection.pm Installing E:\Perl\site\lib\Apache\Constants.pm Installing E:\Perl\site\lib\Apache\File.pm Installing E:\Perl\site\lib\Apache\Leak.pm Installing E:\Perl\site\lib\Apache\Log.pm Installing E:\Perl\site\lib\Apache\ModuleConfig.pm Installing E:\Perl\site\lib\Apache\PerlRunXS.pm Installing E:\Perl\site\lib\Apache\Server.pm Installing E:\Perl\site\lib\Apache\Symbol.pm Installing E:\Perl\site\lib\Apache\Table.pm Installing E:\Perl\site\lib\Apache\URI.pm Installing E:\Perl\site\lib\Apache\Util.pm Installing E:\Perl\site\lib\Apache\Constants\Exports.pm Writing E:\Perl\site\lib\auto\mod_perl\.packlist Successfully installed mod_perl version 1.27_01-dev in ActivePerl 5.6. +1.633. ppm:ActivePerl :*>

        I'm *now* searching for a mod_perl.dll, but not finding one, so where should I look? (Used windows search for file...)



        My code doesn't have bugs, it just develops random features.

        Flame ~ Lead Programmer: GMS | GMS