- Create the directory where the specific database will be held:
- Change to the htdig conf directory:
- Copy the default conf file to the custom conf file that you want to use:
cp htdig.conf.sample htdig_your_website_com.conf
- Edit htdig_your_website_com.conf to change these variables:
- Use the rundig script to create the database:
rundig -c /usr/local/etc/htdig/htdig_your_website_com.conf -s -v
- Check /usr/local/share/htdig/database/your_website_com to make sure that the db files were created in there.
- Copy 'htsearch' to common cgi-bin directory:
cp htsearch /usr/local/www/cgi-bin/
- Run 'htsearch' from the command line to verify that the db is working:
./htsearch -c /usr/local/etc/htdig/htdig_your_website_com.conf
Enter value for words: icmpv6
Enter value for format: text
Once you press enter, you should see HTML scrolling on the screen. This is a good thing!
- Create symbolic link in the htdocs directory for htdig icons:
ln -s /usr/local/share/apache/icons/htdig htdig
- Copy the search.html file to the htdocs directory
cp /usr/local/share/apache/htdocs/search.html /<whatever>/htdocs/search.htm
- Now, go to the htdocs directory and modify the search page to use the correct conf file:
<input type="hidden" name="config" value="htdig_your_website_com">
- Now go test it! it is working great! now, on to making the search/results page look like the other pages.
- Edit the conf file again to specify that you want to use custom pages (header, footer, etc.):
template_map: Long long builtin-long \
Short short builtin-short \
Default default /<whatever>/htdocs/htdig_templates/htdig_result.htm
- Of course, you also need to create those files in your htdocs directory. On my site, I use Front Page with a theme. This is a pain in the ass because Front Page wants to rewrite my htdig_header.htm all of the time. This is a problem, because the results are served from http://michael.gargantuan.com/cgi-bin/htsearch, and the htdig_header.htm page has images links in it (generated by Front Page) that use syntax like <img src="_themes/bl....">. Of course, there is no "_themes" directory under /cgi-bin/. So, I created a directory called 'htdig_templates' and that is where I keep the search results templates. This works out nicely because Front Page will create all of
the links to the theme files with a leading "../", which is what is required to find those files from the /cgi-bin/ directory.
- That's it!