Skip to main content.
home | support | download

Back to List Archive

Re: Swish.cgi location?

From: Bill Moseley <moseley(at)>
Date: Thu Apr 15 2004 - 00:16:19 GMT
On Wed, Apr 14, 2004 at 02:49:18PM -0700, Phil Matt wrote:
> To update this problem:
> I had a look at the Apache config file - no apparent aliasing problems there.
> What was incorrect, in the swish.cgi-generated form, was that the line that starts:
>  <form method="get" action="/swish.cgi" 
> needed to be changed to  <form method="get" action="/cgi-bin/swish.cgi

But, but, but...

Which templating output system are you using?  The default one?

It does:

<form method="get" action="$form" enctype="application/x-www-form-urlencoded" class="form"> 

and $form is $q->script_name which gets as $ENV{SCRIPT_NAME} --
and apache sets that for each request.

If you are using the Template Toolkit template then it does:

   [% CGI.start_form( '-action' => CGI.script_name, '-method' => 'GET' ) %]

And, as you can see, that's calling the's script_name()
function directly to set the action, just like above.  The point is,
Apache is running the script in the first place, so it knows the URL of
the path.

So, unless you run the script from document root, I can't think of
anyway it set the action to /swish.cgi.

> Related question:
> It appears that the module is run from
> /usr/local/lib/swish-e/perl/SWISH/
> rather than from the install directory, /usr/local/lib/swish-e/perl/

I'm not sure I understand the question.  

There was a broken version that installed some modules to the wrong
location, but that was fixed a while back.  Are you saying was installed in /usr/local/lib/swish-e/perl/?
If so, please let me know exactly what version of swish-e you installed.

But, yes, is suppose to be installed in 


But the "use lib" line is also suppose to be:

   use lib '$PREFIX/lib/swish-e/perl';

without the "SWISH" part because the module's name is:


When the script loads that module is combines the two paths:

   $PREFIX/lib/swish-e/perl + SWISH::TemplateDefault

to come up with:


Bill Moseley
Received on Wed Apr 14 17:16:20 2004