Skip to main content.
home | support | download

Back to List Archive

Configuring Swish-E on Windows IIS

From: Smith, Sarah <sarah.smith(at)>
Date: Wed Oct 20 2004 - 15:43:54 GMT
After much eyebrow scrunching, I finally got swish-e going and wanted to
share some tips I didn't see anywhere else.

After you install using a binary distribution, you need to run the file
"" (located in the top level of the SWISH-E folder) to change
all of those @@...@@ things and set other file locations in the .cgi and
pl files.

Caveat: If Swish-E is not going to be run from your local machine, the
location of Perl and the drive letters set by the above "" may
be wrong. For example, my machine thinks the website is on drive I: and
Perl is on drive C: (my machine's hard drive). But Swish-E will not be
running from my machine, so I had to change the I: drive letters to C:
(the machine it's running on, NOT my hard drive) and change the shebang
line to reflect where Perl is on the other machine (which is NOT where
it is on my machine). 

As of the current binary distribution, 2.4.2, the modules are not
getting put in the right directory. Despite what has been said in some
other posts, you will have to add the line
use lib 'C:/Program Files/SWISH-E/share/doc/swish-e/example/modules/';
to the top of swish.cgi so the beginning of the file will be:

#!C:\Program Files\Perl\bin\perl.exe -w
package SwishSearch;
use strict;

# This is set to where Swish-e's "make install" installed the helper
use lib qw( C:\Program Files\SWISH-E\lib\swish-e\perl ); 
use lib 'C:/Program Files/SWISH-E/share/doc/swish-e/example/modules/';

I had to use absolute paths (i.e., with the drive letter) on everything
EXCEPT in my swish.conf file, which for some reason would not work with
a drive letter. So instead of IndexFiles C:/myweb/docs I had to use
IndexFiles /myweb/docs

One last thing that really helped me out was adding some error checking
lines to the top of swish.cgi so I actually got feedback when there were
500 errors or my search form kept getting zero results. (I don't have
access to error logs.) The lines are:
$| = 1;
print "Content-Type: text/plain\n\n";
To add them, the  beginning of your file should look like:

#!C:\Program Files\Perl\bin\perl.exe -w
package SwishSearch;
use strict;
$| = 1;
print "Content-Type: text/plain\n\n";

Hope that helps someone!
Received on Wed Oct 20 08:43:55 2004