[Xapian-discuss] How to wrap omega cgi in a script

- Tong - mlist4suntong at yahoo.com
Wed Jun 20 20:47:20 BST 2007


Hi, 

What is the proper way to wrap omega in a cgi shell script? The reason that
I need to wrap it up is that sourceforge.net does not allows binary
executable cgi programs [1].

Here is how I'm doing:

 /home/groups/x/xp/xpt/cgi-bin$ ls -gGl search omega
 lrwxrwxrwx  1 22 06-20 11:59 omega -> ../lib/omega/bin/omega
 -rwxr-xr-x  1 21 06-20 12:27 search

 $ cat search
 #!/bin/sh
 omega "$@"

Everything is fine testing on commnand line[2], but when using the cgi
shell script from the web, I got:

http://xpt.sourceforge.net/cgi-bin/search?P=test&DEFAULTOP=or&DB=default&FMT=query&xDB=default&xFILTERS=--O

 An error has been encountered in accessing this page.

 1. Server: xpt.sourceforge.net
 2. URL path: /cgi-bin/search
 3. Error notes: Premature end of script headers: /home/groups/x/xp/xpt/cgi-bin/search
 4. Error type: 500
 5. Request method: GET
 6. Request query string: P=test&DEFAULTOP=or&DB=default&FMT=query&xDB=default&xFILTERS=--O

FYI, I'm the one who posted here quite a while ago asking if it is possible
to install xapian/omega on sourceforge.net so that every hosted project
can use it., and set force on the pilot work since. It has not been easy
for me, but as you can see in [2], I've made it to this last step.

Please help. 

thanks a lot. 

[1]

  $ lynx -dump http://xpt.sourceforge.net/cgi-bin/omega
                                  Forbidden

   You don't have permission to access /cgi-bin/omega on this server.

[2]

 $ REQUEST_METHOD=GET QUERY_STRING='P=test&DEFAULTOP=or&DB=default&FMT=query&xDB=default&xFILTERS=--O' search
 Content-Type: text/html

 <html>

 [...]
   1-10 of exactly 18 matches

 <hr>
 </center>
 Term frequencies: <b>test</b>:&nbsp;18
 <br><small>Search took 0.003525 seconds</small>
 <table>
 <TR><TD VALIGN=top><IMG
 SRC="/icons/omega/score-9.png"
 ALT="99%" HEIGHT=16 WIDTH=32></TD>
 [...]



-- 
Tong (remove underscore(s) to reply)
  http://xpt.sf.net/techdocs/
  http://xpt.sf.net/tools/




More information about the Xapian-discuss mailing list