According to Sigfus Oddsson:
> My site is running on a box with multiple virtual hosts. There is one
> central ht://Dig installation for all of them so in order for my site to
> use that installation I must provide my own config files, which is easy
> using the -c option. However, problems arise when using a wrapper script
> to point the htsearch CGI binary to these same config files.
>
> Element 4.20 of the FAQ mentions changing the CONFIG_DIR variable, which
> is probably what I want. I have set up a script with +x permissions and
> a .htaccess file in the directory containing the shell script. The
> following is the script:
>
> -- htsearch.cgi (2 lines) --
> #!/bin/sh
> CONFIG_DIR=/home/myhome/htdig/conf /opt/www/cgi-bin/htsearch ${@+"$@"}
> ---
>
> Also, the .htaccess file for Apache:
>
> -- .htaccess (1 line) --
> AddType application/x-httpd-cgi .cgi
> ---
You might want to add the following to .htaccess as well:
AddHandler cgi-script .cgi
At one point, that was needed. I don't know if it still is with current
Apache versions.
> The htsearch binary runs fine, I'm sure of that. But changing the
> CONFIG_DIR env variable seems to have no effect. I've tried running the
> htsearch.cgi both through the webserver and locally and in both cases it
> simply says 'Unable to read word database file. Did you run htmerge?'
> This message appears regardless of wether the config file even exists.
> However, using -c with htsearch works fine so I know that everything is
> working perfectly, except for the fact that it isn't reading CONFIG_DIR
> env variable.
>
> Can someone please help me or supply me with a better shell wrapper script?
There's nothing wrong with the wrapper script that I can see, as
long as /home/myhome/htdig/conf is indeed the directory that your
config files are in. But, how are you specifying the "config" input
parameter to htsearch.cgi? A quirk with the CONFIG_DIR environment
handling is that if you specify a config file that's not there, it
doesn't default to htdig.conf in that CONFIG_DIR, but rather to the
compiled-in DEFAULT_CONFIG_FILE, which is usually set to htdig.conf in
the compiled-in value of CONFIG_DIR (but not necessarily so).
You should test htsearch.cgi from the command line as follows:
/path/to/my/htsearch.cgi words=foo\;config=htdig
(or use whatever config name you want in place of "htdig" above, as long
as it exists as a .conf file in /home/myhome/htdig/conf). If that works,
it should work from the web server too, as long as you correctly specify
the config input parameter in your search form.
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/
Dept. Physiology, U. of Manitoba Winnipeg, MB R3E 3J7 (Canada)
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html