Skip to main content.
home | support | download

Back to List Archive

Compile or Search problem?

From: Peter Ensch <pensch(at)>
Date: Fri Jan 16 2004 - 15:10:13 GMT
I'm just starting to use swish-e. I compiled successfully
and have indexed my site. I updated swish.cgi to provide
a search front-end but find that though it always works 
on the cmd. line, swish returns nothing when running thru'
my webserver. I can move the cgi script and index files to
another server and it works as expected. 

If I simply ask swish to output it's version number, it
works all the time.

I'm stumped. Can anyone help? I've included all the details
and a stripped-down (working) code sample below.


Swish-e version: 2.4.1
Compiled on: SunOS 5.8 Generic_108528-18 sun4u sparc SUNW,Ultra-5_10 
Perl version: 5.8.0

use strict;
use warnings;

print "Content-Type: text/html;\n\n";

sub forking {
  my @args = ("-w", "floorplan"); # args #1
#  my @args = ("-V");             # args #2
  my $pid = open(OUT, '-|');
  die "Failed to fork: $!\n" unless defined $pid;
  if($pid) {
    print "$_<br>" while <OUT>;
  } else {
    unless (exec "/home/pensch/swish-e/bin/swish-e", @args) {
      print "Failed to exec Swish";

The test index files are in the same directory as the CGI
script. For testing, the one file indexed is test.cgi.

When run on the cmd.line (on either machine), output is:

[143] % ./test.cgi
Content-Type: text/html;

# SWISH format: 2.4.1
<br># Search words: 'floorplan'
<br># Removed stopwords:
<br># Number of hits: 1
<br># Search time: 0.001 seconds
<br># Run time: 0.036 seconds
<br>1000 test.cgi "test.cgi" 493

Here's the problem. When run via the webserver, results are not the same 
on the 2 servers although the test script and indexes are identical.

Server1: SunOS 5.8 Generic_108528-16 sun4u sparc SUNW,UltraAX-i2
         Netscape-Enterprise v3.6
         Only the HTTP header is output (and no error messages).

Server2: SunOS 5.8 Generic_108528-18 sun4u sparc SUNW,Ultra-2
         Apache v2.0.47
         Output is as expected (same as cmd.line). 

If I comment out args line #1 and replace with args line #2,
both servers output 'SWISH-E 2.4.1' as expected. This leads me
to think that the compile was OK. But what else could it be???


Peter Ensch,           A-1140   (214) 480 2333
Received on Fri Jan 16 15:17:10 2004