htdig: trouble installing htdig

Pete Siemsen (
Tue, 12 Jan 1999 17:25:07 -0700

I'm trying to get htdig working on a Solaris 2.7 system with the Sun C
compiler. Here's the notes I kept as to what I did to get where I am.

I can now go to my local search.html Web page, and enter a word, but
no matter what word I try, I always get no hits. Any suggestions are

1.35.1 Get htdig

To get it, web to
and click on the htdig-3.0.6.tar.gz link.

   gunzip htdig-3.0.6.tar.gz
   tar xf htdig-3.0.6.tar
   rm htdig-3.0.6.tar
   cd /usr/web
   mkdir htdoc
   cd htdoc
   cp /usr/src/htdig-3.0.6/htdoc/* .
   cd ..
   chown -R siemsen htdoc
   chgrp -R datacomm htdoc

1.35.2 Build htdig

   cd /usr/src/htdig-3.0.6

Use a web browser to look at /usr/web/htdoc. Under Installation,
you'll find a page that describes editing of the CONFIG file. I set
values in this file as follows:

   DEST= /opt/htdig
   CGIBIN_DIR= /usr/web/nets/cgi
   IMAGE_DIR= /usr/web/nets/images
   IMAGE_URL_PREFIX= /nets/images
   SEARCH_DIR= /usr/web/nets/Forms

Now configure it:


The next step is to run "make". If you do, you'll get compiler
warnings, and then a compile failure. To get past the failure, I
hacked the source files. Scary, but I didn't know what to do. I
tried copying the distribution to another system that has GCC and
doing a "configure" and "make" there. On that system, I got even more
warnings, and then it failed on the same source file. So...

Edit htfuzzy/Exact.c and add

   return 0;

as the body of the openIndex function.

Edit htdig/ and change

   typedef void (*SIGNAL_HANDLER) (...);


   typedef void (*SIGNAL_HANDLER) (int);

Edit htdig/ and change

   return (unsigned char) (*junk.trans)[entity];


   return (int) (*junk.trans)[entity];

Edit htdig/Makefile and change

   $(TARGET): $(OBJS)
   $(CXX) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBS)


   $(TARGET): $(OBJS)
   $(CXX) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBS) -lsocket -lnsl -lxnet

1.35.3 Build and install htdig

   cd /usr/src/htdig-3.0.6
   make install
   chown -R siemsen db
   chgrp -R datacomm db

1.35.5 Configure htdig

A file named /opt/htdig/conf/htdig.conf controls the operation of the
indexer. Edit it to reflect our web:

   exclude_urls: /nets/cgi/ .cgi

1.35.6 Make a Web page to test searching

The make install copied an HTML file named search.html into
/usr/web/nets/Forms. The file is screwed up ina few ways. For one, it
contains these lines:

   <input type=hidden name=config value=$(CONFIG)>
   <input type=hidden name=restrict value="$(RESTRICT)">
   <input type=hidden name=exclude value="$(EXCLUDE)">

...which seem wrong. When the Web server starts htsearch, htsearch
produces the error

   Unable to read configuration file "/opt/htdig/conf/$(CONFIG).conf"

After tearing my hair for a while, I discovered that there was a
version of search.html in .../installdir/search.html.orig that seemed
more correct. Instead of the above three lines, is had just

   <input type=hidden name=config value=htdig>


   cp /usr/src/htdig-3.0.6/installdir/search.html.orig /usr/web/nets/Forms

Edit /usr/web/nets/Forms/search.html.

Change the header sentence to

   This page allows you to search the contents of the NETS Web pages.


   <form method="post" action="/cgi-bin/htsearch">


   <form method="post" action="/nets/cgi/htsearch">

1.35.7 Build the htdig index

   /opt/htdig/bin/rundig -v

1.35.8 Test a search

Start a web browser, and go to this URL:

This "works", except that it always says there are no hits.

Please help. HTDIG looks like a neat tool, and I think I'm very close
to making it work.

-- Pete
To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the body of the message.

This archive was generated by hypermail 2.0b3 on Wed Jan 13 1999 - 09:13:06 PST