PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

search.cgi Enable Compression Content-Encoding gzip

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • search.cgi Enable Compression Content-Encoding gzip

    Hi,
    1 ) I am using search.cgi in my site. Is there anyway to get a compressed result either gzip of deflate.

    What i mean to say, How to set the configuration to return
    Content-Encoding=gzip


    2) I have read in the forums that search.cgi is actually an exe. I have tried it by changing extension and it is. My question is: How can i pass arguments to the exe using command line ..
    My current url is /search.cgi?zoom_query=Engineering

    Can i do something like on command promot and get the result.
    search.exe zoom_query=Engineering

  • #2
    1) This is a web server configuration issue. For example, in Apache, you can configure via the .htaccess file to compress all text/html output from the /cgi-bin/ folder. Or the .cgi extension. Note that although it is a "search.cgi" file, the output from the CGI is ultimately in text/html.

    This specific example is given in the Apache documentation here:
    http://httpd.apache.org/docs/2.0/mod...utfilterbytype

    The configuration below causes all script output labeled as text/html to be processed at first by the INCLUDES filter and then by the DEFLATE filter.

    <Location /cgi-bin/>
    Options Includes
    AddOutputFilterByType INCLUDES;DEFLATE text/html
    </Location>
    Please refer to the Apache documentation for details.

    2) You have to pass the parameters via an environment variable named "QUERY_STRING" (as with ALL CGIs), not the command line. You can find examples of how to do this programmatically with PHP or ASP here:
    http://www.wrensoft.com/zoom/support...i.html#ssi_cgi
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Thanks for the quick reply. Regarding point no 2, I have checked the URL and tried it but I am unable to get complete result. Here is what i did

      PHP Code:
      <?php
      $REMADDR 
      $_SERVER['REMOTE_ADDR'];
      putenv('REQUEST_METHOD=GET');
      putenv('QUERY_STRING=Engineering');
      putenv('REMOTE_ADDR=$REMADDR');
      $output shell_exec('C:\\Inetpub\\wwwroot\\zoom\\search.cgi');
      $output ereg_replace('Content-type: text/html'''$output);
      echo 
      $output;
      ?>
      The result I am getting is this.

      HTML Code:
      ; charset=windows-1252
      
      <p></p>
      <!--Zoom Search Engine Version 6.0 (1014) ENT-->
      
      </p><p></p>
      Would you please tell what I am missing.
      Thanks in advance.

      Comment


      • #4
        putenv('QUERY_STRING=Engineering');
        You're misunderstanding the QUERY_STRING. This is a CGI parameter, not specific to Zoom. It is not a search query string, but rather a HTTP GET query.

        In other words, it has to be the actual parameters, e.g.

        QUERY_STRING=zoom_query=Engineering&zoom_per_page= 20

        The output implies that you have a mostly empty (except for a few <p> </p> tags) search_template.html file too.

        And you should probably change the ereg_replace line with this:

        Code:
        [FONT=Courier New][COLOR=#0000bb]$output [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]ereg_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'Content-type: text/html[COLOR=#000000]; [/COLOR][/COLOR][COLOR=red]charset=windows-1252'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$output[/COLOR][COLOR=#007700]); [/COLOR][/FONT]
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment

        Working...
        X