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

Re: Question about Files directive

Expand Messages
  • Carl Johnstone
    CCing it back onto the list... ... Now if I do not want all to specify all cgi scripts (*.cgi) to be handled by the handler precisely to avoid pitfalls and
    Message 1 of 16 , Mar 2, 2005
    • 0 Attachment
      CCing it back onto the list...

      >>>>>
      Now if I do not want all to specify
      all cgi scripts (*.cgi) to be handled by the handler
      precisely to avoid pitfalls and only specify
      some files to be used, then how do I do
      that via the Files directive.
      <<<<<

      There's a couple of different approaches.

      The first you posted - list them individually. Alternatively the Files
      directive will take a regular expression. The apache docs are here for v1.3
      http://httpd.apache.org/docs/mod/core.html#files

      Another way if all your cgi scripts are in a single cgi-bin or similar is to
      setup different aliases. Then you can access the same scripts as straight
      CGI, Apache::Registry, or Apache::PerlRun. I'll assume your cgi-bin is
      already setup - here's the rest of the config.

      Alias /perl/ /path/to/cgi-bin/
      PerlModule Apache::Registry
      <Location /perl>
      SetHander perl-script
      PerlHandler Apache::Registry
      Options ExecCGI
      allow from all
      PerlSendHeader On
      </Location>

      Alias /perl-cgi/ /path/to/cgi-bin/
      PerlModule Apache::PerlRun
      <Location /perl-cgi>
      SetHander perl-script
      PerlHandler Apache::PerlRun
      Options ExecCGI
      allow from all
      PerlSendHeader On
      </Location>


      Then you can try running your script through Apache::Registry with
      http://www.mydomain.com/perl/myscript.cgi if that doesn't work then
      http://www.mydomain.com/perl-cgi/myscript.cgi for Apache::PerlRun. Failing
      any of those revert back to CGI with
      http://www.mydomain.com/cgi-bin/myscipt.cgi.


      Carl
    • Stas Bekman
      ... Chuck, use Apache::Reload and you won t have to restart the server. http://modperlbook.org/html/ch06_08.html --
      Message 2 of 16 , Mar 2, 2005
      • 0 Attachment
        Goehring, Chuck, RCI - San Diego wrote:
        >
        > Well, when I use cgis that run under Registry, if I modify a pm file,
        > I have to restart the web server before I see changes.

        Chuck, use Apache::Reload and you won't have to restart the server.
        http://modperlbook.org/html/ch06_08.html

        --
        __________________________________________________________________
        Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
        http://stason.org/ mod_perl Guide ---> http://perl.apache.org
        mailto:stas@... http://use.perl.org http://apacheweek.com
        http://modperlbook.org http://apache.org http://ticketmaster.com
      • Goehring, Chuck, RCI - San Diego
        Thanks, you always have the answer. ... From: Stas Bekman [mailto:stas@stason.org] Sent: Wed 3/2/2005 3:53 PM To: Goehring, Chuck, RCI - San Diego Cc: Perrin
        Message 3 of 16 , Mar 2, 2005
        • 0 Attachment
          Thanks, you always have the answer.


          -----Original Message-----
          From: Stas Bekman [mailto:stas@...]
          Sent: Wed 3/2/2005 3:53 PM
          To: Goehring, Chuck, RCI - San Diego
          Cc: Perrin Harkins; modperl@...
          Subject: Re: Question about Files directive



          Goehring, Chuck, RCI - San Diego wrote:
          >
          > Well, when I use cgis that run under Registry, if I modify a pm file,
          > I have to restart the web server before I see changes.

          Chuck, use Apache::Reload and you won't have to restart the server.
          http://modperlbook.org/html/ch06_08.html

          --
          __________________________________________________________________
          Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
          http://stason.org/ mod_perl Guide ---> http://perl.apache.org
          mailto:stas@... http://use.perl.org http://apacheweek.com
          http://modperlbook.org http://apache.org http://ticketmaster.com
        • Carl Johnstone
          ... Although on a production server that s dealing with many thousands of requests, that could be an awful lot of checks to see if modules have been updated.
          Message 4 of 16 , Mar 2, 2005
          • 0 Attachment
            > Chuck, use Apache::Reload and you won't have to restart the server.
            > http://modperlbook.org/html/ch06_08.html


            Although on a production server that's dealing with many thousands of
            requests, that could be an awful lot of checks to see if modules have been
            updated. Personally I prefer a bit of shell scripting on a cron:

            #!/bin/sh

            if [ -n "`find /path/to/my/modules -prune -newer /path/to/apache.pid`" ];
            then
            echo "apache needs reloading"
            echo "Testing"
            apachectl configtest
            if [ $? = 0 ] ; then
            echo "Restarting"
            apachectl restart
            else
            echo "ERROR in apache config"
            fi
            fi



            --
            Carl
          Your message has been successfully submitted and would be delivered to recipients shortly.