On Wed, 18 Sep 2002, brian pikkaart wrote:
> Hello,
>
> We are researching aspseek as a replacement for what we're currently using
> and finding that it does just about everything we need. Very nice! We
> are wanting to run aspseek with many different virtual hosts all on the
> same servers. Ideally we'd have:
>
> * each virtual host share the same s.cgi,
> * each virtual host using their own search templates (i.e. s.htm),
> and in some cases multiple templates, and
> * the templates being stored in the document root for each virtual
> host.
>
> Based on the message here
> [http://www.mail-archive.com/[email protected]/msg01385.html]
> it looks like the tmpl functionality is deprecated. That being the case,
> has anyone found a good way to specify multiple templates within the same
> virtual host without having to use multiple s.cgi binaries or tweaking
> apache configuration for each addition?
>
> Or, is there a different way to do this that we're not thinking of?
> Right now we're using apache rewrites to set the ASPSEEK_TEMPLATE
> environment variable based on information passed in to s.cgi. However, it
> appears that stops working for things in the navigator section (i.e. prev,
> next links) of the template, as we can't figure out a variable that allows
> us to continue using the same template that was used for the original
> search.
>
> Has anyone encountered something similar? If so, what did you do to get
> things working the way you wanted?
Yes, in Apache you can use config such as this:
AddHandler aspseek-cgi .aseek <- or whatever other suffix you want
Action aspseek-cgi /cgi-bin/s.cgi
Now, any document suffixed with .aseek (which would be an ASPseek template) in
your document root directory would be handed off internally to s.cgi e.g. take
s.htm and place it in your doc root with a name such as s.aseek, customise it,
then call it via http://server.name/s.aseek ... presto.
One caveat emptor here is that this functionality (which was introduced in
version 1.2.8) is broken in versions 1.2.9 and 1.2.10 but is fixed in current
CVS so will work again when 1.2.11 is released.
I've also attached the small patch which fixes this.
Matt.
Index: aspseek/src/sc.c
diff -u aspseek/src/sc.c:1.12 aspseek/src/sc.c:1.13
--- aspseek/src/sc.c:1.12 Wed Jul 3 00:47:24 2002
+++ aspseek/src/sc.c Sun Sep 15 19:42:38 2002
@@ -251,6 +251,11 @@
{
safe_strcpy(templ, env);
}
+ /* also check Apache internal redirect via "AddHandler" and "Action" */
+ else if (getenv("REDIRECT_STATUS") && (env = getenv("PATH_TRANSLATED")))
+ {
+ safe_strcpy(templ, env);
+ }
/* Try to determine script name */
get_script();