Skip to main content.
home | support | download

Back to List Archive

[swish-e] swish.cgi under mod_perl

From: <douglas.fox(at)not-real.utoronto.ca>
Date: Wed Mar 14 2007 - 23:25:05 GMT
Hello,
My problem is that swish.cgi works like a dream when run as a CGI program, but when I try 
to run it under an otherwise functional mod_perl, it simply dies. 

I'm using Swish-e version 2.4.5 on a Windows XP machine with all standard updates and 
patches. I'm planning on installing it on our production web server (Redhat / Apache) once 
I'm familiar with it.

I'm new to both Swish and mod_perl. The test setup is Apache/2.2.4 (Win32) with 
mod_perl/2.0.3 and Perl/v5.8.8. I have tested the mod_perl with a hello script and a hello 
module to make sure it is working -- no problem at all.

I'm really hoping someone can provide some ideas or has run across this issue before.

TIA

Doug Fox

FROM HTTPD.CONF:

#ADDED FOR MOD_PERL:
LoadFile "C:/Perl/bin/perl58.dll"
#
... other modules

#ADDED FOR MOD_PERL
LoadModule perl_module modules/mod_perl.so

.... further down ...

ScriptAlias /cgi-bin/ "C:/apache2/perl/" # for cgi access
Alias /search/ "C:/apache2/perl"         # for mod_perl access

</IfModule>

PerlRequire "C:/apache2/perl/start.pl" # see copy of this below

<Directory "C:/apache2/perl/">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

<Location /search>
PerlSetVar Swish_Conf_File 'C:\apache2\perl\swishcgi.conf'
allow from all
SetHandler perl-script
PerlHandler SwishSearch
</Location>


START.PL:

use ModPerl::Util ();
  use Apache2::RequestRec ();
  use Apache2::RequestIO ();
  use Apache2::RequestUtil ();
  use Apache2::ServerRec ();
  use Apache2::ServerUtil ();
  use Apache2::Connection ();
  use Apache2::Log ();
  use Apache2::Const -compile => ':common';
  use APR::Const -compile => ':common';
  use APR::Table ();
  use Apache2::compat ();
  use ModPerl::Registry ();
  use CGI ();

use lib 'C:/apache2/perl/';  # location of the swish.cgi file
use lib 'C:/SWISH-E/lib/swish-e/perl';  # modules required by swish.cgi
require 'C:/apache2/perl/swish.cgi';
1;

ERROR LOG:
[Wed Mar 14 18:20:05 2007] [notice] Apache/2.2.4 (Win32) mod_perl/2.0.3 Perl/v5.8.8 
configured -- resuming normal 
operations
[Wed Mar 14 18:20:05 2007] [notice] Server built: Jan  9 2007 23:17:20
[Wed Mar 14 18:20:05 2007] [notice] Parent: Created child process 3184
[Wed Mar 14 18:20:06 2007] [notice] Child 3184: Child process is running
[Wed Mar 14 18:20:06 2007] [notice] Child 3184: Acquired the start mutex.
[Wed Mar 14 18:20:06 2007] [notice] Child 3184: Starting 250 worker threads.
[Wed Mar 14 18:20:06 2007] [notice] Child 3184: Starting thread to listen on port 8080.

[Wed Mar 14 18:24:03 2007] [notice] Parent: child process exited with status 9 -- Restarting.
[Wed Mar 14 18:24:03 2007] [notice] Apache/2.2.4 (Win32) mod_perl/2.0.3 Perl/v5.8.8 
configured -- resuming normal 
operations
[Wed Mar 14 18:24:03 2007] [notice] Server built: Jan  9 2007 23:17:20
[Wed Mar 14 18:24:03 2007] [crit] (22)Invalid argument: Parent: Failed to create the child 
process.
[Wed Mar 14 18:24:03 2007] [crit] (OS 6)The handle is invalid.  : master_main: create child 
process failed. 
Exiting.
[Wed Mar 14 18:24:03 2007] [notice] Parent: Forcing termination of child process 36 

ACCESS LOG:
128.100.124.127 - - [14/Mar/2007:18:20:50 -0400] "GET /search HTTP/1.1" 200 1671
128.100.124.127 - - [14/Mar/2007:18:22:24 -0400] "GET /cgi-bin/swish.cgi HTTP/1.1" 200 
1590
128.100.124.127 - - [14/Mar/2007:18:23:19 -0400] "GET /cgi-bin/swish.cgi?query=taves 
&submit=Search%21&metaname=DC.Creator&sort=swishrank HTTP/1.1" 200 15542
128.100.124.127 - - [14/Mar/2007:18:23:55 -0400] "GET /search HTTP/1.1" 200 1671

BEGINNING OF SWISH.CGI
#!C:\Perl\bin\perl.exe -w
package SwishSearch;
use strict;

# This is set to where Swish-e's "make install" installed the helper modules.
use lib ( 'C:\SWISH-E\lib\swish-e\perl' );

my $DEFAULT_CONFIG_FILE = 'C:\apache2\perl\swishcgi.conf';


SWISHCGI.CONF
return {
title => 'Search Page',
swish_binary => 'C:\SWISH-E\bin\swish-e.exe',
swish_index => 'C:\SWISH-E\webindex\index.swish-e',
};


-- 
Douglas Fox
Systems Librarian
Victoria University Library
71 Queen's Park Crescent
Toronto, ON  Canada M5S 1K7
416-585-4552 Fax: 585-4591
douglas.fox@utoronto.ca

Happiness is like a cat. Try to hold onto it and it squirms away; 
ignore it, and it hops onto your lap.
--





_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Wed Mar 14 19:25:16 2007