Internet search engine

Michael McLay (mclay@eeel.nist.gov)
Mon, 27 Mar 95 09:54:57 EST

Matthew Jones writes:
> Hi All,
>
> Has anyone used the python binding to cgi and Dbhash to implement an
> Internet search engine?
>
> I've written a script that uses the Dbhash library to search a small
> database, this works fine. I now want to put a HTML front end on the
> database for access via the WWW. I've tried using the cgi interface to
> do this but it doesn't work. I can write cgi scripts that generate
> HTML on the fly but the call to the Dbhash library seems to interfere
> with this process. The script returns all the generated HTML up to the
> following line:
>
> db = Dbhash("test_dbhash", 'r', 0600,1024,32)
>
> none of the generated HTML is returned after this point. If I run the
> script at the shell promt it works and the generated HTML is legal.
>
> Does anyone know what's happening?

The NCSA httpd executes cgi script as user 'nobody'. (I think you can
also assign the user name to use in the configuration script.) The
httpd user may not have permission to access the 'test_dbhash' file.
Change the mode on the file to global rw and see if that fixes the
problem. If this fixes the problem then you can try setting file
ownership and groups to make the file accessible to the httpd deamon.
Also, you might want to use the full path name for the 'test_dbhash'
file since the httdp program is probably being run from an rc script
at startup time. The cgi script may not be executing in the directory
in which the database is found. Try having the cgi script print out
the working directory.

Michael