Loading ...
Sorry, an error occurred while loading the content.

I see only the text of the script rather than whatever the script is supposed to produce

Expand Messages
  • Ted Byers
    I am sure this is a FAQ, but the solution presented in the FAQ I found there doesn t quite work. I am using the Windows binary distribution that has ssl,
    Message 1 of 4 , Dec 23, 2003
    • 0 Attachment
      I am sure this is a FAQ, but the solution presented in the FAQ I found there
      doesn't quite work.

      I am using the Windows binary distribution that has ssl, mod_perl,
      Apache::ASP, Embperl, HTML::Mason, Template::Toolkit, and PHP. I am not
      much interested in EmbPerl yet, but in the new year I'll be taking a look at
      HTML::Masoc and Template::Toolkit.

      SSL and PHP are working, but I am having problems with ASP and Perl.

      I have Mozilla pointed to localhost on starup. I copied graph.pl and
      input.data to htdocs, and if I point Mozilla at it, I see a web page
      apparently produced by it, but not the graph itself.

      I copied the ASP/eg to an eg directory in htdocs, and again, pointing at the
      index.html file in it displays only the text of a script.

      Here are the last few lines of httpd.conf (immediately after my virtual
      hosts defined to get SSL working):

      Alias /perl/ "I:/PerlAndApache/Apache2/PerlScripts/"

      PerlModule Apache::Registry
      <Location /perl>
      SetHandler perl-script
      PerlHandler Apache::Registry
      Options +ExecCGI
      PerlSendHeader On
      allow from all
      </Location>

      <Location /perl-status>
      SetHandler perl-script
      PerlHandler Apache::Status
      Options +ExecCGI
      PerlSendHeader On
      allow from all
      </Location>

      <Directory $DOCUMENT_ROOT/eg >
      SetHandler perl-script
      PerlHandler Apache::Registry
      Options +ExecCGI
      PerlSendHeader On
      allow from all Options FollowSymLinks
      AllowOverride All
      </Directory>

      However, if I point Mozilla at localhost/perl-status, I see the text I
      expected to see.

      I must have missed something, but I am having trouble determining what.
      And, does the settings provided for eg make all files there pass through
      perl or only those with the 'pl' extension. If the former, how would I
      configure perl to process only files with the 'pl' extension (and ASP - if
      that is the way ASP is supposed to work) and treat the rest as ordinary
      HTML.

      Now, I have what I think is a related problem, and that is, my preference is
      to keep my cgi scripts, regardless of whether they're PHP, Perl ASP, or
      whatever, outside of the htdocs directory tree (i.e., I have a PerlScripts
      directory in Apache2, which also has htdocs in it, and if I have in htdocs a
      subdirectory called MyProject, any Perl scripts it needs would be in
      PerlScripts/MyProject - so the directory tree in the latter would mirror
      that in MyProject in htdocs). At the same time, I am working on a couple
      projects where my colleagues have not kept the scripts separate from the
      documents. Is there a way I can accomodate both kinds of setup? I want my
      preferences to prevail whenever I am working on my own projects but their's
      when I am working on their projects. Can this be done without too much
      pain? If so, how?

      My colleague suggested I use MS' IIS, but when I saw the Apache distribution
      I installed has ASP support, I decided to try to get it working first.

      I don't know if this has anything to do with my problem, but when I first
      tried to configure Apache for Perl, having added the perl location in
      httpd.conf, Apache refused to start complaining that the file
      Apache/Registry.pm could not be found. I found one in the modperl
      subdirectory in Perl/site/lib/modperl that seemed to make sense, and so I
      copied that to the directory Perl/site/lib/Apache, and this initial error
      went away and Apache again started.

      Any help would be appreciated.

      Thanks,

      Ted



      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Randy Kobes
      ... Assuming this is the Perl/Apache binary distribution from http://perl.apache.org/, and just to verify that that the installation and configuration went OK,
      Message 2 of 4 , Dec 23, 2003
      • 0 Attachment
        On Tue, 23 Dec 2003, Ted Byers wrote:

        > I am sure this is a FAQ, but the solution presented in the
        > FAQ I found there doesn't quite work.
        >
        > I am using the Windows binary distribution that has ssl,
        > mod_perl, Apache::ASP, Embperl, HTML::Mason,
        > Template::Toolkit, and PHP. I am not much interested in
        > EmbPerl yet, but in the new year I'll be taking a look at
        > HTML::Masoc and Template::Toolkit.
        >
        > SSL and PHP are working, but I am having problems with ASP
        > and Perl.

        Assuming this is the Perl/Apache binary distribution from
        http://perl.apache.org/, and just to verify that that the
        installation and configuration went OK, do the sample
        mod_perl registry, hello-world handler, and Apache::ASP
        scripts work OK? The settings are found in the installed
        original Apache configuration files.

        > I have Mozilla pointed to localhost on starup. I copied graph.pl and
        > input.data to htdocs, and if I point Mozilla at it, I see a web page
        > apparently produced by it, but not the graph itself.
        >
        > I copied the ASP/eg to an eg directory in htdocs, and again, pointing at the
        > index.html file in it displays only the text of a script.
        >
        > Here are the last few lines of httpd.conf (immediately after my virtual
        > hosts defined to get SSL working):
        >
        > Alias /perl/ "I:/PerlAndApache/Apache2/PerlScripts/"
        >
        > PerlModule Apache::Registry
        > <Location /perl>
        > SetHandler perl-script
        > PerlHandler Apache::Registry
        > Options +ExecCGI
        > PerlSendHeader On
        > allow from all
        > </Location>
        [ .. ]

        Is this the perl-5.8/Apache-2 distribution, or the
        perl-5.6/Apache-1? If it's for Apache-2, then
        Apache::Registry has been replace by ModPerl::Registry.

        [ .. ]
        > I don't know if this has anything to do with my problem, but when I first
        > tried to configure Apache for Perl, having added the perl location in
        > httpd.conf, Apache refused to start complaining that the file
        > Apache/Registry.pm could not be found. I found one in the modperl
        > subdirectory in Perl/site/lib/modperl that seemed to make sense, and so I
        > copied that to the directory Perl/site/lib/Apache, and this initial error
        > went away and Apache again started.

        You shouldn't have to move files around like that, and
        actually, probably shouldn't, as other things may rely on
        them. Try moving it back, and if this is for Apache-2, use
        ModPerl::Registry, rather than Apache::Registry. You may
        also have to "use" the Apache2 module, either in a startup
        script or with a PerlModule directive, in order to adjust
        @INC to be able to find some things.

        --
        best regards,
        randy kobes

        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Ted Byers
        Hi Randy, Thanks. This is the perl-5.8/Apache-2 distribution. I will therefore change to: PerlModule ModPerl::Registry
        Message 3 of 4 , Dec 23, 2003
        • 0 Attachment
          Hi Randy,

          Thanks.

          This is the perl-5.8/Apache-2 distribution.

          I will therefore change "<Location /perl>" to:
          PerlModule ModPerl::Registry
          <Location /perl>
          SetHandler perl-script
          PerlHandler ModPerl::Registry
          Options +ExecCGI
          PerlSendHeader On
          allow from all
          </Location>

          I had used "Apache::Registry" because that is what I saw in the
          documentation, so someone probably wants to ensure that the documentation is
          updated WRT this.

          The "the sample mod_perl registry, hello-world handler, and Apache::ASP"
          don't work. When I try to go to them, I get an error message saying they
          can't be found (though the registy handler gives a configuration error
          instead). But, I am puzzled as to why http://localhost/perl-status works
          (or seems to).

          I wonder if the problem might lie in the following:

          <IfModule mod_perl.c>
          Include conf/perl.conf
          </IfModule>

          I start Apache using "Apache2\bin\apache -DSSL -k start", and I am wondering
          if the reason it isn't working is that Apache isn't processing perl.conf
          when it is started. If this is true, how would I change the command I use
          to start Apache (or can I safely get rid of the IfModule lines above and
          below it).

          I also wonder if the "AddLanguage pl .po" might be causing some problems
          (and if so, can I safely remove it).

          Thanks again,

          Ted

          -----Original Message-----
          From: Randy Kobes [mailto:randy@...]
          Sent: December 23, 2003 2:52 PM
          To: Ted Byers
          Cc: asp@...
          Subject: Re: I see only the text of the script rather than whatever the
          script is supposed to produce


          On Tue, 23 Dec 2003, Ted Byers wrote:

          > I am sure this is a FAQ, but the solution presented in the
          > FAQ I found there doesn't quite work.
          >
          > I am using the Windows binary distribution that has ssl,
          > mod_perl, Apache::ASP, Embperl, HTML::Mason,
          > Template::Toolkit, and PHP. I am not much interested in
          > EmbPerl yet, but in the new year I'll be taking a look at
          > HTML::Masoc and Template::Toolkit.
          >
          > SSL and PHP are working, but I am having problems with ASP
          > and Perl.

          Assuming this is the Perl/Apache binary distribution from
          http://perl.apache.org/, and just to verify that that the
          installation and configuration went OK, do the sample
          mod_perl registry, hello-world handler, and Apache::ASP
          scripts work OK? The settings are found in the installed
          original Apache configuration files.

          > I have Mozilla pointed to localhost on starup. I copied graph.pl and
          > input.data to htdocs, and if I point Mozilla at it, I see a web page
          > apparently produced by it, but not the graph itself.
          >
          > I copied the ASP/eg to an eg directory in htdocs, and again, pointing at
          the
          > index.html file in it displays only the text of a script.
          >
          > Here are the last few lines of httpd.conf (immediately after my virtual
          > hosts defined to get SSL working):
          >
          > Alias /perl/ "I:/PerlAndApache/Apache2/PerlScripts/"
          >
          > PerlModule Apache::Registry
          > <Location /perl>
          > SetHandler perl-script
          > PerlHandler Apache::Registry
          > Options +ExecCGI
          > PerlSendHeader On
          > allow from all
          > </Location>
          [ .. ]

          Is this the perl-5.8/Apache-2 distribution, or the
          perl-5.6/Apache-1? If it's for Apache-2, then
          Apache::Registry has been replace by ModPerl::Registry.

          [ .. ]
          > I don't know if this has anything to do with my problem, but when I first
          > tried to configure Apache for Perl, having added the perl location in
          > httpd.conf, Apache refused to start complaining that the file
          > Apache/Registry.pm could not be found. I found one in the modperl
          > subdirectory in Perl/site/lib/modperl that seemed to make sense, and so I
          > copied that to the directory Perl/site/lib/Apache, and this initial error
          > went away and Apache again started.

          You shouldn't have to move files around like that, and
          actually, probably shouldn't, as other things may rely on
          them. Try moving it back, and if this is for Apache-2, use
          ModPerl::Registry, rather than Apache::Registry. You may
          also have to "use" the Apache2 module, either in a startup
          script or with a PerlModule directive, in order to adjust
          @INC to be able to find some things.

          --
          best regards,
          randy kobes



          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        • Randy Kobes
          ... This was probably from a mod_perl 1 document - for Apache 2, you want mod_perl 2 (http://perl.apache.org/ has separate mod_perl 1 and 2 sections, including
          Message 4 of 4 , Dec 23, 2003
          • 0 Attachment
            On Tue, 23 Dec 2003, Ted Byers wrote:

            > Hi Randy,
            >
            > Thanks.
            >
            > This is the perl-5.8/Apache-2 distribution.
            >
            > I will therefore change "<Location /perl>" to:
            > PerlModule ModPerl::Registry
            > <Location /perl>
            > SetHandler perl-script
            > PerlHandler ModPerl::Registry
            > Options +ExecCGI
            > PerlSendHeader On
            > allow from all
            > </Location>
            >
            > I had used "Apache::Registry" because that is what I saw in the
            > documentation, so someone probably wants to ensure that the documentation is
            > updated WRT this.

            This was probably from a mod_perl 1 document - for Apache 2,
            you want mod_perl 2 (http://perl.apache.org/ has separate
            mod_perl 1 and 2 sections, including some Win32 specific
            information).

            > The "the sample mod_perl registry, hello-world handler,
            > and Apache::ASP" don't work. When I try to go to them, I
            > get an error message saying they can't be found (though
            > the registy handler gives a configuration error instead).
            > But, I am puzzled as to why http://localhost/perl-status
            > works (or seems to).
            >
            > I wonder if the problem might lie in the following:
            >
            > <IfModule mod_perl.c>
            > Include conf/perl.conf
            > </IfModule>
            >
            > I start Apache using "Apache2\bin\apache -DSSL -k start",
            > and I am wondering if the reason it isn't working is that
            > Apache isn't processing perl.conf when it is started. If
            > this is true, how would I change the command I use to
            > start Apache (or can I safely get rid of the IfModule
            > lines above and below it).

            This is probably a bit off-topic for the asp list. What I'd
            suggest is, starting from the original configuration files
            that came with the distribution, trying to start things up
            (which should pull in conf/perl.conf, as mod_perl is enabled
            by default), and then try the sample ModPerl::Registry and
            Apache::ASP pages. If these don't work, send me (privately)
            what happens for each, and also what is recorded in
            Apache2's logs/error.log. Thanks.

            --
            best regards,
            randy

            ---------------------------------------------------------------------
            To unsubscribe, e-mail: asp-unsubscribe@...
            For additional commands, e-mail: asp-help@...
          Your message has been successfully submitted and would be delivered to recipients shortly.