After installing mnoGoSearch on FreeBSD
yesterday and realising that the context provided in search results only shows the top of the page, it's time to try ht://Dig
This one is a little easier to do than mnoGoSearch, because it doesn't use MySQL; it has its own builtin database. First, compile and install:
make build install clean
Now you need to create the config file and customise it to fit your site:
cp htdig.conf.sample htdig.conf
from (...)/database to (...)/database_foo
, where foo
is some identifier that will remind you what you are searching. I'm assuming you are at least considering installing many ht://Dig instances on your server, and you need a different database_dir
for each one. If you only want one search engine, you don't need to change this.
to point to the root of your website.
so you don't get the silly default e-mail address when you do log analysis.
to include everything you don't want to index. If you're indexing a Python Community Server
, I recommend adding referers.py format=rss
, which will prevent referrer ranking pages and comment XML feeds from being indexed.
. I added .xml, because I don't want to have rss.xml files showing in the search results. Also .fttb, so Radio
templates don't show up. Put in anything here that you have on the server but will look silly in the results.
Now you can make the database directory and build the database:
Now put the CGI in your webspace, make sure it's executable, and try it out:
cp /usr/local/share/apache/cgi-bin/htsearch /path/to/cgi-bin/htsearch.cgi
See the mnoGoSearch install notes (linked above) for details on how to get a .cgi file to run.
Did I get anything wrong? Drop me a line (
) and I'll correct it.
: The version in the ports tree doesn't do phrase matching. Here's how to install from source:
log in as root
tar -vzxf htdig-3.2.0b3.tar.gz
./configure --prefix=/usr/local && gmake && gmake install && gmake clean
edit /usr/local/conf/htdig.conf as before
(with fingers crossed).
More detail here later.