Search Machine for Ubuntu machine

Carl Friis-Hansen ubuntuuser at carl-fh.com
Fri Aug 29 02:18:45 UTC 2008


Ted Hilts - Thunderbird Acct. wrote:
>  I have Ubuntu 7.10 and would like to get an open source search engine 
> which I can use on this machine.  I would like to tell it what hard 
> drive and/or directory to search and tell it to search for a file and/or 
> contents of a file.  It would also be nice if it was written in perl or 
> java or java script or python or some other script or language but not 
> compiled.  Even a bash shell with bash commands. Also, I would like it 
> to be a server so clients from other machines (like XP) could access the 
> search  domain.  I suppose I could use a browser as client which gives 
> Apache a CGI script with the results back to the browser but I  am 
> hoping not to develop  this application but rather (at least initially) 
> to pick up a search application ready to go.

I could suggest a small PHP or perl script.

///// With PHP /////
Let the user fill in a form field.
Send the request, something like

shell_exec(
   "find /fromHere -type f -wholename '$someScope' etc...",
   $output );

print "Result:<br />$output<br />";
////////////////

If you have many files and is concerned about speed, then you might want 
to use locate instead of find.

PHP has a function to filter out malicious commands. You want to pass 
the user's search string through this before you use the search string 
in $someScope.

Your question is a bit off topic, so you might benefit from Google for 
Perl and PHP scripts out there in the big world.

-- 
       +---------------------------------+-------------------+
       | Carl Friis-Hansen               | Fiskeryd Nybygget |
       | http://computingconfidence.com/ | 341 91  Ljungby   |
       | Phone: +46 (0)372 15033         | Sweden            |
       +---------------------------------+-------------------+





More information about the ubuntu-users mailing list