Re: [htdig] Help, Unable to read word database file '/usr/lib/htdig/db/db.words.db'

Subject: Re: [htdig] Help, Unable to read word database file '/usr/lib/htdig/db/db.words.db'
From: Gilles Detillieux (
Date: Wed Feb 16 2000 - 13:43:21 PST

According to Fates:
> Ok, I installed the htdig-3.1.4-0glibc21.i386.rpm on a RedHat 6.1
> system.
> I copied /var/lib/htdig to /usr/lib/htdig since I don't have enough
> space for the db under /var.
> 1.
> I made the following changes to /etc/htdig/htdig.conf
> database_dir: /usr/lib/htdig/db

You should also set

  common_dir: /usr/lib/htdig/common

since you likely moved it as well as the "db" directory, when you moved
all of /var/lib/htdig to /usr.

> start_url: (Note: I have two nics,
> one for Intranet with IP and one for Internet with
> At bottom of file is this:
> start_url:
> local_urls:
> #local_user_urls:,/public_html/
> The domain thats in here is one I made up for my
> address) which is in my hosts file as
> Should I change this to my Internet name?

I'm not sure. It might depend on the ServerName configuration in Apache.
The only way to tell for sure would be to run htdig -iv or rundig -v to
see what URLs it's using, or if you add another v, you should also get
feedback about whether the local files are being used. In any case, it
won't use the local file system for the first URL in start_url, as it
clearly does not match the pattern in local_urls.

> 2. Next, I changed /usr/sbin/rundig
> Made the following changes:
> DBDIR=/usr/lib/htdig/db
> COMMONDIR=/usr/lib/htdig/common
> I wonder if I could have just created a symbolic link in /var/lib/htdig
> to /usr/lib/htdig

That would have been easier, yes, but it's your choice.

> 3. I renamed my .htaccess file to htaccess since htdig will not process
> directories that are password protected.

Unless you tell htdig to do so. (See my last e-mail.)

> 4. I remove all symbolic links I have within the html directory. The
> reason for this is because I have symbolic links to /usr/doc and a few
> other areas that would make the db to large.

You could also use robots.txt to exclude directories you don't want to
index, or use the exclude_urls attribute.

> 5. I start the apache server since I get an error if its not running
> when I try and run /usr/sbin/rundig

Most likely because your start_url and local_urls settings disagree. If
you don't try to index dynamic content, and you set up your attributes
right, you should be able to index a whole site locally without fallback
to HTTP.

> 6. I check the size of my html directory which is 50 meg
> 7. I run /usr/sbin/rundig
> 8. I have to go to work and rundig is still going after about 30
> minutes. I have to shutdown the apache server so no one else can get
> into it since its not password protected. I shut it down and check to
> see if rundig is still running, it is.

This would cause incomplete indexing of your server, if you haven't gotten
htdig to index everything via the local filesystem, as you don't know if/when
it would need to fallback to HTTP, which would fail if you shut down Apache.

> 9. I come home from work, rundig is done

But did it work correctly? You won't know unless you use one or more -v
options to get some feedback, otherwise htdig silently skips over anything
it can't access for whatever reason. You really should take time to go
through the documentation, especially

to familiarise yourself with all the options available to you. Several
of your points above suggest to me that you haven't done so.

> 10. I access search.html from the root directory and type in test and
> get the following error:
> ht://Dig error
> htsearch detected an error. Please report this to the webmaster of this
> site. The error message is:
> Unable to read word database file '/usr/lib/htdig/db/db.words.db'
> Did you run htmerge?
> 11. I figure its a permission problem so I chmod 644
> /usr/lib/htdig/db/*
> I try and run another search and I get same error. I figure maybe it has
> to run as my server user which is nobody so I change the owner and group
> to nobody. Still same problem.
> 12. I run htsearch from the command line in my cgi directory.
> htsearch -vvv
> I get prompt and type in test
> I get results (works)
> Is it a permissions problem?

It could still be, if your chmod was unsuccessful, or if any of the
directories leading up to /usr/lib/htdig/db is missing execute permission
for "nobody" (or whatever user ID Apache runs under). If you're doing
your installation work and running htdig with a umask of 7 or 77,
you're just asking for grief. Use umask 2 or 22, and make sure all
the directories htsearch needs are executable. Execute permission
on a directory is necessary for access to any files or subdirectories
it contains.

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------ To unsubscribe from the htdig mailing list, send a message to You will receive a message to confirm this.

This archive was generated by hypermail 2b28 : Wed Feb 16 2000 - 13:46:50 PST