Re: SSI

Alexander Barkov <[email protected]>
Newsgroups gmane.comp.web.mnogosearch.general
Message-ID <[email protected]>
Hi Zenon,


On 01/21/2011 05:50 AM, Zenon Panoussis wrote:
>
> Hello all
>
> I'm having trouble using SSI as per
> http://www.mnogosearch.org/doc33/msearch-doingsearch.html#search-scriptname
> and I would welcome some help.
>
> (BTW, the include example on that page has a typo. It says
> <--#include virtual="search.cgi">, but it should be
> <--#include virtual="search.cgi"-->  with two dashes also at the closing end.
> Typical thing that people will copy/paste without noticing, just like I did).

Thanks for noticing this. You're right, there should be dashes in the
end, but also there should be the '!' mark in the beginning.
So the correct line is:

<!--#include virtual="..."-->


I've fixed in the manual.

>
> Anyway, my httpd.conf says:F
>
>    ScriptAlias /cgi-bin/ /var/www/example.com/cgi-bin/
>    SetEnv UDMSEARCH_SELF /var/www/example.com/htdocs/index.html
>    PassEnv UDMSEARCH_SELF
>    SetEnv UDMSEARCH_TEMPLATE /etc/mnogosearch/search.htm
>
> <Directory /var/www/example.com/htdocs>
>      Options +Includes
>      XBitHack on
> </Directory>
>
> The html page contains, well, a pile of html, and at the bottom of it
>
>    <--#include virtual="search.cgi"-->
>
> The template search.htm doesn't contain any<html>,<head>,<body>  opening tags,
> nor any general "decorative" html, because these are already in the including
> page. It starts with the section
>
> <!--variables
> ...
> -->
>
> and then goes straight to
>
> <!--top-->
> <!IF name="form" CONTENT="extended">
> <form method="get" action="">
>
> The result is that the search page is rendered properly, but searching only
> returns that very same initial empty search page, instead of producing a page
> of results.
>
> Assuming that<form action= should be set to something other than empty "",
> I tried<form action="/index.html">  and<form action="$(Self)">. Neither works.
> Using<form action=/cgi-bin/search.cgi">  produces raw results, obviously without
> the formatting of index.html, but it proves that search itself works, that the
> problem is in the SSI setup.
>
> The problem makes sense to me. Every http operation is a simple one-shot
> request-and-reply sequence, so if my SSI statement says #include virtual="search.cgi",
> that's exactly what I'll get every time that the including page is loaded: the
> output of search.cgi without any arguments. In order to get results, I think,
> the SSI include statement should contain the query, like
> <#include virtual="search.cgi?q=$&(q)&cmd=Search!>. But that's not possible, it
> defies the whole idea of an SSI include in an otherwise static page.
>
> So I wonder, has anyone gotten this to work? Can anyone see what I'm doing wrong?


I reproduced the same problem.

After some investigation, I found that SSI does not pass the original 
QUERY_STRING when executing the CGI script given in the
"#include virtual" directive, empty QUERY_STRING is passed.
IIRC, in earlier Apache version the original query string was passed 
rather than empty query string.


This workaround helped me:

<!--#include virtual="/cgi-bin/search.cgi?${QUERY_STRING}"-->

Can you please check if it helps you?

Thanks!

>
> Cheers,
>
> Z
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.