Debian Codegraph @

htdoc/FAQ.html

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
2 <html>
3 <head>
4 <title>ht://Dig Frequently Asked Questions</title>
5 <link rel="stylesheet" href="css/htdig.css">
6 </head>
7 <body bgcolor="#eef7ff">
8 <h1>Frequently Asked Questions</h1>
9 <p>
10 ht://Dig Copyright &copy; 1995-2004 <a href="THANKS.html">The ht://Dig Group</a><br>
11 Please see the file <a href="COPYING">COPYING</a> for
12 license information.
13 </p>
14 <hr noshade size=4>
15 <p class="main">This FAQ is compiled by the ht://Dig developers and the
16 most recent version is available at &lt;<a
17 href="http://www.htdig.org/FAQ.html">http://www.htdig.org/FAQ.html</a>&gt;.
18 Questions (and answers!) are greatly appreciated.
19 Please send questions and/or answers to the ht://Dig user
20 mailing list at: &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;.
21 </p>
22 <h2>Questions</h2>
23
24 <h3>1. General</h3>
25 1.1. <a href="#q1.1">Can I search the internet with ht://Dig?</a><br>
26 1.2. <a href="#q1.2">Can I index the internet with ht://Dig?</a><br>
27 1.3. <a href="#q1.3">What's the difference between htdig and
28 ht://Dig?</a><br>
29 1.4. <a href="#q1.4">I sent mail to Andrew or Geoff or
30 Gilles, but I never got a response!</a><br>
31 1.5. <a href="#q1.5">I sent a question to the mailing list but I
32 never got a response!</a><br>
33 1.6. <a href="#q1.6">I have a great idea/patch for ht://Dig!</a><br>
34 1.7. <a href="#q1.7">Is ht://Dig Y2K compliant?</a><br>
35 1.8. <a href="#q1.8">I think I found a bug. What should I do?</a><br>
36 1.9. <a href="#q1.9">Does ht://Dig support phrase or near
37 matching?</a><br>
38 1.10. <a href="#q1.10">What are the practical and/or theoretical
39 limits of ht://Dig?</a><br>
40 1.11. <a href="#q1.11">Do any ISPs offer ht://Dig as part of
41 their web hosting services?</a><br>
42 1.12. <a href="#q1.12">Can I use ht://Dig on a commercial website?</a><br>
43 1.13. <a href="#q1.13">Why do you use a non-free product to
44 index PDF files?</a><br>
45 1.14. <a href="#q1.14">Why do you have all those SourceForge
46 logos on your website?</a><br>
47 1.15. <a href="#q1.15">My question isn't answered here. Where should I
48 go for help?</a><br>
49 1.16. <a href="#q1.16">Why do the developers get annoyed when
50 I e-mail questions directly to them rather than the mailing list?</a><br>
51 1.17. <a href="#q1.17">Why do replies to messages on the
52 mailing list only go to the sender and not to the list?</a><br>
53 1.18. <a href="#q1.18">Can I use ht://Dig to index and search
54 an SQL database?</a><br>
55
56 <hr noshade size=2>
57
58 <h3>2. Getting ht://Dig</h3>
59 2.1. <a href="#q2.1">What's the latest version of ht://Dig?</a><br>
60 2.2. <a href="#q2.2">Are there binary distributions of ht://Dig?</a><br>
61 2.3. <a href="#q2.3">Are there mirror sites for ht://Dig?</a><br>
62 2.4. <a href="#q2.4">Is ht://Dig available by ftp?</a><br>
63 2.5. <a href="#q2.5">Are patches around to upgrade between
64 versions?</a><br>
65 2.6. <a href="#q2.6">Is there a Windows 95/98/2000/NT
66 version of ht://Dig?</a><br>
67 2.7. <a href="#q2.7">Where can I find the documentation for my
68 version of ht://Dig?</a><br>
69
70 <hr noshade size=2>
71
72 <h3>3. Compiling</h3>
73 3.1. <a href="#q3.1">When I compile ht://Dig I get an error
74 about libht.a.</a><br>
75 3.2. <a href="#q3.2">I get an error about -lg</a><br>
76 3.3. <a href="#q3.3">I'm compiling on Digital Unix and I get
77 mesages about "unresolved" and "db_open."</a><br>
78 3.4. <a href="#q3.4">I'm compiling on FreeBSD and I get lots
79 of messages about '___error' being unresolved.</a><br>
80 3.5. <a href="#q3.5">I'm compiling on HP/UX and I get a complaint about
81 "Large Files not supported."</a><br>
82 3.6. <a href="#q3.6">I'm compiling on Solaris and when I run the
83 programs I get complaints about not finding libstdc++.</a><br>
84 3.7. <a href="#q3.7">I'm compiling on IRIX and I'm having
85 database problems when I run the program.</a><br>
86 3.8. <a href="#q3.8">I'm compiling with gcc 3.2 and getting
87 all sorts of warnings/errors about ostream and such.</a><br>
88
89 <hr noshade size=2>
90
91 <h3>4. Configuration</h3>
92 4.1. <a href="#q4.1">How come I can't index my site?</a><br>
93 4.2. <a href="#q4.2">How can I change the output format of
94 htsearch?</a><br>
95 4.3. <a href="#q4.3">How do I index pages that start with '~'?</a><br>
96 4.4. <a href="#q4.4">Can I use multiple databases?</a><br>
97 4.5. <a href="#q4.5">OK, I can use multiple databases. Can I
98 merge them into one?</a><br>
99 4.6. <a href="#q4.6">Wow, ht://Dig eats up a lot of disk
100 space. How can I cut down?</a><br>
101 4.7. <a href="#q4.7">Can I use SSI or other CGIs in my
102 htsearch results?</a><br>
103 4.8. <a href="#q4.8">How do I index Word, Excel, PowerPoint
104 or PostScript documents?</a><br>
105 4.9. <a href="#q4.9">How do I index PDF files?</a><br>
106 4.10. <a href="#q4.10">How do I index documents in other
107 languages?</a><br>
108 4.11. <a href="#q4.11">How do I get rotating banner ads in
109 search results?</a><br>
110 4.12. <a href="#q4.12">How do I index numbers in documents?</a><br>
111 4.13. <a href="#q4.13">How can I call htsearch from a hypertext
112 link, rather than from a search form?</a><br>
113 4.14. <a href="#q4.14">How do I restrict a search to only meta
114 keywords entries in documents?</a><br>
115 4.15. <a href="#q4.15">Can I use meta tags to prevent htdig from
116 indexing certain files?</a><br>
117 4.16. <a href="#q4.16">How do I get htsearch to use the star image
118 in a different directory than the default /htdig?</a><br>
119 4.17. <a href="#q4.17">How do I get htdig or htsearch to rewrite
120 URLs in the search results?</a><br>
121 4.18. <a href="#q4.18">What are all the options in
122 htdig.conf, and are there others?</a><br>
123 4.19. <a href="#q4.19">How do I get more than 10 pages of
124 10 search results from htsearch?</a><br>
125 4.20. <a href="#q4.20">How do I restrict a search to only
126 certain subdirectories or documents?</a><br>
127 4.21. <a href="#q4.21">How can I allow people to search
128 while the index is updating?</a><br>
129 4.22. <a href="#q4.22">How can I get htdig to ignore the
130 robots.txt file or meta robots tags?</a><br>
131 4.23. <a href="#q4.23">How can I get htdig not to index
132 some directories, but still follow links?</a><br>
133 4.24. <a href="#q4.24">How can I get rid of duplicates in
134 search results?</a><br>
135 4.25. <a href="#q4.25">How can I change the scores in
136 search results, and what are the defaults?</a><br>
137 4.26. <a href="#q4.26">How can I get htdig not to index
138 JavaScript code or CSS?</a><br>
139
140 <hr noshade size=2>
141
142 <h3>5. Troubleshooting</h3>
143 5.1. <a href="#q5.1">I can't seem to index more than X documents
144 in a directory.</a><br>
145 5.2. <a href="#q5.2">I can't index PDF files.</a><br>
146 5.3. <a href="#q5.3">When I run "rundig," I get a message about
147 "DATABASE_DIR" not being found.</a><br>
148 5.4. <a href="#q5.4">When I run htmerge, it stops with an "out
149 of diskspace" message.</a><br>
150 5.5. <a href="#q5.5">I have problems running rundig from cron
151 under Linux.</a><br>
152 5.6. <a href="#q5.6">When I run htmerge, it stops with an
153 "Unexpected file type" message.</a><br>
154 5.7. <a href="#q5.7">When I run htsearch, I get lots of Internal
155 Server Errors (#500).</a><br>
156 5.8. <a href="#q5.8">I'm having problems with indexing words
157 with accented characters.</a><br>
158 5.9. <a href="#q5.9">When I run htmerge, it stops with a
159 "Word sort failed" message.</a><br>
160 5.10. <a href="#q5.10">When htsearch has a lot of matches, it runs
161 extremely slowly.</a><br>
162 5.11. <a href="#q5.11">When I run htsearch, it gives me a count of
163 matches, but doesn't list the matching documents.</a><br>
164 5.12. <a href="#q5.12">I can't seem to index documents with names
165 like left_index.html with htdig.</a><br>
166 5.13. <a href="#q5.13">I get Premature End of Script Headers errors
167 when running htsearch.</a><br>
168 5.14. <a href="#q5.14">I get Segmentation faults when running
169 htdig, htsearch or htfuzzy.</a><br>
170 5.15. <a href="#q5.15">Why does htdig 3.1.3 mangle URL parameters
171 that contain bare "&amp;" characters?</a><br>
172 5.16. <a href="#q5.16">When I run htmerge, it stops with an
173 "Unable to open word list file '.../db.wordlist'" message.</a><br>
174 5.17. <a href="#q5.17">When using Netscape, htsearch always returns the
175 "No match" page.</a><br>
176 5.18. <a href="#q5.18">Why doesn't htdig follow links to other
177 pages in JavaScript code?</a><br>
178 5.19. <a href="#q5.19">When I run htsearch from the web server,
179 it returns a bunch of binary data.</a><br>
180 5.20. <a href="#q5.20">Why are the betas of 3.2 so slow at indexing?</a><br>
181 5.21. <a href="#q5.21">Why does htsearch use ";" instead of
182 "&amp;" to separate URL parameters for the page buttons?</a><br>
183 5.22. <a href="#q5.22">Why does htsearch show the
184 "&amp;" character as "&amp;amp;" in search results?</a><br>
185 5.23. <a href="#q5.23">I get Internal Server or Unrecognized
186 character errors when running htsearch.</a><br>
187 5.24. <a href="#q5.24">I took some settings out of
188 my htdig.conf but they're still set.</a><br>
189 5.25. <a href="#q5.25">When I run htdig on my site,
190 it misses entire directories.</a><br>
191 5.26. <a href="#q5.26">What do all the numbers and symbols
192 in the htdig -v output mean?</a><br>
193 5.27. <a href="#q5.27">Why is htdig rejecting some of the
194 links in my documents?</a><br>
195 5.28. <a href="#q5.28">When I run htdig or htmerge, I get a
196 "DB2 problem...: missing or empty key value specified" message.</a><br>
197 5.29. <a href="#q5.29">When I run htdig on my site,
198 it seems to go on and on without ending.</a><br>
199 5.30. <a href="#q5.30">Why does htsearch no longer recognize
200 the -c option when run from the web server?</a><br>
201 5.31. <a href="#q5.31">I've set a config attribute exactly
202 as documented but it seems to have no effect.</a><br>
203 5.32. <a href="#q5.32">When I run htsearch, it gives a page
204 with an "Unable to read configuration file" message.</a><br>
205 5.33. <a href="#q5.33">How can I find out which version
206 of ht://Dig I have installed?</a><br>
207 5.34. <a href="#q5.34">When running htdig, I get "Error (0):
208 PDF file is damaged - attempting to reconstruct xref table..."</a><br>
209 5.35. <a href="#q5.35">When running htdig on Mandrake Linux,
210 I get "host not found" and "no server running" errors.</a><br>
211 5.36. <a href="#q5.36">When I run htsearch, it gives me the
212 list of matching documents, but no header or footer.</a><br>
213 5.37. <a href="#q5.37">When I index files with doc2html.pl,
214 it fails with the "UNABLE to convert" error.</a><br>
215 5.38. <a href="#q5.38">Why do my searches find search terms
216 in pathnames, or how do I prevent matching filenames?</a><br>
217 5.39. <a href="#q5.39">I set up an external parser but I still
218 can't index Word/Excel/PowerPoint/PDF documents.</a><br>
219
220 <hr noshade size=4>
221 <h2>Answers</h2>
222
223 <h3>1. General</h3>
224 <strong>1.1. <a name="q1.1">Can I search the internet with
225 ht://Dig?</a></strong><br>
226 <p>No, ht://Dig is a system for indexing and searching a
227 finite (not necessarily small) set of sites or intranet. It
228 is not meant to replace any of the many internet-wide search
229 engines.</p>
230
231 <strong>1.2. <a name="q1.2">Can I index the internet with
232 ht://Dig?</a></strong><br>
233 <p>No, as above, ht://Dig is not meant as an
234 internet-wide search engine. While there is
235 <em>theoretically</em> nothing to stop you from indexing as
236 much as you wish, practical considerations (e.g. time, disk
237 space, memory, etc.) will limit this.</p>
238
239 <strong>1.3. <a name="q1.3">What's the difference between htdig and
240 ht://Dig?</a></strong><br>
241 <p>The complete ht://Dig package consists of several programs, one of
242 which is called "htdig." This program performs the "digging" or
243 indexing of the web pages. Of course an index doesn't do you much good
244 without a program to sort it, search through it, etc.</p>
245
246 <strong>1.4. <a name="q1.4">I sent mail to Andrew or Geoff
247 or Gilles, but I never got a response!</a></strong><br>
248 <p>Andrew no longer does much work on ht://Dig. He has started a
249 company, called <a href="http://www.contigo.com/">Contigo
250 Software</a> and is quite busy with that. To contact any of the
251 current developers, send mail to &lt;<a
252 href="mailto:[email protected]">htdig-dev</a>&gt;.
253 This list is intended primarily for the discussion of current
254 and future development of the software.</p>
255
256 <p>Geoff and Gilles are currently the maintainers of
257 ht://Dig, but they are both volunteers. So while they do
258 read all the e-mail they receive, they may not respond
259 immediately. Questions about ht://Dig in general, and especially
260 questions or requests for help in configuring the software,
261 should be posted to the &lt;<a
262 href="mailto:[email protected]">htdig-general</a>&gt;
263 mailing list. When posting a followup to a message on the
264 list, you should use the "reply to all" or "group reply"
265 feature of your mail program, to make sure the mailing list
266 address is included in the reply, rather than replying only
267 to the author of the message.
268 See also question <a href="#q1.16">1.16</a> and the
269 <a href="http://www.htdig.org/mailarchive.html">mailing list</a>
270 page.</p>
271
272 <strong>1.5. <a name="q1.5">I sent a question to the mailing list but I
273 never got a response!</a></strong><br>
274 <p>Development of ht://Dig is done by volunteers. Since we all
275 have other jobs, it make take a while before someone gets back
276 to you. Please be patient and don't hound the volunteers with
277 direct or repeated requests. If you don't get a response after
278 3 or 4 days, then a reminder may help.
279 See also question <a href="#q1.16">1.16</a>.</p>
280
281 <strong>1.6. <a name="q1.6">I have a great idea/patch for
282 ht://Dig!</a></strong><br>
283 <p>Great! Development of ht://Dig continues through suggestions
284 and improvements from users. If you have an idea (or even better,
285 a patch), please send it to the ht://Dig mailing list so others
286 can use it. For suggestions on how to submit patches, please check
287 the <a href="dev/patches.html">Guidelines for
288 Patch Submissions</a>. If you'd like to make a feature request,
289 you can do so through the <a href="bugs.html">ht://Dig bug
290 database</a></p>
291
292 <strong>1.7. <a name="q1.7">Is ht://Dig Y2K compliant?</a></strong><br>
293 <p>
294 ht://Dig should be y2k compliant since it never <em>stores</em> dates as
295 two-digit years. Under ht://Dig's copyright (GPL), there is no warranty
296 whatsoever as permitted by law. If you would like an iron-clad,
297 legally-binding guarantee, feel free to check the source code
298 itself. Versions prior to 3.1.2 did have a problem with the parsing
299 of the Last-Modified header returned by the HTTP server, which will
300 cause incorrect dates to be stored for documents modified after
301 February 28, 2000 (yes, it didn't recognize 2000 as a leap year).
302 Versions prior to 3.1.5 didn't correctly handle servers that return
303 two digit years in the Last-Modified header, for years after 99.
304 These problems are fixed in the current release.
305 If you discover something else, please let us know!
306 </p>
307
308 <strong>1.8. <a name="q1.8">I think I found a bug. What should I
309 do?</a></strong><br>
310 <p>Well, there are probably bugs out there. You have two options
311 for bug-reporting. You can either mail the ht://Dig mailing list
312 at &lt;<a href="mailto:[email protected]">[email protected]</a>&gt; or
313 better yet, report it to the <a href="bugs.html">bug
314 database</a>, which ensures it won't
315 become lost amongst all of the other mail on the list.
316 Please try to include as much information as possible, including
317 the version of ht://Dig (see question <a href="#q5.33">5.33</a>),
318 the OS, and anything else that might be helpful.
319 Often, running the programs with one "-v" or more
320 (e.g. "-vvv") gives useful debugging information.
321 If you are unsure whether the problem is a bug or a configuration
322 problem, you should discuss the problem on
323 &lt;<a href="mailto:[email protected]">htdig-general</a>&gt;
324 (after carefully reading the FAQ and searching the
325 <a href="http://www.htdig.org/mailarchive.html">mail archive</a>
326 and <a href="#q2.5">patch archive</a>,
327 of course)
328 to sort out what it is. The mailing list has a wider audience, so
329 you're more likely to get help with configuration problems there
330 than by reporting them to the bug database.
331 </p>
332
333 <p>Whether reporting problems to the bug database or mailing
334 list, we cannot stress enough the importance of
335 <strong>always</strong> indicating <strong>which version of
336 ht://Dig you are running</strong>.
337 See question <a href="#q5.33">5.33</a>. There
338 are still a lot of users, ISPs and software distributors using
339 older versions, and there have been a lot of bug fixes and
340 new features added in recent versions. Knowing which version
341 you're running is absolutely essential in helping to find a
342 solution. If you're unsure if your version is current, or what
343 fixes and features have been added in more recent versions,
344 please see the <a href="RELEASE.html">
345 release notes</a>. See also question <a href="#q2.1">2.1</a>.</p>
346
347 <strong>1.9. <a name="q1.9">Does ht://Dig support phrase or near
348 matching?</a></strong><br>
349 <p>Phrase searching has been added for the 3.2 release,
350 which is currently in the beta phase
351 (<a href="http://www.htdig.org/files/htdig-3.2.0b6.tar.gz">3.2.0b6</a>
352 as of this writing). Near or proximity matching will probably be added
353 in a future beta.
354 </p>
355
356 <strong>1.10. <a name="q1.10">What are the practical and/or theoretical
357 limits of ht://Dig?</a></strong><br>
358 <p>The code itself doesn't put any real limit on the number of
359 pages. There are several sites in the hundreds of thousands
360 of pages. As for practical limits, it depends a lot on how
361 many pages you plan on indexing. Some operating systems limit
362 files to 2 GB in size, which can become a problem with a large
363 database. There are also slightly different limits to each of
364 the programs. Right now htmerge performs a sort on the words
365 indexed. Most sort programs use a fair amount of RAM and
366 temporary disk space as they assemble the sorted list. The
367 htdig program stores a fair amount of information about the
368 URLs it visits, in part to only index a page once. This takes
369 a fair amount of RAM. With cheap RAM, it never hurts to throw
370 more memory at indexing larger sites. In a pinch, swap will
371 work, but it obviously really slows things down.</p>
372
373 <p>The 3.2 development code helps with many of these
374 limitations. In paticular, it generates the databases on the
375 fly, which means you don't have to sort them before
376 searching. Additionally, the new databases are compressed
377 significantly, making them usually around 50% the size of
378 those in previous versions.</p>
379
380 <strong>1.11. <a name="q1.10">Do any ISPs offer ht://Dig as part of
381 their web hosting services?</a></strong><br>
382 <p>Yes. A list of such ISPs is <a href="isp.html">available
383 here</a>
384 </p>
385
386 <strong>1.12. <a name="q1.12">Can I use ht://Dig on a
387 commercial website?</a></strong><br>
388 <p>Sure! The <a href="COPYING">GNU Library General Public License (LGPL)</a> has no
389 restrictions on use. So you are free to use ht://Dig however you
390 want on your website, personal files, etc. The license only
391 restricts distribution. So if you're planning on a
392 commercial software product that includes ht://Dig, you will
393 have to provide source code including any modifications upon
394 request.
395 </p>
396
397 <strong>1.13. <a name="q1.13">Why do you use a non-free
398 product to index PDF files?</a></strong><br>
399 <p>
400 We don't. You <em>can</em> use the &quot;acroread&quot;
401 program to index PDF files, but this is no longer
402 recommended. Initially this program was the only reliable
403 way to extract data from PDF files. However, the <a
404 href="http://www.foolabs.com/xpdf/">xpdf package</a> is a
405 reliable, free software package for indexing and viewing PDF
406 files. See question <a href="#q4.9">4.9</a> for details on
407 using xpdf to index PDF files. We do not advocate using
408 acroread any longer because it is a proprietary product.
409 Additionally it is no longer reliable at extracting data.
410 </p>
411
412 <strong>1.14. <a name="q1.14">Why do you have all those SourceForge
413 logos on your website?</a></strong><br>
414 <p><a href="http://sourceforge.net/">SourceForge</a> is a
415 new service for open source software. You can host your
416 project on SourceForge servers and use many of their
417 services like bug-tracking and the like. The ht://Dig
418 project currently uses SourceForge for a mirror of the main
419 website at <a
420 href="http://htdig.sourceforge.net/">htdig.sourceforge.net</a>
421 as well as a mirror of ht://Dig releases and contributed
422 work.
423 </p>
424
425 <strong>1.15. <a name="q1.15">My question isn't answered here.
426 Where should I go for help?</a></strong><br>
427 <p>
428 Before you go anywhere else, think of other ways of phrasing your
429 question. Many times people have questions that are very similar to
430 other FAQ and while we try to phrase the queries in the FAQ closely to
431 the most common questions, we obviously can't get them all! The next
432 place to check is the documentation itself. In particular, take a
433 look at the list of configuration attributes, particularly the list <a
434 href="cf_byname.html">by name</a> and <a
435 href="cf_byprog.html">by program</a>. There are a
436 lot of them, but chances are there's something that might fit your needs.
437 You should also take a close look at all of
438 <a href="htsearch.html">htsearch</a>'s
439 documentation, especially the section "HTML form" which describes
440 all the CGI input parameters available for controlling the search,
441 including limiting the search to certain subdirectories.
442 You can find the answer yourself to almost all "how can I..."
443 questions by exploring what the various configuration attributes
444 and search form input parameters can do.
445 Also have a look at our collection of
446 <a href="http://www.htdig.org/contrib/guides.html">Contributed Guides</a>
447 for help on things like
448 <a href="http://www.htdig.org/files/contrib/guides/htmlhelp.html">HTML
449 forms</a> and CGI, tutorials on installing, configuring, using, and
450 internationalizing ht://Dig, as well as using PHP with htsearch.
451 </p>
452 <p>
453 Finally, if you've exhausted all the online documentation, there's the
454 <a href="mailto:[email protected]">htdig-general</a> mailing list.
455 There are hundreds of users subscribed and chances are good that someone
456 has had a similar problem before or can suggest a solution.
457 </p>
458
459 <strong>1.16. <a name="q1.16">Why do the developers get annoyed when
460 I e-mail questions directly to them rather than the mailing list?</a></strong><br>
461 <p>The <a href="mailto:[email protected]">htdig-general</a>
462 mailing list exists for dealing with questions about the
463 software, its installation, configuration, and problems with
464 it. E-mailing the developers directly circumvents this forum
465 and its benefits. Most annoyingly, it puts the onus on an
466 individual to answer, even if that individual is not the best or
467 most qualified person to answer. This is not a one-man show. It
468 also circumvents the <a href="http://www.htdig.org/mailarchive.html">archiving
469 mechanism</a> of the mailing list,
470 so not only do subscribers not see these private messages
471 and replies, but future users who may run into the exact same
472 problems won't see them. Remember that the developers are all
473 volunteers, and they don't work for free for your benefit alone.
474 They volunteer for the benefit of the whole ht://Dig user
475 community, so don't expect extra support from them outside of
476 that community. See also questions <a href="#q1.4">1.4</a>
477 and <a href="#q1.5">1.5</a>.</p>
478
479 <p>Note also that when you reply to a message on the list, you
480 should make sure the reply gets on the list as well, provided your
481 reply is still on-topic. See question <a href="#q1.17">1.17</a>
482 below.</p>
483
484 <strong>1.17. <a name="q1.17">Why do replies to messages on the
485 mailing list only go to the sender and not to the list?</a></strong><br>
486 <p>The simple answer is that, unlike some mailing lists, the
487 lists on SourceForge don't force replies back on the list. This
488 is actually a good thing, because you can reply to the sender
489 directly if you want to, or you can use your mail program's
490 "reply to all" capability (sometimes called "group reply")
491 to reply to the mailing list as well. It does mean you have to
492 think before you post a reply, but some would argue that this
493 is a good thing too. There are some compelling reasons to try to
494 keep on-topic discussions on the list, though (see questions
495 <a href="#q1.16">1.16</a> and <a href="#q1.4">1.4</a> above).</p>
496
497 <p>The technical answer is
498 <a href="http://sourceforge.net/docman/display_doc.php?docid=6693&group_id=1">
499 SourceForge's policy on Reply-To: munging</a>, where you'll
500 find all the gory details about the pros and cons of the two
501 common ways of setting up a mailing list, and why SourceForge
502 turns off Reply-To munging. It so happens that the ht://Dig
503 maintainers agree with SourceForge's policy on this, even if
504 we did have a say in the matter. So, counterarguments to this
505 policy are rather moot, and it would be better not to waste
506 any more mailing list bandwidth debating them. (We've heard
507 all the arguments anyway.)</p>
508
509 <strong>1.18. <a name="q1.18">Can I use ht://Dig to index and search
510 an SQL database?</a></strong><br>
511 <p>You can if your database has a web-based front end that can
512 be "spidered" by ht://Dig. The requirement is that every search
513 result must resolve to a unique URL which can be accessed via
514 HTTP. The htdig program uses these URLs, which you feed it via
515 the <a href="attrs.html#start_url">start_url</a> attribute, to
516 fetch and index each page of information. The search results
517 will then give a list of URLs for all pages that match the
518 search terms. If you don't have such a front end to your
519 database, or the search results must be given as something
520 other than URLs, then ht://Dig is probably not the best way of
521 dealing with this problem: you may be better off using an SQL
522 query engine that works directly on your own database, rather
523 than building a separate ht://Dig database for searching.</p>
524
525 <p>Ted Stresen-Reuter had the following tips: "In my case,
526 because I like htdig's ability to rank results (and that
527 ranking can be modified), I created an index page that simply
528 walks through each record and indexes each record (with
529 <em>next</em> and <em>previous</em> links so the spider can
530 read all the records). And then I do one other thing: I make
531 the <code>&lt;title&gt;</code> tag start with the unique ID
532 of each record. Then, when I'm parsing the search results, I
533 do a lookup on the database using the title tag as the key."</p>
534
535 <hr noshade size=2>
536
537 <h3>2. Getting ht://Dig</h3>
538 <strong>2.1. <a name="q2.1">What's the latest version of ht://Dig?</a></strong><br>
539 <p>The latest version is 3.1.6 as of this writing. A beta
540 version of the 3.2 code,
541 <a href="http://www.htdig.org/files/htdig-3.2.0b6.tar.gz">3.2.0b6</a>,
542 is also available, for those who wish to test it.
543 You can find out about the latest version by reading the
544 <a href="RELEASE.html">release
545 notes</a>.</p>
546
547 <p><strong>Note</strong> that if you're running any version
548 older than 3.1.5 (including 3.2.0b1) on a public web site,
549 you should upgrade immediately, as older versions have a
550 rather serious security hole which is explained in detail in
551 this <a
552 href="http://www.htdig.org/htdig-dev/2000/02/0272.html">advisory</a>
553 which was sent to the Bugtraq mailing list.
554 Another slightly less serious, but still troubling security hole
555 exists in 3.1.5 and older (including 3.2.0b3 and older), so you
556 should upgrade if you're running one of these. You can view details
557 on this vulnerability from the
558 <a href="http://www.securityfocus.com/bid/3410">bugtraq mailing list.</a>
559 If you're unsure of which version you're running, see question
560 <a href="#q5.33">5.33</a>.</p>
561
562 <strong>2.2. <a name="q2.2">Are there binary distributions of
563 ht://Dig?</a></strong><br>
564 <p>We're trying to get consistent binary distributions for
565 popular platforms. Contributed binary releases will go in <a
566 href="http://www.htdig.org/files/contrib/binaries/">
567 the contributed binaries section</a>
568 and contributions should be mentioned to the <a
569 href="mailto:[email protected]">htdig-general</a>
570 mailing list.
571
572 <p>Anyone who would like to make consistent binary
573 distributions of ht://Dig at least should signup to the <a
574 href="mailing.html">htdig-announce mailing list</a>.</p>
575
576 <strong>2.3. <a name="q2.3">Are there mirror sites for ht://Dig?</a></strong><br>
577 <p>Yes, see our <a href="mirrors.html">mirrors
578 listing</a>. If you'd like to mirror the site, please see
579 the <a href="howto-mirror.html">mirroring guide</a>.</p>
580
581 <strong>2.4. <a name="q2.4">Is ht://Dig available by ftp?</a></strong><br>
582 <p>Yes. You can find the current versions and several older
583 versions at various &lt;<a
584 href="mirrors.html">mirror sites</a>&gt;
585 as well as the other locations mentioned in the <a
586 href="where.html">download page</a>.</p>
587
588 <strong>2.5. <a name="q2.5">Are patches around to upgrade between
589 versions?</a></strong><br>
590 <p>Most versions are also distributed as a patch to the previous
591 version's source code. The most recent exception to this was
592 version 3.1.0b1. Since this version switched from the GDBM
593 database to DB2, the new database package needed to be shipped
594 with the distribution. This made the potential patch almost as large
595 as the regular distribution. Update patches resumed with version
596 3.1.0b2. You can also find archives of patches submitted to
597 the htdig mailing lists, to fix specific bugs or add features,
598 at Joe Jah's <a href="ftp://ftp.ccsf.org/htdig-patches/">
599 htdig-patches ftp site</a>.</p>
600
601 <strong>2.6. <a name="q2.6">Is there a Windows 95/98/2000/NT
602 version of ht://Dig?</a></strong><br>
603 <p>The ht://Dig package can be built on the Win32 platform when
604 using the Cygwin package. For details, see the contributed guide,
605 <a href="http://www.htdig.org/files/contrib/guides/Installing_on_Win32.html">
606 <em>Idiot's Guide to Installing ht://Dig on Win32</em></a>.
607 </p>
608 <p>
609 As of the <a href="http://www.htdig.org/files/htdig-3.2.0b5.tar.gz">3.2.0b5</a>
610 beta release, there is also native Win32 support, thanks to
611 Neal Richter. (Installation docs will be written soon...)
612 </p>
613
614 <strong>2.7. <a name="q2.7">Where can I find the documentation for my
615 version of ht://Dig?</a></strong><br>
616 <p>The documentation for the most recent stable release is always
617 posted at <a href="http://www.htdig.org/">www.htdig.org</a>.
618 The documentation for the latest beta release can be found at
619 <a href="http://www.htdig.org/dev/htdig-3.2/">http://www.htdig.org/dev/htdig-3.2/</a>.
620 In all releases, the documentation is included in the
621 <strong>htdoc</strong> subdirectory of the source distribution, so
622 you always have access to the documentation for your current version.
623 </p>
624
625 <hr noshade size=2>
626
627 <h3>3. Compiling</h3>
628 <strong>3.1. <a name="q3.1">When I compile ht://Dig I get an error about
629 libht.a</a></strong><br>
630 <p>This usually indicates that either libstdc++ is not installed or
631 is installed incorrectly. To get libstdc++ or any other GNU too,
632 check
633 <a
634 href="ftp://ftp.gnu.org/gnu/">ftp://ftp.gnu.org/gnu/</a>.
635 Note that the most recent versions of gcc come with
636 libstdc++ included and are available from <a
637 href="http://gcc.gnu.org/">http://gcc.gnu.org/</a></p>
638
639 <strong>3.2. <a name="q3.2">I get an error about -lg</a></strong><br>
640 <p>This is due to a bug in the Makefile.config.in of version
641 3.1.0b1. Remove all flags "-ggdb" in Makefile.config.in. Then
642 type "./config.status" to rebuild the Makefiles and
643 recompile. This bug is fixed in version 3.1.0b2.</p>
644
645 <strong>3.3. <a name="q3.3">I'm compiling on Digital Unix and I get
646 mesages about "unresolved" and "db_open."</a></strong><br>
647 <p>Answer contributed by George Adams
648 &lt;[email protected]&gt;</p>
649
650 <p>What you're seeing are problems related to the Berkeley DB
651 library. htdig needs a fairly modern version of db, which is
652 why it ships with one that works. (see that -L../db-2.4.14/dist
653 line? That's where htdig's db library is).<br>
654
655 The solution is to modify the c++ command so it explicity
656 references the correct libdb.a . You can do this by replacing
657 the "-ldb" directive in the c++ command with
658 "../db-2.4.14/dist/libdb.a" This problem has been resolved as of
659 version 3.1.0.</p>
660
661 <strong>3.4. <a name="q3.4">I'm compiling on FreeBSD and I get lots
662 of messages about '___error' being unresolved.</a></strong><br>
663 <p>Answer contributed by Laura Wingerd &lt;[email protected]&gt;<br>
664 I got a clean build of htdig-3.1.2 on FreeBSD 2.2.8 by taking
665 -D_THREAD_SAFE out of CPPFLAGS, and setting LIBS to null, in
666 db/dist/configure.</p>
667
668 <strong>3.5. <a name="q3.5">I'm compiling on HP/UX and I get a complaint about
669 "Large Files not supported."</a></strong><br>
670 <p>The db/ pacakge, included with ht://Dig seems to be unable to complete
671 on HP/UX 10.20 in particular. After running the top-level configure
672 script, cd into db/dist and type:</p>
673 <code>./configure --disable-bigfile</code>
674 <p>Then continue with the normal compilation.</p>
675
676 <strong>3.6. <a name="q3.6">I'm compiling on Solaris and when I run the
677 programs I get complaints about not finding libstdc++.</a></strong><br>
678 <p>Answer contributed by Adam Rice &lt;[email protected]&gt;</p>
679 <p>The problem is that the Solaris loader can't find the library. The
680 best thing to do is set the LD_RUN_PATH environment variable <em>during compile</em>
681 to the directory where libstdc++.so.2.8.1.1 lives. This tells the linker
682 to search that directory at runtime.
683 </p>
684
685 <p>Note that LD_RUN_PATH is not to be confused with LD_LIBRARY_PATH.
686 The latter is parsed at run-time, while LD_RUN_PATH essentially
687 compiles in a library path into the executable, so that it doesn't
688 need a LD_LIBRARY_PATH setting to find its libraries. This allows
689 you to avoid all the complexities of setting an environment
690 variable for a CGI program run from the server. If all else fails,
691 you can always run your programs from wrapper shell scripts that
692 set the LD_LIBRARY_PATH environment variable appropriately.</p>
693
694 <p>Note also that while this answer is specific to Solaris, it may
695 work for other OSes too, so you may want to give it a try. However,
696 not all versions of the <code>ld</code> program on all OSes support
697 the LD_RUN_PATH environment variable, even if these systems support
698 shared libraries. Try "<code>man&nbsp;ld</code>" on your system to
699 find out the best way of setting the runtime search path for shared
700 libraries. If <code>ld</code> doesn't support LD_RUN_PATH, but does
701 support the <code>-R</code> option, you can add one or more of these
702 options to LIBDIRS in Makefile.config before running make on a 3.1.x
703 release. (For a 3.2 beta release, you can add these options to the
704 LDFLAGS environment variable before you run ./configure.)</p>
705
706 <strong>3.7. <a name="q3.7">I'm compiling on IRIX and I'm having
707 database problems when I run the program.</a></strong><br>
708 <p>
709 It is not entirely clear why these problems occur, though
710 they seem to only happen when older compilers are
711 used. Several people have reported that the problems go away
712 when using the latest version of <a href="http://gcc.gnu.org/">gcc</a>.
713 </p>
714
715 <strong>3.8. <a name="q3.8">I'm compiling with gcc 3.2 and getting
716 all sorts of warnings/errors about ostream and such.</a></strong><br>
717 <p>
718 With versions before 3.2.0b5,
719 you should use the following command to configure the ht://Dig
720 package so it can be built with gcc 3.2:
721 <pre>
722 CXXFLAGS=-Wno-deprecated CPPFLAGS=-Wno-deprecated ./configure
723 </pre>
724 </p>
725
726 <hr noshade size=2>
727
728 <h3>4. Configuration</h3>
729 <strong>4.1. <a name="q4.1">How come I can't index my site?</a></strong><br>
730 <p>There are a variety of reasons ht://Dig won't index a
731 site. To get to the bottom of things, it's advisable to turn on
732 some debugging output from the htdig program. When running from
733 the command-line, try "-vvv" in addition to any other
734 flags. This will add debugging output, including the responses
735 from the server.</p>
736 <p>See also questions <a href="#q5.25">5.25</a>,
737 <a href="#q5.27">5.27</a>, <a href="#q5.16">5.16</a> and
738 <a href="#q5.18">5.18</a>.</p>
739
740 <strong>4.2. <a name="q4.2">How can I change the output format of htsearch?</a></strong><br>
741 <p>Answer contributed by: Malki Cymbalista &lt;[email protected]&gt;</p>
742
743 <p>You can change the output format of htsearch by creating different
744 header, footer and result files that specify how you want the output
745 to look. You then create a configuration file that specifies which
746 files to use. In the html document that links to the search, you
747 specify which configuration file to use.</p>
748
749 <p>So the configuration file would have the lines:</p>
750 <pre>
751 search_results_header: ${common_dir}/ccheader.html
752 search_results_footer: ${common_dir}/ccfooter.html
753 template_map: Long long builtin-long \
754 Short short builtin-short \
755 Default default ${common_dir}/ccresult.html
756 template_name: Default
757 </pre>
758 <p>You would also put into the configuration file any other lines from the
759 default configuration file that apply to htsearch.</p>
760
761 <p>The files ${common_dir}/ccheader.html and
762 ${common_dir}/ccfooter.html and ${common_dir}/ccresult.html would be
763 tailored to give the output in the desired format.</p>
764
765 <p>Assuming your configuration file is called cc.conf, the html file that
766 links to the search has to set the config parameter equal to cc. The
767 following line would do it:<br>
768 <code>&lt;input type="hidden" name="config" value="cc"&gt;</code></p>
769
770 <p><strong>Note:</strong> Don't just add the line above to your
771 <a href="hts_form.html">search form</a>
772 without checking if there isn't already a similar
773 line giving the config attribute a different value. The sample
774 search.html form that comes with the package includes a line
775 like this already, giving "config" the default value of "htdig".
776 If it's there, modify it instead of adding another definition.
777 The config input parameter doesn't need to be hidden either, and
778 you may want to define it as a pull-down list to select different
779 databases (see question <a href="#q4.4">4.4</a>).</p>
780
781 <strong>4.3. <a name="q4.3">How do I index pages that start with '~'?</a></strong><br>
782 <p>
783 ht://Dig should index pages starting with '~' as if it was another
784 web browser. If you are having problems with this, check your server
785 log files to see what file the server is attempting to return.
786 </p>
787
788 <strong>4.4. <a name="q4.4">Can I use multiple databases?</a></strong><br>
789 <p>Yes, though you may find it easier to have one larger
790 database and use restrict or exclude fields on searches. To use
791 multiple databases, you will need a config file for each
792 database. Then each file will set the
793 <a href="attrs.html#database_dir">database_dir</a> or
794 <a href="attrs.html#database_base">database_base</a> attribute to
795 change the name of the databases. The config file is selected
796 by the <strong>config</strong> input field in the search form.
797 <br>See also questions <a href="#q4.2">4.2</a> and
798 <a href="#q4.20">4.20</a>.</p>
799
800 <strong>4.5. <a name="q4.5">OK, I can use multiple databases. Can I
801 merge them into one?</a></strong><br>
802 <p>As of version 3.1.0, you can do this with the -m option to
803 <a href="htmerge.html">htmerge</a>.</p>
804
805 <strong>4.6. <a name="q4.6">Wow, ht://Dig eats up a lot of disk
806 space. How can I cut down?</a></strong><br>
807 <p>There are several ways to cut down on disk space. One is
808 not to use the "-a" option, which creates work copies of the
809 databases. Naturally this essentially doubles the disk
810 usage. If you don't need to index and search at the same time, you can
811 ignore this flag.</p>
812
813 <p>If you are running 3.2.0b5 or higher and don't have
814 <a href="dev/htdig-3.2/attrs.html#wordlist_compress_zlib">compression</a>
815 turned on, then turning that on will also save considerable space.</p>
816
817 <p>Changing configuration variables can also help cut
818 down on disk usage. Decreasing
819 <a href="attrs.html#max_head_length">max_head_length</a> and
820 <a href="attrs.html#max_meta_description_length">max_meta_description_length</a>
821 will cut down on the size of the excerpts stored (in fact, if you
822 don't have
823 <a href="attrs.html#use_meta_description">use_meta_description</a>
824 set, you can set
825 max_meta_description_length to 0!).</p>
826
827 <p>If you are running 3.2.0b6 or higher, you can turn off
828 <a href="dev/htdig-3.2/attrs.html#store_phrases">store_phrases</a>. This cuts the
829 database size by about 60%, at the expense of severely limiting
830 the effectiveness of phrase searches. It also reduces digging time
831 slightly.</p>
832
833 <p>Other techniques include removing the db.wordlist file and adding
834 more words to the <a href="attrs.html#bad_words">bad_words</a>
835 file.</p>
836
837 <p>The University of Leipzig has published
838 <a href="http://wortschatz.uni-leipzig.de/html/wliste.html">
839 word lists</a> containing the 100, 1000 and 10000 most often used
840 words in English, German, French and Dutch. No copyrights or
841 restrictions seem to be applied to the downloadable files. These
842 can be very handy when putting together a bad_words file. Thanks
843 to Peter Asemann for this tip.</p>
844
845 <strong>4.7. <a name="q4.7">Can I use SSI or other CGIs in my
846 htsearch results?</a></strong><br>
847 <p>Not really. Apache will not parse CGI output for SSI
848 statements (See the <a
849 href="http://www.apache.org/docs/misc/FAQ.html#ssi-part-iii">Apache
850 FAQ</a>). Thus,the htsearch CGI does not understand SSI
851 markup and thus cannot include other
852 CGIs. However, it is possible doing it the other way round:
853 you can have the htsearch results included in your dynamic
854 page.
855 </p>
856 <p>
857 The Apache project has mentioned that this will be a
858 feature added to the Apache 2.0 version, currently in development.
859 </p>
860
861 <p>The easiest approach in the meantime is using SSI with
862 the help of the <a
863 href="attrs.html#script_name">script_name</a> configuration
864 file attribute. See the <code>contrib/scriptname</code>
865 directory for a small example using SSI.</p>
866
867 <p>For CGI and PHP, you need a &quot;wrapper&quot; script to
868 do that. For perl script examples, see the files in
869 <code>contrib/ewswrap</code>. The PHP guide (see <a
870 href="http://www.htdig.org/contrib/guides.html">contributed
871 guides</a>) not only describes a wrapper script for PHP, but
872 also offers a step by step tutorial to the basics of
873 ht://dig and is well worth reading.
874 For other alternatives, see question <a href="#q4.11">4.11</a>.
875 </p>
876
877 <strong>4.8. <a name="q4.8">How do I index Word, Excel, PowerPoint
878 or PostScript documents?</a></strong><br>
879 <p>This must be done with an
880 <a href="attrs.html#external_parsers">external parser or converter</a>.
881 A sample of such an external converter is the
882 contrib/doc2html/doc2html.pl Perl script.
883 It will parse Word, PostScript, PDF and other documents, when used
884 with the appropriate document to text converters. It uses catdoc to
885 parse Word documents, and ps2ascii to parse PostScript files. The
886 comments in the Perl script and accompanying documentation
887 indicate where you can obtain these converters.</p>
888
889 <p>Versions of htdig before 3.1.4 don't support external converters,
890 so you have to use an external parser script such as
891 contrib/parse_doc.pl (or better yet, upgrade htdig if you can).
892 External converter scripts are simpler to write and maintain than a
893 full external parser, as they just convert input documents to
894 text/plain or text/html, and pass that back to htdig to be parsed.
895 Parsing is more consistent across document types with external
896 converters, because the final work is done by htdig's internal
897 parsers. External parser scripts tend to be hacks that don't
898 recognize a lot of the parsing attributes in your htdig.conf, so
899 they have to be hacked some more when you change your attributes.</p>
900
901 <p>The most recent versions of parse_doc.pl, conv_doc.pl and
902 the doc2html package are available on our <a
903 href="http://www.htdig.org/files/contrib/parsers/">web site</a>.<br>
904 See below for an example of doc2html.pl, or see the comments in
905 conv_doc.pl and parse_doc.pl, or the documentation for doc2html
906 for examples of their usage.
907 For help with troubleshooting, see questions
908 <a href="#q5.37">5.37</a> and <a href="#q5.39">5.39</a>.</p>
909
910 <strong>4.9. <a name="q4.9">How do I index PDF files?</a></strong><br>
911 <p>This too can be done with an
912 <a href="attrs.html#external_parsers">external parser or converter</a>,
913 in combination with the pdftotext program that is part of the
914 <a href="http://www.foolabs.com/xpdf/">xpdf</a> 0.90 package. A
915 sample of such a converter is the doc2html.pl Perl
916 script. It uses pdftotext to parse PDF documents, then processes
917 the text into external parser records.
918 The most recent version of doc2html.pl is available on our <a
919 href="http://www.htdig.org/files/contrib/parsers/">web
920 site</a>.</p>
921
922 <p>For example, you could put this in your configuration file:</p>
923 <pre>
924 <a href="attrs.html#external_parsers">external_parsers</a>: application/msword-&gt;text/html /usr/local/bin/doc2html.pl \
925 application/postscript-&gt;text/html /usr/local/bin/doc2html.pl \
926 application/pdf-&gt;text/html /usr/local/bin/doc2html.pl
927 </pre>
928 <p>You would also need to configure the script to indicate where all
929 of the document to text converters are installed. See the DETAILS
930 file that comes with doc2html for more information.</p>
931
932 <p>Versions of htdig before 3.1.4 don't support external converters,
933 so you have to use an external parser script such as
934 contrib/parse_doc.pl (or better yet, upgrade htdig if you can).
935 See question <a href="#q4.8">4.8</a> above.</p>
936
937 <p>Whether you use this external parser or converter, or acroread
938 with the <a href="attrs.html#pdf_parser">pdf_parser</a> attribute,
939 to successfully index PDF files be sure to set the <a
940 href="attrs.html#max_doc_size">max_doc_size</a> attribute to
941 a value larger than the size of your largest PDF file. PDF
942 documents can not be parsed if they are truncated.</p>
943
944 <p>This also raises the questions of why two different
945 methods of indexing PDFs are supported, and which method
946 is preferred. The built-in PDF support, which uses acroread
947 to convert the PDF to PostScript, was the first method which
948 was provided. It had a few problems with it: acroread is not
949 open source, it is not supported on all systems on which
950 ht://Dig can run, and for some PDFs, the PostScript that
951 acroread generated was very difficult to parse into indexable
952 text. Also, the built-in PDF support expected PDF documents to
953 use the same character encoding as is defined in your current
954 <a href="attrs.html#locale">locale</a>, which isn't always the
955 case. The external converters, which use pdftotext, were developed
956 to overcome these problems. xpdf 0.90 is free software, and its
957 pdftotext utility works very well as an indexing tool.
958 It also converts various PDF encodings to the Latin 1 set.
959 It is the opinion of the developers that this is the
960 preferred method. However, some users still prefer to stick
961 with acroread, as it works well for them, and is a little
962 easier to set up if you've already installed Acrobat.</p>
963
964 <p>Also, pdftotext still has some difficulty handling text in
965 landscape orientation, even with its new -raw option in 0.90,
966 so if you need to index such text in PDFs, you may still get
967 better results with acroread. The pdf_parser attribute has been
968 removed from the 3.2 beta releases of htdig, so to use acroread
969 with htdig 3.2.0b5 or other 3.2 betas, use the acroconv.pl
970 external converter script from our <a
971 href="http://www.htdig.org/files/contrib/parsers/">web site</a>.</p>
972
973 <p>See also question <a href="#q5.2">5.2</a> below and
974 question <a href="#q1.13">1.13</a> above.
975 See questions <a href="#q5.37">5.37</a> and <a href="#q5.39">5.39</a>
976 for troubleshooting tips.</p>
977
978 <strong>4.10. <a name="q4.10">How do I index documents in other
979 languages?</a></strong><br>
980 <p>The first and most important thing you must do,
981 to allow ht://Dig to properly support international
982 characters, is to define the correct locale for the
983 language and country you wish to support. This is done
984 by setting the <a href="attrs.html#locale">locale</a>
985 attribute (see question <a href="#q5.8">5.8</a>). The
986 next step is to configure ht://Dig to use dictionary and
987 affix files for the language of your choice. These can
988 be the same dictionary and affix files as are used by the
989 ispell software. A collection of these is available from
990 Geoff Kuenning's
991 <a href="http://fmg-www.cs.ucla.edu/geoff/ispell-dictionaries.html">
992 International Ispell Dictionaries page</a>, and we're slowly
993 building a collection of word lists on our <a
994 href="http://www.htdig.org/files/contrib/wordlists/">web site</a>.</p>
995 <p>For example, if you install German dictionaries in common/german,
996 you could use these lines in your configuration file:</p>
997 <pre>
998 <a href="attrs.html#locale">locale</a>: de_DE
999 lang_dir: ${<a href="attrs.html#common_dir">common_dir</a>}/german
1000 <a href="attrs.html#bad_word_list">bad_word_list</a>: ${lang_dir}/bad_words
1001 <a href="attrs.html#endings_affix_file">endings_affix_file</a>: ${lang_dir}/german.aff
1002 <a href="attrs.html#endings_dictionary">endings_dictionary</a>: ${lang_dir}/german.0
1003 <a href="attrs.html#endings_root2word_db">endings_root2word_db</a>: ${lang_dir}/root2word.db
1004 <a href="attrs.html#endings_word2root_db">endings_word2root_db</a>: ${lang_dir}/word2root.db
1005 </pre>
1006 <p>
1007 You can build the endings database with <code>htfuzzy endings</code>.
1008 (This command may actually take days to complete, for
1009 releases older than 3.1.2. Current releases use faster regular
1010 expression matching, which will speed this up by a few orders
1011 of magnitude.) Note that the "*.0" files are not part of
1012 the ispell dictionary distributions, but are easily made by
1013 concatenating the partial dictionaries and sorting to remove
1014 duplicates (e.g.: "<code>cat * | sort | uniq &gt; lang.0</code>"
1015 in most cases). You will also need to redefine the synonyms
1016 file if you wish to use the synonyms search algorithm. This
1017 file is not included with most of the dictionaries, nor is the
1018 <a href="attrs.html#bad_words">bad_words</a> file.</p>
1019
1020 <p>If you put all the language-specific
1021 dictionaries and configuration files in separate directories,
1022 and set all the attribute definitions accordingly in each
1023 search config file to access the appropriate files, you can
1024 have a multilingual setup where the user selects the language
1025 by selecting the "config" input parameter value. In addition
1026 to the attributes given in the example above, you may also
1027 want custom settings for these language-specific attributes:
1028 <a href="attrs.html#date_format">date_format</a>,
1029 <a href="attrs.html#iso_8601">iso_8601</a>,
1030 <a href="attrs.html#method_names">method_names</a>,
1031 <a href="attrs.html#no_excerpt_text">no_excerpt_text</a>,
1032 <a href="attrs.html#no_next_page_text">no_next_page_text</a>,
1033 <a href="attrs.html#no_prev_page_text">no_prev_page_text</a>,
1034 <a href="attrs.html#nothing_found_file">nothing_found_file</a>,
1035 <a href="attrs.html#page_list_header">page_list_header</a>,
1036 <a href="attrs.html#prev_page_text">prev_page_text</a>,
1037 <a href="attrs.html#search_results_wrapper">search_results_wrapper</a>
1038 (or <a href="attrs.html#search_results_header">search_results_header</a>
1039 and <a href="attrs.html#search_results_footer">search_results_footer</a>),
1040 <a href="attrs.html#sort_names">sort_names</a>,
1041 <a href="attrs.html#synonym_db">synonym_db</a>,
1042 <a href="attrs.html#synonym_dictionary">synonym_dictionary</a>,
1043 <a href="attrs.html#syntax_error_file">syntax_error_file</a>,
1044 <a href="attrs.html#template_map">template_map</a>, and of course
1045 <a href="attrs.html#database_dir">database_dir</a> or
1046 <a href="attrs.html#database_base">database_base</a> if you
1047 maintain multiple databases for sites of different languages.
1048 You could also change the definition of
1049 <a href="attrs.html#common_dir">common_dir</a>, rather than
1050 making up a lang_dir attribute as above, as many language-specific
1051 files are defined relative to the common_dir setting.</p>
1052
1053 <p>If you're running version 3.1.6 of ht://Dig, you may also
1054 be interested in the <strong>accents</strong> fuzzy match
1055 algorithm in the
1056 <a href="attrs.html#search_algorithm">search_algorithm</a>
1057 attribute, which lets you treat accented and unaccented letters
1058 as equivalent in words. Note that if you use the accents algorithm,
1059 you need to rebuild the accents database each time you update your
1060 word database, using <code>"htfuzzy accents"</code>. This command
1061 isn't in the default rundig script, so you may want to add it there.
1062 The accents fuzzy match algorithm is also in the 3.2 beta releases.
1063 There are also the
1064 <a href="attrs.html#boolean_keywords">boolean_keywords</a> and
1065 <a href="attrs.html#boolean_syntax_errors">boolean_syntax_errors</a>
1066 attributes in 3.1.6 for changing other language-specific messages
1067 in htsearch.</p>
1068
1069 <p>Current versions of ht://Dig only support 8-bit
1070 characters, so languages such as Chinese and Japanese, which
1071 require 16-bit characters, are not currently supported.</p>
1072
1073 <p>Didier Lebrun has written a guide for configuring htdig to
1074 support French, entitled
1075 <a href="http://www.quartier-rural.org/dl/elucu/htdig-vf/lisezmoi.html">
1076 Comment installer et configurer HtDig pour la langue fran&ccedil;aise</a>.
1077 His "kit de francisation" is also available on
1078 <a
1079 href="http://www.htdig.org/files/contrib/wordlists/">our
1080 web site</a>.</p>
1081
1082 <p>See also question <a href="#q4.2">4.2</a> for tips on customizing
1083 htsearch, and question <a href="#q4.6">4.6</a> for tips where to find
1084 bad_words files.</a></p>
1085
1086 <strong>4.11. <a name="q4.11">How do I get rotating banner ads in
1087 search results?</a></strong><br>
1088 <p>While htsearch doesn't currently provide a means of doing
1089 SSI on its output, or calling other CGI scripts, it does have
1090 the capability of using environment variables in templates.</p>
1091
1092 <p>The easiest way to get rotating banners in htsearch is
1093 to replace htsearch with a wrapper script that sets an
1094 environment variable to the banner content, or whatever
1095 dynamically generated content you want. Your script can then
1096 call the real htsearch to do the work. The wrapper script can be
1097 written as a shell script, or in Perl, C, C++, or whatever you
1098 like. You'd then need to reference that environment variable
1099 in header.html (or wrapper.html if that's what you're using),
1100 to indicate where the dynamic content should be placed.</p>
1101
1102 <p>If the dynamic content is generated by a CGI script, your new
1103 wrapper script which calls this CGI would then have to strip out
1104 the parts that you don't want embedded in the output (headers,
1105 some tags) so that only the relevant content gets put into the
1106 environment variable you want. You'd also have to make sure
1107 this CGI script doesn't grab the POST data or get confused by
1108 the QUERY_STRING contents intended for htsearch. Your script
1109 should not take anything out of, or add anything to, the
1110 QUERY_STRING environment variable.</p>
1111
1112 <p>An alternative approach is to have a cron job that periodically
1113 regenerates a different header.html or wrapper.html with the
1114 new banner ad, or changes a link to a different pre-generated
1115 header.html or wrapper.html file. For other alternatives, see
1116 question <a href="#q4.7">4.7</a>.</p>
1117
1118 <strong>4.12. <a name="q4.12">How do I index numbers in documents?</a></strong><br>
1119 <p>By default, htdig doesn't treat numbers without letters
1120 as words, so it doesn't index them.
1121 To change this behavior, you must set the
1122 <a href="attrs.html#allow_numbers">allow_numbers</a>
1123 attribute to true, and rebuild your index from scratch using
1124 rundig or htdig with the -i option, so that bare numbers get
1125 added to the index.</p>
1126
1127 <strong>4.13. <a name="q4.13">How can I call htsearch from a hypertext
1128 link, rather than from a search form?</a></strong><br>
1129 <p>If you change the search.html form to use the GET method
1130 rather than POST, you can see the URLs complete with all the
1131 arguments that htsearch needs for a query. Here is an example:<br>
1132 <code>
1133 http://www.grommetsRus.com/cgi-bin/htsearch?config=htdig&amp;restrict=&amp;exclude=&amp;method=and&amp;format=builtin-long&amp;words=grapple+grommets
1134 </code>
1135 which can actually be simplified to:<br>
1136 <code>
1137 http://www.grommetsRus.com/cgi-bin/htsearch?method=and&amp;words=grapple+grommets
1138 </code>
1139 with the current defaults. The "&amp;" character acts as a
1140 separator for the input parameters, while the "+" character
1141 acts as a space character within an input parameter.
1142 In versions 3.1.5 or 3.2.0b2, or later, you can use a semicolon
1143 character ";" as a parameter separator, rather than "&amp;", for
1144 HTML 4.0 compliance.
1145 Most non-alphanumeric characters should be hex-encoded following
1146 the convention for URL encoding (e.g. "%" becomes "%25", "+"
1147 becomes "%2B", etc). Any htsearch input parameter that you'd
1148 use in a search form can be added to the URL in this way.
1149 This can be embedded into an &lt;a href="..."&gt; tag.
1150 <br>See also question <a href="#q5.21">5.21</a>.</p>
1151
1152 <strong>4.14. <a name="q4.14">How do I restrict a search to only meta
1153 keywords entries in documents?</a></strong><br>
1154 <p>First of all, you do <strong>not</strong> do this by using the
1155 "keywords" field in the search form. This seems to be a
1156 frequent cause of confusion. The "keywords" input parameter
1157 to htsearch has absolutely nothing to do with searching meta
1158 keywords fields. It actually predates the addition of meta
1159 keyword support in 3.1.x. A better choice of name for the
1160 parameter would have been "requiredwords", because that's what
1161 it really means - a list of words that are all required to be
1162 found somewhere in the document, in addition to the words the
1163 user specifies in the search form.</p>
1164
1165 <p>As of 3.2.0b5, the most direct way to search for a particular
1166 meta keyword is to specify the word as "keyword:&lt;word&gt;".
1167 Similarly, "title:", "heading:", and "author:" restrict searches
1168 to the respective fields. To search for words in the body of the
1169 text, use "text:".</p>
1170
1171 <p>To restrict all search terms to meta keywords only, you can set all
1172 <a href="attrs.html#heading_factor">factors</a> other than
1173 keywords_factor to 0, and for 3.1.x, you
1174 must then reindex your documents. In the 3.2 betas, you can
1175 change factors at search time without needing to reindex.
1176 As of 3.2.0b5, it is possible to restrict
1177 the search in the query itself. Note that changing the scoring
1178 factors in this way will only alter the scoring of search results,
1179 and shift the low or zero scores to the end of the results when
1180 sorting by score (as is done by default). For versions before
1181 3.2.0b5, the results with scores
1182 of zero aren't actually removed from the search results.</p>
1183
1184 <strong>4.15. <a name="q4.15">Can I use meta tags to prevent htdig from
1185 indexing certain files?</a></strong><br>
1186 <p>Yes, in each HTML file you want to exclude, add the following
1187 between the &lt;HEAD&gt; and &lt;/HEAD&gt; tags:</p>
1188 <blockquote>
1189 &lt;META NAME="robots" CONTENT="noindex, follow"&gt;
1190 </blockquote>
1191 <p>Doing so will allow htdig to still follow links to other documents,
1192 but will prevent this document from being put into the index itself.
1193 You can also use "nofollow" to prevent following of links. See
1194 the section on <a href="meta.html">Recognized META information</a>
1195 for more details. For documents produced automatically by MhonArc,
1196 you can have that line inserted automatically by putting it in the
1197 MhonArc resource file, in the sections IDXPGBEGIN and TIDXPGBEGIN.</p>
1198
1199 <p>You can also use the
1200 <a href="attrs.html#noindex_start">noindex_start</a> and
1201 <a href="attrs.html#noindex_end">noindex_end</a> attributes to
1202 define one set of tags which will mark sections to be stripped out
1203 of documents, so they don't get indexed, or you can mark sections
1204 with the non-DTD &lt;noindex&gt; and &lt;/noindex&gt; tags.
1205 The noindex_start and noindex_end attributes can also be used to
1206 suppress in-line JavaScript code that wasn't properly enclosed in
1207 HTML comment tags (see question <a href="#q4.26">4.26</a>).
1208 In 3.1.6, you can also put a section between &lt;noindex follow&gt;
1209 and &lt;/noindex&gt; tags to turn off indexing of text but still
1210 allow htdig to follow links.</p>
1211
1212 <p>If you require much more elaborate schemes for avoiding indexing
1213 certain parts of your HTML files, especially if you don't have
1214 control over these files and can't add tags to them, you can
1215 set up htdig's
1216 <a href="attrs.html#external_parsers">external_parsers</a> attribute
1217 with an external converter that will preprocess the HTML before
1218 it's parsed and indexed by htdig. Examples of this are the
1219 unhypermail.sh script in our
1220 <a href="http://www.htdig.org/files/contrib/parsers/">contributed parsers</a>
1221 and the ungeoify.sh script in our
1222 <a href="http://www.htdig.org/files/contrib/scripts/">contributed scripts</a>.
1223 By preprocessing the HTML, you can strip out parts you don't want, or
1224 you can add or change tags wherever they're needed, if you're willing
1225 to put in the effort to learn awk/sed/perl enough to do the job.</p>
1226
1227 <strong>4.16. <a name="q4.16">How do I get htsearch to use the star image
1228 in a different directory than the default /htdig?</a></strong><br>
1229 <p>You must set either the
1230 <a href="attrs.html#image_url_prefix">image_url_prefix</a> attribute,
1231 or both <a href="attrs.html#star_blank">star_blank</a> and
1232 <a href="attrs.html#star_image">star_image</a> in your
1233 htdig.conf, to refer to the URL path for these files. You should
1234 also set this URL path similarly in in common/header.html and
1235 common/wrapper.html, as they also refer to the star.gif file.
1236 If you want to relocate other graphics, such as the buttons or
1237 the ht://Dig logo, you should change all references to these
1238 in htdig.conf and common/*.html.</p>
1239
1240 <strong>4.17. <a name="q4.17">How do I get htdig or htsearch to rewrite
1241 URLs in the search results?</a></strong><br>
1242 <p>This can be done by using the <a
1243 href="attrs.html#url_part_aliases">url_part_aliases</a>
1244 configuration file attribute. You have to set up different
1245 configuration files for htdig and htsearch, to define a
1246 different setting of this attribute for each one.</p>
1247
1248 <p>A large number of users insist on ignoring that last point
1249 and try to make do with just one definition, either for htdig
1250 or htsearch, or sometimes for both. This seems to stem from
1251 a fundamental misunderstanding of how this attribute works,
1252 so perhaps a clarification is needed. The url_part_aliases
1253 attribute uses a two stage process. In the first stage, htdig
1254 encodes the URLs as they go into the database, by using the
1255 pairs in url_part_aliases going from left to right. In the
1256 second stage, htsearch decodes the encoded URLs taken from the
1257 database, by using the pairs in url_part_aliases going from
1258 right to left. If you have the same value for url_part_aliases
1259 in htdig and htsearch, you end up with the same URLs in the
1260 end. If you modify the first string (the from string) in
1261 the pairs listed in url_part_aliases for htsearch, then when
1262 htsearch decodes the URLs it ends up rewriting part of them.</p>
1263
1264 <p>While you might think that if you don't use url_part_aliases
1265 in htdig, then you can use it in htsearch to alter unencoded
1266 URLs, the reality is that if you don't encode parts of URLs
1267 using url_part_aliases, they still get encoded automatically
1268 by the <a href="attrs.html#common_url_parts">common_url_parts</a>
1269 attribute. This helps to reduce the size of your databases. So,
1270 trying to use url_part_aliases only in htsearch doesn't work
1271 because there are no unencoded URLs in the database, so the
1272 right hand strings in the pairs you define won't match anything.</p>
1273
1274 <p>You also can't put two different definitions of the
1275 url_part_aliases attribute in a single configuration file, as
1276 some users have attempted. When you define an attribute twice,
1277 the second definition merely overrides the first. Pay close
1278 attention to the description and examples for
1279 <a href="attrs.html#url_part_aliases">url_part_aliases</a>.
1280 You must put one definition of this attribute in your
1281 configuration file for htdig, htmerge (or htpurge) and htnotify,
1282 and a different definition of it in your configuration file
1283 for htsearch.</p>
1284
1285 <strong>4.18. <a name="q4.18">What are all the options in
1286 htdig.conf, and are there others?</a></strong><br>
1287 <p>In ht://Dig's terminology, the settings in its configuration
1288 files are called <a href="attrs.html">configuration attributes</a>,
1289 to distinguish them from <a href="htdig.html">command line
1290 options</a>, <a href="hts_form.html">CGI input parameters</a>
1291 and <a href="hts_templates.html">template variables</a>. There are
1292 many, many attributes that can be set to control almost all
1293 aspects of indexing, searching, customization of output and
1294 internationalization. All attributes have a built-in default
1295 setting, and only a subset of these appear in the sample htdig.conf
1296 file. See the documentation for all default values for attributes
1297 not overridden in the configuration file, and for help on using
1298 any of them.
1299 See also question <a href="#q1.15">1.15</a>.</p>
1300
1301 <strong>4.19. <a name="q4.19">How do I get more than 10 pages of
1302 10 search results from htsearch?</a></strong><br>
1303 <p>There are two attributes that control the number of matches per
1304 page and the total number of pages. The number of matches per page
1305 can be set in your configuration file, using the
1306 <a href="attrs.html#matches_per_page">matches_per_page</a> attribute,
1307 or in your <a href="hts_form.html">search form</a>, using the
1308 <strong>matchesperpage</strong> input parameter.</p>
1309
1310 <p>The number of pages is controlled by the
1311 <a href="attrs.html#maximum_pages">maximum_pages</a> attribute in
1312 your search configuration file.
1313 The current default for maximum_pages is 10 because the ht://Dig
1314 package comes with 10 images, with numbers 1 through 10, for
1315 use as page list buttons. If we increased the limit, we'd have
1316 to field a whole lot more questions from users irate because
1317 only the first 10 buttons are graphics, and the rest are text.
1318 If you want more than 10 pages of results, change maximum_pages,
1319 but you may also want to set the
1320 <a href="attrs.html#page_number_text">page_number_text</a> and
1321 <a href="attrs.html#no_page_number_text">no_page_number_text</a>
1322 attributes in your search configuration file to nothing, or
1323 remove them, to use text rather than images for the links to
1324 other pages.</p>
1325
1326 <p>In version of htsearch before 3.1.4, maximum_pages
1327 limited only the number of page list buttons, and not the
1328 actual number of pages. This was changed because there was no
1329 means of limiting the total number of pages, but this ended up
1330 frustrating users who wanted the ability to have more pages than
1331 buttons. In 3.2.0b3 and 3.1.6 we introduced a
1332 <a href="attrs.html#maximum_page_buttons">maximum_page_buttons</a>
1333 attribute for this purpose.</p>
1334
1335 <strong>4.20. <a name="q4.20">How do I restrict a search to only
1336 certain subdirectories or documents?</a></strong><br>
1337 <p>That depends on whether you want to protect certain parts of
1338 your site from prying eyes, or just limit the scope of search
1339 results to certain relevant areas. For the latter, you just need
1340 to set the <strong>restrict</strong> or <strong>exclude</strong>
1341 input parameter in the <a href="hts_form.html">search form</a>.
1342 This can be done using hidden input fields containing preset
1343 values, text input fields, select lists, radio buttons or
1344 checkboxes, as you see fit. If you use select lists, you can
1345 propagate the choices to select lists in the follow-up search
1346 forms using the
1347 <a href="attrs.html#build_select_lists">build_select_lists</a>
1348 configuration attribute.
1349 The University at Albany has a good description of how to use
1350 the <strong>restrict</strong> or <strong>exclude</strong> input
1351 parameters: <a href="http://www.albany.edu/its/web/search/">
1352 Constructing a local search using ht://Dig Search forms</a>.
1353 <br>To include a hex encoded character (such as a %20 for a space)
1354 in a restrict or exclude string, the '%' must again be encoded.
1355 For example, to match a filename containing a space, the URL must
1356 contain %20, and so the CGI parameter passed to htsearch must
1357 contain %2520. The %25 encodes the '%'. (Note that this is only
1358 necessary for CGI input parameters, not for the corresponding
1359 configuration attributes in your htdig.conf file, as attributes
1360 aren't subjected to the same hex decoding step as parameters are.)
1361 <br>See also question <a href="#q4.4">4.4</a>.</p>
1362
1363 <p>If you wish to keep secure and non-secure areas on
1364 your site separate, and avoid having unauthorized users
1365 seeing documents from secure areas in their search results,
1366 that takes a bit more effort. You certainly can't rely on
1367 the <strong>restrict</strong> and <strong>exclude</strong>
1368 parameters, or even the <strong>config</strong> parameter,
1369 as any parameter in a search form can also be overridden
1370 by the user in a URL with CGI parameters. The safest
1371 option would be to host the secure and non-secure areas on
1372 separate servers with independent installations of htsearch,
1373 each with its own ht://Dig database, but that is often too
1374 costly or impractical an option. The next best thing is to
1375 host them on the same site, but make sure that everything
1376 is very clearly separated to prevent any leakage of secure
1377 data. You should maintain separate databases for the secure
1378 and public areas of your site, by setting up different htdig
1379 configuration files for each area. Use different settings
1380 of the <a href="attrs.html#start_url">start_url</a>,
1381 <a href="attrs.html#limit_urls_to">limit_urls_to</a>
1382 and <a href="attrs.html#database_dir">database_dir</a>
1383 configuration attributes, and possibly even different
1384 <a href="attrs.html#common_dir">common_dir</a> settings as well.
1385 Make sure your database_dir, and even your common_dir, are not
1386 in any directories accessible from the web server. Run htdig
1387 and htmerge (or rundig) with each separate configuration file,
1388 to build your two databases.</p>
1389
1390 <p>The tricky part is to make sure your htsearch program is
1391 secure. You don't want to use the same htsearch for the secure
1392 and public sites, because otherwise the public site could
1393 access the configuration for the secure database, making its
1394 data publicly accessible. You must either compile two separate
1395 versions of htsearch, with different settings of the CONFIG_DIR
1396 <em>make</em> variable, or you must make a simple wrapper
1397 script for htsearch that overrides the compiled-in CONFIG_DIR
1398 setting by a different setting of the CONFIG_DIR environment
1399 variable. Make sure the CONFIG_DIR for the secure area is
1400 not a subdirectory of the CONFIG_DIR for the public area.
1401 In this way, you can maintain separate directories of config
1402 files for the public and secure sites, so that the secure
1403 config files are not accessible from the public htsearch.</p>
1404
1405 <p>Put the htsearch binary or wrapper script for the secure site
1406 in a different ScriptAlias'ed cgi-bin directory than the public
1407 one, and protect the secure cgi-bin with a .htaccess file or
1408 in your server configuration. Alternatively, you can put the
1409 secure program, let's call it htssearch, in the same cgi-bin,
1410 but protect that one CGI program in your server configuration,
1411 e.g.:</p>
1412 <pre>
1413 &lt;Location /cgi-bin/htssearch&gt;
1414 AuthType Basic
1415 AuthName ....
1416 AuthUserFile ...
1417 AuthGroupFile ...
1418 &lt;Limit GET POST&gt;
1419 require group foo
1420 &lt;/Limit&gt;
1421 &lt;/Location&gt;
1422 </pre>
1423 <p>This describes the setup for an Apache server. You'd need to
1424 work out an equivalent configuration for your server if you're
1425 not running Apache.</p>
1426
1427 <strong>4.21. <a name="q4.21">How can I allow people to search
1428 while the index is updating?</a></strong><br>
1429 <p>Answer contributed by Avi Rappoport &lt;[email protected]&gt;</p>
1430 <p>If you have enough disk space for two copies of the index
1431 database, use -a with the htdig and htmerge processes. This will
1432 make use of a copy of the index database with the extension
1433 ".work", and update the copy instead of the originals.
1434 This way, htsearch can use those originals while the update is
1435 going on. When it's done, you can move the .work versions to
1436 replace the originals, and htsearch will use them. The current
1437 rundig script will do this for you if you supply the -a flag
1438 to it. However, rundig builds the database from scratch each
1439 time you run it. If you want to update an alternate copy of
1440 the database, see the
1441 <a href="http://www.htdig.org/files/contrib/scripts/rundig.sh">contributed
1442 rundig.sh script</a>.</p>
1443
1444 <strong>4.22. <a name="q4.22">How can I get htdig to ignore the
1445 robots.txt file or meta robots tags?</a></strong><br>
1446 <p>You can't, and you shouldn't. The
1447 <a href="http://www.robotstxt.org/wc/norobots.html">
1448 Standard for Robot Exclusion</a> exists for a very good reason,
1449 and any well behaved indexing engine or spider should conform to it.
1450 If you have a problem with a robots.txt file, you really should
1451 take it up with the site's webmaster. If they don't have a problem
1452 with you indexing their site, they shouldn't mind setting up a
1453 User-agent entry in their robots.txt file with a name you both
1454 agree on. The user agent setting that htdig uses for matching
1455 entries in robots.txt can be changed via the
1456 <a href="attrs.html#robotstxt_name">robotstxt_name</a> attribute in
1457 your config file.</p>
1458
1459 <p>If you have a problem with a robots meta tag in a document
1460 (see question <a href="#q4.15">4.15</a>) you should take it up
1461 with the author or maintainer of that page. These tags are an
1462 all or nothing deal, as they can't be set up to allow some engines
1463 and disallow others. If htdig encounters them, it has to give the
1464 page's creator the benefit of the doubt and honour them. If
1465 exceptions to the rule are wanted, this should be done with a
1466 robots.txt file rather than a meta tag.</p>
1467
1468 <strong>4.23. <a name="q4.23">How can I get htdig not to index
1469 some directories, but still follow links?</a></strong><br>
1470 <p>You can simply add the directory name to your robots.txt file
1471 or to the <a href="attrs.html#exclude_urls">exclude_urls</a>
1472 attribute in your configuration, but that will exclude all files
1473 under that directory. If you want the files in that directory to
1474 be indexed, you have a couple options. You can add an index.html
1475 file to the directory, that will include a robots meta tag
1476 (see question <a href="#q4.15">4.15</a>) to prevent indexing,
1477 and will contain links to all your files in this directory.
1478 The drawback of this is that you must maintain the index.html
1479 file yourself, as it won't be automatically updated as new
1480 files are added to the directory.</p>
1481
1482 <p>The other technique you can use, if you want the directory
1483 index to be made by the web server, is to get the server to
1484 insert the robots meta tag into the index page it generates.
1485 In Apache, this is done using the
1486 <a href="http://httpd.apache.org/docs/mod/mod_autoindex.html#headername">HeaderName</a>
1487 and <a href="http://httpd.apache.org/docs/mod/mod_autoindex.html#indexoptions">IndexOptions</a>
1488 directives in the directory's <strong>.htaccess</strong> file.
1489 For example:</p>
1490 <pre> HeaderName .htrobots
1491 IndexOptions FancyIndexing SuppressHTMLPreamble
1492 </pre>
1493 <p>and in the .htrobots file:</p>
1494 <pre>&lt;HTML&gt;&lt;head&gt;
1495 &lt;META NAME="robots" CONTENT="noindex, follow"&gt;
1496 &lt;title&gt;Index of /this/dir&lt;/title&gt;
1497 &lt;/head&gt;
1498 </pre>
1499
1500 <p>If you don't mind getting just one copy of each directory,
1501 but want to suppress the multiple copies generated by Apache's
1502 FancyIndexing option, you can either turn off FancyIndexing or
1503 you can add "?D=A ?D=D ?M=A ?M=D ?N=A ?N=D ?S=A ?S=D" to
1504 the <a href="attrs.html#bad_querystr">bad_querystr</a> attribute
1505 (without the quotes) to suppress the alternately sorted views of
1506 the directory. For Apache 2.x, you'd use "C=D C=M C=N C=S O=A O=D"
1507 instead in your bad_querystr setting.</p>
1508
1509 <strong>4.24. <a name="q4.24">How can I get rid of duplicates in
1510 search results?</a></strong><br>
1511 <p>This depends on the cause of the duplicate documents. htdig
1512 does keep track of the URLs it visits, so it never puts the
1513 same URL more than once in the database. So, if you have
1514 duplicate documents in your search results, it's because the
1515 same document appears under different URLs. Sometimes the
1516 URLs vary only slightly, and in subtle ways, so you may have
1517 to look hard to find out what the variation is. Here are some
1518 common reasons, each requiring a different solution.</p>
1519
1520 <ul>
1521 <li>You're indexing a case insensitive web
1522 server (e.g. an NT based server), but the
1523 <a href="attrs.html#case_sensitive">case_sensitive</a> attribute is
1524 still set to true. In this case, if htdig encounters two URLs
1525 pointing to the same document, but the case of the letters in
1526 one is different than the other (even if it's only 1 letter),
1527 it will not treat them as the same URL.<br><br>
1528 <li>You have symbolic links (or hard links) to some of
1529 these documents, so they can be reached by several URLs.
1530 The solution here is to build an exclude list of URLs that
1531 are actually symbolic links, and putting these in
1532 <a href="attrs.html#exclude_urls">exclude_urls</a>
1533 (or in your robots.txt file). You can automate this using a
1534 technique similar to the find command in question
1535 <a href="#q5.25">5.25</a> which builds the start_url list, but
1536 adding a -type l to find symbolic links.<br><br>
1537 <li>You have copies of the same documents in different
1538 locations. This is similar to the symbolic link problem above,
1539 but harder to fix automatically.<br><br>
1540 <li>The duplicate URLs result from CGI, SSI or other dynamic pages
1541 that give the same content even though there may be variations in
1542 the query string or other parts of the URL. The approach to
1543 fix this is similar to the fix above, but may be less easy
1544 to automate, depending on what the variations are. You can
1545 add patterns to exclude_urls or bad_querystr to get rid of
1546 unwanted variations. These are especially important to bring
1547 under control, because in some cases, if left unchecked, they
1548 can result in an <em>infinite virtual hierarchy</em> which htdig
1549 will never be able to finish indexing. For example, in a CGI-based
1550 calendar, htdig could go on following next month or next
1551 year links to infinity, but this can be stopped by adding a
1552 stop year to <a href="attrs.html#bad_querystr">bad_querystr</a>.
1553 <br><br>Another common example happens when htdig hits a link
1554 to an SSI page and the URL has an extra trailing slash. This
1555 can happen with either .shtml pages or .html pages that use
1556 the XBitHack. The trailing slash causes the URL to be misinterpreted
1557 as a directory URL, and any relative URLs in the document are added
1558 to the URL, creating longer and longer URLs that still lead to the
1559 same SSI document. There are two things you can do:<ol>
1560 <li>hunt down the pages with the incorrect links, i.e.
1561 search for ".shtml/" or ".html/" in URLs in your documents,
1562 and fix these links; or
1563 <li>add .shtml/ and .html/ to your
1564 <a href="attrs.html#exclude_urls">exclude_urls</a>
1565 setting to get htdig to ignore these defective links.
1566 </ol>The second option is easier, but you run the risk that htdig
1567 will miss some SSI pages if the only links to them have the trailing
1568 slash, so you may want to try hunting down the links anyway.
1569 <br><br>See also question <a href="#q5.29">5.29</a>.<br><br>
1570 <li>The duplicates result from session IDs in PHP or other dynamic
1571 pages that give the same content even though the ID changes during
1572 the indexing process. This can lead not only to duplicates, but
1573 also to URLs that become unusable because of expired session IDs.
1574 Session IDs are the bane of search engines, and you should avoid
1575 using them if at all possible. If getting rid of them altogether
1576 isn't an option, then you can at least remove them while indexing,
1577 using the <a href="attrs.html#url_rewrite_rules">url_rewrite_rules</a>
1578 attribute. This will only work if htdig can access the documents
1579 without a session ID, as htdig rewrites the URL before fetching the
1580 document, and htsearch presents the rewritten URL (without session
1581 ID) in search results.
1582 </ul>
1583
1584 <strong>4.25. <a name="q4.25">How can I change the scores in
1585 search results, and what are the defaults?</a></strong><br>
1586 <p>The scores are calculated mostly by htdig at indexing time,
1587 with some tweaking done by htsearch at search time. There are
1588 a number of <a href="attrs.html">configuration attributes</a>,
1589 all called <em>&lt;something&gt;</em><strong>_factor</strong>,
1590 which can control the scoring calculations. In addition, the
1591 location of words within the document has an effect on score,
1592 as word scores are also multiplied by a varying location
1593 factor somewhere in between 1000 for words near the start
1594 and 1 for words near the end of the document. As of yet,
1595 there is no way to change this factor. For any of the scoring
1596 factors you can configure, and which are used by htdig, you
1597 will have to reindex your documents so the new factors take
1598 effect. The default values for these scoring factors, as well as
1599 information about whether they're used by htdig or htsearch,
1600 are all listed in the <a href="attrs.html">configuration
1601 attributes documentation</a>. Malcolm Austen has written some
1602 <a href="http://wwwsearch.ox.ac.uk/scores.html">notes on page
1603 scores</a> for 3.1.x which you may find helpful.</p>
1604
1605 <p>Note that the above applies to the 3.1.x releases, while
1606 in the 3.2 beta releases, all scores are calculated at search
1607 time with no weight being put on the location of words within
1608 the document.</p>
1609
1610 <strong>4.26. <a name="q4.26">How can I get htdig not to index
1611 JavaScript code or CSS?</a></strong><br>
1612 <p>The HTML parser in htdig recognizes and parses only HTML,
1613 which is all there should be within an HTML file. If your HTML
1614 files contain in-line JavaScript code or Cascading Style Sheets
1615 (CSS), these in-line codes, which are clearly not HTML, should
1616 be enclosed within an HTML comment tag so they are hidden
1617 from view from the HTML parser, or for that matter from any
1618 web client that is not JavaScript-aware or CSS-aware. See
1619 <a href="http://www.mcli.dist.maricopa.edu/show/interact/js_b.html">
1620 Behind the Scenes with JavaScript</a> for a description of the
1621 technique, which applies equally well to in-line style sheets.
1622 If fixing up all non-HTML compliant JavaScript or CSS code in
1623 your HTML files is not an option, then see question
1624 <a href="#q4.15">4.15</a> for an alternate technique.</p>
1625
1626 <p>The HTML parser in htdig 3.1.6 tries skipping over bare
1627 in-line JavaScript code in HTML, unlike previous versions,
1628 but a small bug in the parser causes it to be thrown off by a
1629 "&lt;" sign in the JavaScript, and it may then miss the closing
1630 &lt;/script&gt; tag. This can be fixed by applying this
1631 <a href="ftp://ftp.ccsf.org/htdig-patches/3.1.6/JavaScript.0">
1632 patch</a>.</p>
1633
1634 <hr noshade size=2>
1635
1636 <h3>5. Troubleshooting</h3>
1637 <strong>5.1. <a name="q5.1">I can't seem to index more than X documents
1638 in a directory.</a></strong><br>
1639 <p>This usually has to do with the default document size
1640 limit. If you set <a href="attrs.html#max_doc_size">
1641 max_doc_size</a> in your config file to
1642 something enough to read in the directory index (try 100000 for
1643 100K) this should fix this problem. Of course this will require
1644 more memory to read the larger file. Don't set it to a value
1645 larger than the amount of memory you have, and never more than
1646 about 2 billion, the maximum value of a 32-bit integer.
1647 If htdig is missing entire directories, see question
1648 <a href="#q5.25">5.25</a>.</p>
1649
1650 <strong>5.2. <a name="q5.2">I can't index PDF files.</a></strong><br>
1651 <p>As above, this usually has to do with the default document
1652 size. What happens is ht://Dig will read in part of a PDF file
1653 and try to index it. This usually fails. Try setting
1654 <a href="attrs.html#max_doc_size">max_doc_size</a>
1655 in your config file to a larger value than the
1656 size of your largest PDF file. Don't go overboard, though, as
1657 you don't want to overflow a 32-bit integer (about 2 billion),
1658 and you don't want to allocate much more memory than you need
1659 to store the largest document.</p>
1660
1661 <p>There is a bug in Adobe Acrobat Reader version 4, in its
1662 handling of the -pairs option, which causes a segmentation
1663 violation when using it with htdig 3.1.2 or earlier. There is
1664 a workaround for this as of version 3.1.3 - you must remove
1665 the -pairs option from your pdf_parser definition, if it's
1666 there. However, acroread version 4 is still very unstable (on
1667 Linux, anyway) so it is not recommended as a PDF parser. An
1668 alternative is to use an external converter with the xpdf 0.90
1669 package installed on your system, as described in question <a
1670 href="#q4.9">4.9</a> above.</p>
1671
1672 <strong>5.3. <a name="q5.3">When I run "rundig," I get a message about
1673 "DATABASE_DIR" not being found.</a></strong><br>
1674 <p>This is due to a bug in the Makefile.in file in version
1675 3.1.0b1. The easiest fix is to edit the rundig file and change
1676 the line "TMPDIR=@DATABASE_DIR@" to set TMPDIR to a directory
1677 with a large amount of temporary disk space for htmerge. This
1678 bug is fixed in version 3.1.0b2.</p>
1679
1680 <strong>5.4. <a name="q5.4">When I run htmerge, it stops with an "out
1681 of diskspace" message.</a></strong><br>
1682 <p>This means that htmerge has run out of temporary disk space
1683 for sorting. Either in your "rundig" script (if you run htmerge
1684 through that) or before you run htmerge, set the variable TMPDIR
1685 to a temp directory with lots of space.</p>
1686
1687 <strong>5.5. <a name="q5.5">I have problems running rundig from cron
1688 under Linux.</a></strong><br>
1689 <p>This problem commonly occurs on Red Hat Linux 5.0 and 5.1,
1690 because of a bug in vixie-cron. It causes htmerge to fail with a
1691 "Word sort failed" error. It's fixed in Red Hat 5.2.
1692 You can install vixie-cron-3.0.1-26.{arch}.rpm from a 5.2
1693 distribution to fix the problem on 5.0 or 5.1. A quick fix for
1694 the problem is to change the first line of rundig to "#!/bin/ash"
1695 which will run the script through the ash shell, but this doesn't
1696 solve the underlying problem.</p>
1697
1698 <strong>5.6. <a name="q5.6">When I run htmerge, it stops with an
1699 "Unexpected file type" message.</a></strong><br>
1700 <p>Often this is because the databases are corrupt. Try removing
1701 them and rebuilding. If this doesn't work, some have found that
1702 the solution for question <a href="#q3.2">3.2</a> works for this
1703 as well. This should be fixed in versions from 3.1.x</p>
1704
1705 <strong>5.7. <a name="q5.7">When I run htsearch, I get lots of Internal
1706 Server Errors (#500).</a></strong><br>
1707 <p>If you are running under Solaris, see <a href="#q3.6">3.6</a>.
1708 The solution for Solaris may also work for other OSes that use shared
1709 libraries in non-standard locations, so refer to question 3.6 if
1710 you suspect a shared library problem. In any case, check your web
1711 server error logs to see the cause of the internal server errors.
1712 If it's not a problem with shared libraries, there's a good chance
1713 that the error logs will still contain useful error messages that
1714 will help you figure out what the problem is.
1715 <br>See also questions <a href="#q5.13">5.13</a> and
1716 <a href="#q5.23">5.23</a>.</p>
1717
1718 <strong>5.8. <a name="q5.8">I'm having problems with indexing words
1719 with accented characters.</a></strong><br>
1720 <p>
1721 Most of the time, this is caused by either not setting or
1722 incorrectly setting the <a
1723 href="attrs.html#locale">locale</a> attribute. The default locale
1724 for most systems is the "portable" locale, which strips
1725 everything down to standard ASCII. Most systems expect
1726 something like <code>locale: en_US</code> or
1727 <code>locale: fr_FR</code>. Locale files are often found in
1728 <code>/usr/share/locale</code> or the <tt>$LANGUAGE</tt>
1729 environment variable. See also question <a href="#q4.10">4.10</a>.
1730 </p>
1731
1732 <p>Setting the locale correctly seems to be a frequent source of
1733 frustration for ht://Dig users, so here are a few pointers which
1734 some have found useful. First of all, if you don't have any luck
1735 with the settings of the <a href="attrs.html#locale">locale</a>
1736 attribute that you try, make sure you use a locale that is
1737 defined on your system. As mentioned above, these are usually
1738 installed in <code>/usr/share/locale</code>, so look there
1739 for a directory named for the locale you want to use. If
1740 you don't find it, but find something close, try that locale
1741 name. Note that the locale may not have to be specific to the
1742 language you're indexing, as long as it uses the same character
1743 set. E.g. most western European languages use the ISO-8859-1
1744 Latin 1 character set, so on most systems the locales for
1745 all these languages define the same character types table
1746 and can be used interchangeably. Some systems, however,
1747 define only the accented letters used for a given language,
1748 so "your mileage may vary." The important thing is that the
1749 directory for your locale definition <strong>must</strong>
1750 have a file named <code>LC_CTYPE</code> in it. For example,
1751 on many Linux distributions, a language-specific locale like
1752 <code>fr</code> won't contain this file, but country-specific
1753 locales like <code>fr_FR</code> or <code>fr_CA</code> will. If
1754 you don't find any appropriate locales installed on your system,
1755 try obtaining and installing the locale definition files from
1756 your OS distribution. Also, once you've set your locale, you need
1757 to reindex all your documents in order for the locale to take
1758 effect in the word database. This means rerunning the "rundig"
1759 script, or running "htdig -i" and htmerge (or htpurge in the 3.2
1760 betas).</p>
1761
1762 <p>Note also that some UNIX systems and libc5-based Linux
1763 systems just don't have a working implementation of locales,
1764 so you may not be able to get locales working at all on certain
1765 systems. The
1766 <a href="http://www.htdig.org/files/contrib/other/testlocale.c">testlocale.c</a>
1767 program on our web site can let you see the LC_CTYPE tables
1768 for any locale, to aid in finding one that works. Carefully
1769 follow the directions in the program's comments to know how to
1770 use it and what to look for in its output.</p>
1771
1772 <strong>5.9. <a name="q5.9">When I run htmerge, it stops with a
1773 "Word sort failed" message.</a></strong><br>
1774 <p>There are three common causes of this. First of all, the sort
1775 program may be running out of temporary file space. Fix this
1776 by freeing up some space where sort puts its temporary files,
1777 or change the setting of the TMPDIR environment variable to a
1778 directory on a volume with more space. A second common problem
1779 is on systems with a BSD version of the sort program (such as
1780 FreeBSD or NetBSD). This program uses the -T option as a record
1781 separator rather than an alternate temporary directory. On these
1782 systems, you must remove the TMPDIR environment variable from
1783 rundig, or change the code in htmerge/words.cc not to use the
1784 -T option. A third cause is the cron program on Red Hat Linux
1785 5.0 or 5.1. (See question <a href="#q5.5">5.5</a> above.)</p>
1786
1787 <strong>5.10. <a name="q5.10">When htsearch has a lot of matches, it runs
1788 extremely slowly.</a></strong><br>
1789 <p>When you run htsearch with no customization, on a
1790 large database, and it gets a lot of hits, it tends to
1791 take a long time to process those hits. Some users with
1792 large databases have reported much higher performance,
1793 for searches that yield lots of hits, by setting the <a
1794 href="attrs.html#backlink_factor">backlink_factor</a> attribute
1795 in htdig.conf to 0, and sorting by score. The scores calculated
1796 this way aren't quite as good, but htsearch can process hits
1797 much faster when it doesn't need to look up the db.docdb record
1798 for each hit, just to get the backlink count, date or title,
1799 either for scoring or for sorting. This affects versions
1800 3.1.0b3 and up. In version 3.2, currently under development,
1801 the databases will be structured differently, so it should
1802 perform searches more quickly.</p>
1803
1804 <p>In version 3.1.6, the date range selection code also slows
1805 down htsearch for the same reason. Unfortunately, a small bug
1806 crept into the code so that even if you don't set any of the
1807 date range input parameters (startyear, endyear, etc.), and
1808 you set backlink_factor and date_factor to 0, htsearch still
1809 looks at the date in the db.docdb record for each hit. You can
1810 avoid this either by setting startyear to 1969 and endyear to
1811 2038 in your config file, or by applying this
1812 <a href="ftp://ftp.ccsf.org/htdig-patches/3.1.6/timet_enddate.1">
1813 patch</a>.</p>
1814
1815 <strong>5.11. <a name="q5.11">When I run htsearch, it gives me a count of
1816 matches, but doesn't list the matching documents.</a></strong><br>
1817 <p>This most commonly happens when you run htsearch while the
1818 database is currently being rebuilt or updated by htdig.
1819 If htdig and htmerge have run to completion, and the problem still
1820 occurs, this is usually an indication of a corrupted database. If
1821 it's finding matches, it's because it found the matching
1822 words in db.words.db. However, it isn't finding the document
1823 records themselves in db.docdb, which would suggest that either
1824 db.docdb, or db.docs.index (which maps document IDs used in
1825 db.words.db to URLs used to look up records in db.docdb), is
1826 incomplete or messed up. You'll likely need to rebuild your
1827 database from scratch if it's corrupted. Older versions of
1828 ht://Dig were susceptible to database corruption of this
1829 sort. Versions 3.1.2 and later are much more stable.</p>
1830
1831 <p>Another possible cause of this problem is unreadable result
1832 template files. If you define external template files via the
1833 <a href="attrs.html#template_map">template_map</a> attribute,
1834 rather than using the builtin-short or builtin-long templates,
1835 and the file names are incorrect or the files do not have
1836 read permission for the user ID under which htsearch runs,
1837 then htsearch won't be able to display the results. Also,
1838 all directories leading up to these template files must be
1839 searchable (i.e. executable) by htsearch, or it won't be able
1840 to open the files. This is the opposite problem of that described
1841 in question <a href="#q5.36">5.36</a>. If htsearch displays
1842 nothing at all, you may have both problems.</p>
1843
1844 <strong>5.12. <a name="q5.12">I can't seem to index documents with names
1845 like left_index.html with htdig.</a></strong><br>
1846 <p>There is a bug in the implementation of the <a
1847 href="attrs.html#remove_default_doc">remove_default_doc</a>
1848 attribute in htdig versions 3.1.0, 3.1.1 and 3.1.2, which causes
1849 it to match more than it should. The default value for this
1850 attribute is "index.html", so any URL in which the filename ends
1851 with this string (rather than matches it entirely) will have
1852 the filename stripped off. This is fixed in version 3.1.3.</p>
1853
1854 <strong>5.13. <a name="q5.13">I get Premature End of Script Headers errors
1855 when running htsearch.</a></strong><br>
1856 <p>This happens when htsearch dies before putting out a
1857 "Content-Type" header. If you are running Apache under Solaris,
1858 or another system that may be using shared libraries in non-standard
1859 locations,
1860 first try the solution described in question <a href="#q3.6">3.6</a>.
1861 If that doesn't work, or you're running on another system, try
1862 running "htsearch -vvv" directly from the command line to see where
1863 and why it's failing. It should prompt you for the search words,
1864 as well as the format.
1865 <br>If it works from the command line, but not from the web
1866 server, it's almost certainly a web server configuration problem.
1867 Check your web server's error log for any information related to
1868 htsearch's failure. One increasingly common problem is Apache
1869 configurations which expect all CGI scripts to be Perl,
1870 rather than binary executables or other scripts, so they use
1871 "perl-handler" rather than "cgi-handler".
1872 <br>See also questions <a href="#q5.7">5.7</a>,
1873 <a href="#q5.14">5.14</a> and <a href="#q5.23">5.23</a>.</p>
1874
1875 <strong>5.14. <a name="q5.14">I get Segmentation faults when running
1876 htdig, htsearch or htfuzzy.</a></strong><br>
1877 <p>Despite a great deal of debugging of these programs, we haven't
1878 been able to completely eliminate all such problems on all platforms.
1879 If you're running htsearch or htfuzzy on a BSDI system, a common
1880 cause of core dumps is due to a conflict between the GNU regex
1881 code bundled in htdig 3.1.2 and later, and the BSD C or C++ library.
1882 The solution is to use the BSD library's own rx code instead,
1883 using version 3.1.6 or newer as summarized by Joe Jah:</p>
1884 <ul>
1885 <li> ./configure --with-rx
1886 <li> make
1887 </ul>
1888 <p>This solution may work on some other platforms as well (we haven't
1889 heard one way or the other), but will definitely not work on some
1890 platforms. For instance, on libc5-based Linux systems, the bundled
1891 regex code works fine by default, but using libc5's regex code
1892 causes core dumps.</p>
1893
1894 <p>Users of Cobalt Raq or Qube servers have complained of
1895 segmentation faults in htdig. Apparently this is due to problems
1896 in their C++ libraries, which are fixed in their experimental
1897 compiler and libraries. The following commands should install
1898 the packages you need:</p>
1899 <blockquote>
1900 rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/binutils-2.8.1-3C1.mips.rpm<br>
1901 rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/egcs-1.0.2-9.mips.rpm<br>
1902 rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/egcs-c++-1.0.2-9.mips.rpm<br>
1903 rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/egcs-g77-1.0.2-9.mips.rpm<br>
1904 rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/egcs-objc-1.0.2-9.mips.rpm<br>
1905 rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/libstdc++-2.8.0-9.mips.rpm<br>
1906 rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/libstdc++-devel-2.8.0-9.mips.rpm<br>
1907 rpm -Uvh --force ftp://ftp.cobaltnet.com/pub/products/current/RPMS/gcc-2.7.2-C2.mips.rpm
1908 </blockquote>
1909 <p>You may have to remove the libg++ package, if you have it installed
1910 before installing libstdc++, because of conflicts in these packages.
1911 Be sure to do a "make clean" before a "make", to remove any object
1912 files compiled with the old compiler and headers.</p>
1913
1914 <p>For other causes of segmentation faults, or in other programs,
1915 getting a stack backtrace after the fault can be useful in narrowing
1916 down the problem. E.g.: try "gdb /path/to/htsearch /path/to/core",
1917 then enter the command "bt". You can also try running the program
1918 directly under the debugger, rather than attempting a post-mortem
1919 analysis of the core dump. Options to the program can be given on
1920 gdb's "run" command, and after the program is suspended on fault,
1921 you can use the "bt" command. This may give you enough information
1922 to find and fix the problem yourself, or at least it may help others
1923 on the htdig mailing list to point out what to do next.</p>
1924
1925 <strong>5.15. <a name="q5.15">Why does htdig 3.1.3 mangle URL parameters
1926 that contain bare "&amp;" characters?</a></strong><br>
1927 <p>This is a known bug in 3.1.3, and is fixed with this
1928 <a href="ftp://ftp.ccsf.org/htdig-patches/3.1.3/HTML.cc.0">
1929 patch</a>. You can apply the patch by entering into the main
1930 source directory for htdig-3.1.3, and using the command
1931 "patch -p0 &lt; /path/to/HTML.cc.0". This is
1932 also fixed as of version 3.1.4.</p>
1933
1934 <strong>5.16. <a name="q5.16">When I run htmerge, it stops with an
1935 "Unable to open word list file '.../db.wordlist'" message.</a></strong><br>
1936 <p>The most common cause of this error is that htdig did not
1937 manage to index any documents, and so it did not create a word
1938 list. You should repeat the htdig or rundig command with the
1939 -vvv option to see where and why it is failing.
1940 See question <a href="#q4.1">4.1</a>.</p>
1941
1942 <strong>5.17. <a name="q5.17">When using Netscape, htsearch always returns the
1943 "No match" page.</a></strong><br>
1944 <p>Check your search form. Chances are there is a hidden input
1945 field with no value defined. For example, one user had<br>
1946 <code>&lt;input type=hidden name=restrict&gt;</code>
1947
1948 in his search form, instead of<br>
1949
1950 <code>&lt;input type=hidden name=restrict value=""&gt;</code>
1951
1952 The problem is that Netscape sets the missing value to a default of " "
1953 (two spaces), rather than an empty string. For the restrict parameter,
1954 this is a problem, because htsearch won't likely find any URLs with two
1955 spaces in them. Other input parameters may similarly pose a problem.
1956 </p>
1957
1958 <p>Another possibility, if you're running 3.2.0b1 or 3.2.0b2, is
1959 that you need to make the db.words.db_weakcmpr file writeable by
1960 the user ID under which the web server runs. This is a bug, and
1961 is fixed in the 3.2.0b5 beta.</p>
1962
1963
1964 <strong>5.18. <a name="q5.18">Why doesn't htdig follow links to other
1965 pages in JavaScript code?</a></strong><br>
1966 <p>There probably isn't any indexing tool in existance
1967 that follows JavaScript links, because they don't know how
1968 to initiate JavaScript events. Realistically, it would take a
1969 full JavaScript parser in order to be able to figure out all the
1970 possible URLs that the code could generate, something that's way
1971 beyond the means of any search engine. You have a few options:</p>
1972 <ul>
1973 <li>Add "backup" links using plain HTML &lt;a href=...&gt; tags to
1974 all the pages that could be accessed through JavaScript,
1975 <li>Add &lt;link&gt; tags to point to all these pages (see
1976 <a href="http://www.w3.org/TR/html4/struct/links.html#h-12.3.3">Links
1977 and search engines</a> in W3C's HTML 4.0 Specification - requires
1978 htdig 3.1.3 or greater, but then <em>everyone</em> should be running
1979 3.1.6 or greater anyway),
1980 <li>Compose a list of all the unreachable documents, or write
1981 a program to do so, and feed that list as part of htdig's
1982 <a href="attrs.html#start_url">start_url</a> attribute.
1983 See also question <a href="#q5.25">5.25</a>.
1984 </ul>
1985
1986 <strong>5.19. <a name="q5.19">When I run htsearch from the web server,
1987 it returns a bunch of binary data.</a></strong><br>
1988 <p>Your server is returning the contents of the htsearch binary.
1989 Common causes of this are:</p>
1990 <ul>
1991 <li>no execute permission on the htsearch binary,
1992 <li>the binary won't run on this system (it may be compiled
1993 for the wrong system type), or
1994 <li>the web server doesn't recognize the file as a CGI
1995 (for Apache, you must have a ScriptAlias directive for the
1996 program or the directory in which it's installed, or define
1997 a cgi-script handler for some suffix, e.g. .cgi, and add that
1998 suffix to the program file name).
1999 </ul>
2000 <p>By default, Apache is usually configured with one cgi-bin
2001 directory as ScriptAlias, so all your CGI programs must go in
2002 there, or have a .cgi suffix on them. Your configuration may
2003 differ, however.</p>
2004
2005 <strong>5.20. <a name="q5.20">Why are the betas of 3.2 so
2006 slow at indexing?</a></strong><br>
2007 <p>
2008 As the release notes for these versions suggest, they are
2009 somewhat unoptimized and are made available for testing
2010 Since the 3.2 code indexes all locations of words to support
2011 phrase searching and other advanced methods, this additional
2012 data slows down the indexer. To compensate, the code has a
2013 cache configured by the
2014 <a href="dev/htdig-3.2/attrs.html#wordlist_cache_size">wordlist_cache_size</a>
2015 attribute.
2016 As of this writing, the word database code will slow down
2017 considerably when the cache fills up. Setting the cache as
2018 large as possible provides considerable performance
2019 improvement. Development is in progress to improve cache
2020 performance.
2021 For 3.2.0b6 and higher, see also the
2022 <a href="dev/htdig-3.2/attrs.html#store_phrases">store_phrases</a> attribute,
2023 which can turn off support for phrase searches, improving the speed.
2024 </p>
2025
2026 <strong>5.21. <a name="q5.21">Why does htsearch use ";" instead of
2027 "&amp;" to separate URL parameters for the page buttons?</a></strong><br>
2028 <p>In versions 3.1.5 and 3.2.0b2, and later, htsearch was
2029 changed to use a semicolon character ";" as a parameter
2030 separator for page button URLs, rather than "&amp;", for HTML
2031 4.0 compliance. It now allows both the "&amp;" and the ";" as
2032 separators for input parameters, because the CGI specification
2033 still uses the "&amp;". This change may cause some PHP or CGI
2034 wrapper scripts to stop working, but these scripts should be
2035 similarly changed to recognize both separator characters.
2036 For the definitive reference on this issue, please refer to
2037 section B.2.2 of W3C's HTML 4.0 Specification,
2038 <a href="http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2">
2039 Ampersands in URI attribute values</a>. We're all a little
2040 tired of arguing about it. If you don't like the standard, you
2041 can change the Display::createURL() code yourself to ignore it.
2042 <br>See also question <a href="#q4.13">4.13</a>.</p>
2043
2044 <p>If you want to try working within the new standard, you may
2045 find it helpful to know that recent versions of CGI.pm will
2046 allow either the ampersand or semicolon as a parameter separator,
2047 which should fix any Perl scripts that use this library.
2048 In PHP, you can simply set the following in your php.ini file
2049 to allow either separator:</p>
2050 <pre>arg_separator.input = ";&amp;"
2051 </pre>
2052
2053 <strong>5.22. <a name="q5.22">Why does htsearch show the
2054 "&amp;" character as "&amp;amp;" in search results?</a></strong><br>
2055 <p>In version 3.1.5, htsearch was fixed to properly
2056 re-encode the characters &amp;, &lt;, &gt;, and &quot;
2057 into SGML entities. However, the default value for the
2058 <a href="attrs.html#translate_amp">translate_amp</a>,
2059 <a href="attrs.html#translate_lt_gt">translate_lt_gt</a>
2060 and <a href="attrs.html#translate_quot">translate_quot</a>
2061 attributes is still false, so these entities don't get converted
2062 by htdig. If you set these three attributes to true in your
2063 htdig.conf and reindex, the problem will go away.</p>
2064
2065 <p>In the 3.2 betas there was a bug in the HTML parser that
2066 caused it to fail when attempting to translate the "&amp;amp;"
2067 entity. This has been fixed in 3.2.0b3. The translate_* attributes
2068 are gone as of 3.2.0b2.</p>
2069
2070 <strong>5.23. <a name="q5.23">I get Internal Server or Unrecognized
2071 character errors when running htsearch.</a></strong><br>
2072 <p>An increasingly common problem is Apache configurations
2073 which expect all CGI scripts to be Perl, rather than binary
2074 executables or other scripts, so they use "perl-handler"
2075 rather than "cgi-handler". The fix is to create a separate
2076 directory for non-Perl CGI scripts, and define it as such in
2077 your httpd.conf file. You should define it the same way as your
2078 existing cgi-bin directory, but use "cgi-handler" instead of
2079 "perl-handler". In any case, you should check your web server's
2080 error log for any information related to htsearch's failure.
2081 <br>See also questions <a href="#q5.7">5.7</a>,
2082 <a href="#q5.14">5.14</a> and <a href="#q5.13">5.13</a>.</p>
2083
2084 <strong>5.24. <a name="q5.24">I took some settings out of
2085 my htdig.conf but they're still set.</a></strong><br>
2086 <p>All configuration file attributes have compiled-in, default
2087 values. Taking an attribute out of the file is not the same
2088 thing as setting it to an empty string, a 0, or a value of
2089 false. See question <a href="#q4.18">4.18</a>.</p>
2090
2091 <strong>5.25. <a name="q5.25">When I run htdig on my site,
2092 it misses entire directories.</a></strong><br>
2093 <p>First of all, htdig doesn't look at directories itself. It
2094 is a spider, and it follows hypertext links in HTML documents.
2095 If htdig seems to be missing some documents or entire directory
2096 sub-trees of your site, it is most likely because there are
2097 no HTML links to these documents or directories. (See also
2098 question <a href="#q5.18">5.18</a>.) If htdig does
2099 not come across at least one hypertext link to a document
2100 or directory, and it's not explicitly listed in the
2101 <a href="attrs.html#start_url">start_url</a> attribute, then
2102 this document or directory is essentially hidden from view
2103 to htdig, or to any web browser or spider for that matter.
2104 You can only get htdig to index directories, without providing
2105 your own files with links to the contents of these directories,
2106 by using your web server's automatic index generation feature.
2107 In Apache, this is done with the mod_autoindex module, which
2108 is usually compiled-in by default, and is enabled with the
2109 "Indexes" option for a given directory hierarchy. For example,
2110 you can put these directives in your Apache configuration:</p>
2111 <pre>
2112 &lt;Directory "/path/to/your/document/root"&gt;
2113 Options Indexes FollowSymLinks Includes ExecCGI
2114 &lt;/Directory&gt;
2115 </pre>
2116 <p>This will cause Apache to automatically generate an index
2117 for any directory that does not have an index.html or other
2118 "DirectoryIndex" file in it. Other web servers will have
2119 similar features, which you should look for in your server
2120 documentation.</p>
2121
2122 <p>As an alternative to relying on the web server's autoindex
2123 feature, you can compose a list of all the unreachable
2124 documents, or write a program to do so, and feed that list as
2125 part of htdig's <a href="attrs.html#start_url">start_url</a>
2126 attribute. Here is an example of simple shell script to make
2127 a file of URLs you can use with a configuration entry like
2128 <code>start_url: `/path/to/your/file`</code>:</p>
2129 <pre>
2130 find /path/to/your/document/root -type f -name \*.html -print | \
2131 sed -e 's|/path/to/your/document/root/|http://www.yourdomain.com/|' > \
2132 /path/to/your/file
2133 </pre>
2134 <p>Other reasons why htdig might be missing portions of your
2135 site might be that they fall out of the bounds specified
2136 by the <a href="attrs.html#limit_urls_to">limit_urls_to</a>
2137 attribute (which takes on the value of start_url by default),
2138 they are explicitly excluded using the
2139 <a href="attrs.html#exclude_urls">exclude_urls</a> attribute,
2140 or they are disallowed by a robots.txt file (see the
2141 <a href="htdig.html">htdig</a> documentation for notes about
2142 robot exclusion) or by a robots meta tag (see question
2143 <a href="#q4.15">4.15</a>). If htdig seems to be missing the
2144 last part of a large directory or document, see question
2145 <a href="#q5.1">5.1</a>. For reasons why htdig may be rejecting
2146 some links to parts of your site, see question
2147 <a href="#q5.27">5.27</a>.</p>
2148
2149 <strong>5.26. <a name="q5.26">What do all the numbers and symbols
2150 in the htdig -v output mean?</a></strong><br>
2151 <p>Output from htdig -v typically looks like this:</p>
2152 <pre>
2153 23000:35506:2:http://xxx.yyy.zz/index.html: ***-+****--++***+ size = 4056
2154 </pre>
2155 <p>The first number is the number of documents parsed so far,
2156 the second is the DocID for this document, and the third is
2157 the hop count of the document (number of hops from one of the
2158 start_url documents). After the URL, it shows a "*" for a link
2159 in the document that it already visited (or at least queued
2160 for retrieval), a "+" for a new link it just queued, and a
2161 "-" for a link it rejected for any of a number of reasons.
2162 To find out what those reasons are, you need to run htdig
2163 with at least 3 "v" options, i.e. -vvv. If there are no "*",
2164 "+" or "-" symbols after the URL, it doesn't mean the document
2165 was not parsed or was empty, but only that no links to other
2166 documents were found within it.</p>
2167
2168 <strong>5.27. <a name="q5.27">Why is htdig rejecting some of the
2169 links in my documents?</a></strong><br>
2170 <p>When htdig parses documents and finds hypertext links to
2171 other documents (hrefs), it may reject them for any of several
2172 reasons. To find out what those reasons are, you need to run
2173 htdig with at least 3 "v" options, i.e. -vvv. Here are the
2174 meanings of some of the messages you might see at this verbosity
2175 level.</p>
2176 <dl>
2177 <dt>Not an http or relative link!</dt>
2178 <dd>In versions 3.1.5 and earlier, only "http://" URLs, or
2179 URLs relative to those, are allowed.</dd>
2180 <dt>Item in the exclude list: item # <em>n</em></dt>
2181 <dd>A substring of the URL matches one of the items in the
2182 <a href="attrs.html#exclude_urls">exclude_urls</a>
2183 attribute. The given item number will indicate which
2184 pattern matched, starting at 1. The 3.2.0 betas do not
2185 give the item number.</dd>
2186 <dt>Extension is invalid!</dt>
2187 <dd>The file name extension or suffix matches one of those
2188 listed in the
2189 <a href="attrs.html#bad_extensions">bad_extensions</a>
2190 attribute.</dd>
2191 <dt>Extension is not valid!</dt>
2192 <dd>The file name extension or suffix does not match one of those
2193 listed in the
2194 <a href="attrs.html#valid_extensions">valid_extensions</a>
2195 attribute, if any are specified.</dd>
2196 <dt>Invalid Querystring! <em>or</em><br>item in bad query list</dt>
2197 <dd>The URL contains a query string which matches one of those
2198 listed in the
2199 <a href="attrs.html#bad_querystr">bad_querystr</a>
2200 attribute.</dd>
2201 <dt>URL not in the limits!</dt>
2202 <dd>No substring of the URL entirely matches one of the items in the
2203 <a href="attrs.html#limit_urls_to">limit_urls_to</a>
2204 attribute. The purpose of this attribute is to keep htdig
2205 from attempting to index the entire World Wide Web.</dd>
2206 <dt>forbidden by server robots.txt!</dt>
2207 <dd>A substring of the URL matches one of the items disallowed
2208 in the servers robots.txt file. See
2209 <a href="http://www.robotstxt.org/wc/norobots.html">
2210 A Standard for Robot Exclusion</a>. This message exists
2211 only in the 3.2.0 betas. In 3.1.5 and earlier, this condition
2212 is only caught later, resulting in the message
2213 "robots.txt: discarding '<em>URL</em>'" from htdig, and a
2214 later "Deleted: no excerpt" message from htmerge.</dd>
2215 <dt>url rejected: (level 2)</dt>
2216 <dd>No substring of the URL entirely matches one of the items in the
2217 <a href="attrs.html#limit_normalized">limit_normalized</a>
2218 attribute. All the other rejections above will be indicated
2219 as level 1. The 3.2.0 betas give the much more meaningful
2220 message 'not in "limit_normalized" list!'</dd>
2221 </dl>
2222
2223 <p>Another possibility, if none of the error messages above appear
2224 for some of the links you think htdig should be accepting, is that
2225 htdig isn't even finding the links at all. First, make sure you're
2226 not making false assumptions about how htdig finds these. It only
2227 reads links in HTML code, and not JavaScript, and it doesn't read
2228 directories unless the HTTP server is feeding it directory listings.
2229 You will need to take a close look at the htdig -vvv (or -vvvv)
2230 output to see what htdig is finding, in and around the areas where
2231 the desired links are supposed to be found in your HTML code, to see
2232 if it's actually finding them.
2233 See also question <a href="#q5.25">5.25</a>.</p>
2234
2235 <strong>5.28. <a name="q5.28">When I run htdig or htmerge, I get a
2236 "DB2 problem...: missing or empty key value specified" message.</a></strong><br>
2237 <p>The most common cause of this error is that htdig or
2238 htmerge rejected any documents that had been put in the
2239 database, leaving an empty database. You need to find out the
2240 reasons for the rejection of these documents. See questions
2241 <a href="#q4.1">4.1</a>, <a href="#q5.25">5.25</a> and
2242 <a href="#q5.27">5.27</a>.</p>
2243
2244 <strong>5.29. <a name="q5.29">When I run htdig on my site,
2245 it seems to go on and on without ending.</a></strong><br>
2246 <p>There are some things that can cause htdig to run on without
2247 ending, especially when indexing dynamic content (ASP, PHP,
2248 SSI or CGI pages). This usually involves htdig getting caught
2249 in an <em>infinite virtual hierarchy</em>. A sure sign of
2250 this is if the current size of your database is much larger
2251 than the total size of the site you are indexing, or if in the
2252 verbose output of htdig (see question <a href="#q4.1">4.1</a>)
2253 you see the same URLs come up again and again with only subtle
2254 variations. In any case, you must figure out the reason htdig
2255 keeps revisiting the same documents using different URLs, as
2256 explained in question <a href="#q4.24">4.24</a>, and set your
2257 <a href="attrs.html#exclude_urls">exclude_urls</a> and
2258 <a href="attrs.html#bad_querystr">bad_querystr</a> attributes
2259 appropriately to stop htdig from going down those paths.
2260 </p>
2261
2262 <strong>5.30. <a name="q5.30">Why does htsearch no longer recognize
2263 the -c option when run from the web server?</a></strong><br>
2264 <p>This was a security hole in 3.1.5 and older, and 3.2.0b3 and
2265 older releases of ht://Dig. (See question <a href="#q2.1">2.1</a>.)
2266 There's a compile-time macro you can set in htsearch.cc to disable
2267 this security fix, but that's a bad idea because it reopens the hole.
2268 This should only be done as a last recourse, when all other avenues
2269 fail. The -c option was only intended for testing htsearch from the
2270 command line, and not for use when calling htsearch on the web server.
2271 Unfortunately, far too many users have needlessly latched onto this
2272 option for CGI scripts. The preferred ways of specifying the config
2273 file are as follows, in order of preference:</p>
2274 <ol>
2275 <li>use the "config" input parameter in your
2276 <a href="hts_form.html">search form</a>
2277 (see question <a href="#q4.2">4.2</a>).
2278 <li>if you need to get at files outside the default CONFIG_DIR, use a
2279 wrapper script that redefines the CONFIG_DIR environment variable,
2280 then use the config input parameter as above
2281 (see question <a href="#q4.20">4.20</a>).
2282 <li>use a wrapper script to force htsearch to use a specific config
2283 file using the -c option. This is especially for cases where you
2284 want to prevent the user from selecting other config files in your
2285 CONFIG_DIR using the config input parameter. This should
2286 be done by using the GET method to call the wrapper script, and in
2287 this script you must unset the REQUEST_METHOD enviroment variable
2288 and pass "$QUERY_STRING" as a single argument to htsearch.
2289 (This safely gets around htsearch's test which disables -c.)
2290 <li>configure and compile different htsearch binaries with different
2291 compile-time definitions of CONFIG_DIR, so you can avoid wrapper
2292 scripts altogether.
2293 <li>define ALLOW_INSECURE_CGI_CONFIG in htsearch.cc and recompile
2294 htsearch if all other approaches above fail for you.
2295 </ol>
2296
2297 <strong>5.31. <a name="q5.31">I've set a config attribute exactly
2298 as documented but it seems to have no effect.</a></strong><br>
2299 <p>There are a few fairly common reasons why this might happen:</p>
2300 <ol>
2301 <li>You may have a typo. Spelling matters, so make sure the attribute
2302 name is spelled exactly as it is in the
2303 <a href="attrs.html">documentation</a>. Misspelled attribute
2304 definitions are silently ignored. This is because you're allowed
2305 to make up your own attribute definitions for use by other attribute
2306 definitions, as <strong>${myownattribute}</strong>. Also remember
2307 to put the colon ("<strong>:</strong>") separator between the
2308 attribute name and value in your definition.
2309 <li>The attribute isn't supported in your version of the software.
2310 The <a href="attrs.html">documented configuration attributes</a>
2311 on the www.htdig.org web site are for the most recent
2312 <strong>stable</strong> release. See questions
2313 <a href="#q2.1">2.1</a> and <a href="#q2.7">2.7</a> for details.
2314 If you're running an older version, or even a more recent beta
2315 release, you may not have the same set of attributes to work with.
2316 Consult the appropriate documentation, or upgrade to the current
2317 release.
2318 <li>You're not modifying the right configuration file. The default
2319 configuration file is specified when you first configure ht://Dig
2320 before compiling, but other configuration files can be specified
2321 at run time, using the -c command-line option for most programs,
2322 or the <strong>config</strong> input parameter for htsearch
2323 (see question <a href="#q4.2">4.2</a>).
2324 <li>You've got more than one definition of the attribute. Only the
2325 last occurrence of an attribute in the configuration file is the
2326 definition that's used for that attribute, overriding earlier
2327 definitions. This also applies for nested configuration files that
2328 are loaded in via the <a href="attrs.html#include">include</a>
2329 directive, so check for other definitions in all included files.
2330 Similarly for htsearch, look out for multiple definitions of input
2331 parameters in your search forms, as mentioned in question
2332 <a href="#q4.2">4.2</a> - these don't override each other but they
2333 get combined with a Ctrl-A as separator, which may not be what you
2334 want either.
2335 <li>Your attribute definition is being "swallowed up" by an
2336 incomplete multi-line definition above it. Remember that when a line
2337 of an attribute definition ends with a single backslash
2338 ("<strong>\</strong>") before the end of the line (without any
2339 space after the backslash), then the following line is appended to
2340 it as a continuation of the same attribute definition. For an
2341 attribute definition that spans several lines, all lines but the
2342 last must end with a backslash. If you want a backslash to go into
2343 the attribute definition literally, it must be doubled-up, as
2344 <strong>\\</strong>.
2345 <li>On a similar note, make sure your attribute definitions are all
2346 terminated by a newline character. Beware of text editors that do
2347 word wrapping. It may look like two separate lines on the screen,
2348 when it fact you've got two attribute definitions on the same long
2349 line, so the second is swallowed up as part of the first.
2350 <li>Your attribute definition is being overridden by an htsearch
2351 <a href="hts_form.html">CGI input parameter</a>. For example,
2352 <a href="attrs.html#template_name">template_name</a> is ignored
2353 if the <strong>format</strong> input parameter is defined. The
2354 <a href="attrs.html#allow_in_form">allow_in_form</a> attribute
2355 can define any number of new CGI input parameters that override
2356 the attributes of the same name in your config file.
2357 <li>Your attribute definition is being ignored or overridden
2358 by a related attribute. Watch out for unexpected interactions
2359 between different attributes. For instance, characters in
2360 <a href="attrs.html#valid_punctuation">valid_punctuation</a>
2361 are stripped out of words, so those characters may
2362 not have the effect you want if you've added them to
2363 <a href="attrs.html#extra_word_characters">extra_word_characters</a>
2364 or
2365 <a href="attrs.html#prefix_match_character">prefix_match_character</a>.
2366 Also,
2367 <a href="attrs.html#search_results_wrapper">search_results_wrapper</a>
2368 will override
2369 <a href="attrs.html#search_results_header">search_results_header</a>
2370 and
2371 <a href="attrs.html#search_results_footer">search_results_footer</a>,
2372 but only if you've set up the wrapper file correctly.
2373 <li>Watch out for possible "latent effects" of some attributes. For
2374 example, when you change attributes used by htdig, they won't have
2375 an immediate effect on entries already in the database, so you would
2376 have to reindex your site before they take effect. Similarly,
2377 attributes that affect how htfuzzy builds some of its databases
2378 don't take effect until those databases are rebuilt. Another, more
2379 subtle latent effect occurs with releases 3.1.6 and 3.2 betas:
2380 when you interrupt htdig (i.e. with Control-C or a kill command),
2381 it stores the list of currently queued URLs in db.log, in your
2382 database directory, so that the next time you invoke htdig it can
2383 resume the interrupted dig. A side-effect of this file is that if
2384 you change some attributes like limit_urls_to or exclude_urls before
2385 restarting, the URLs in the file are still taken as-is, having been
2386 checked against the old settings of limit_urls_to or exclude_urls
2387 before being queued. This might explain one reason htdig seems to
2388 ignore your new settings of these.
2389 </ol>
2390
2391 <strong>5.32. <a name="q5.32">When I run htsearch, it gives a page
2392 with an "Unable to read configuration file" message.</a></strong><br>
2393 <p>The most common causes of this error are:</p>
2394 <ul>
2395 <li>Your configuration file name is misspelled in the "config"
2396 input parameter of your search form, or you have two definitions
2397 of this parameter (see question <a href="#q4.2">4.2</a>).
2398 <li>You didn't install your configuration file in the directory
2399 defined by the CONFIG_DIR compile-time Makefile variable
2400 (see also question <a href="#q4.20">4.20</a>). This is where
2401 htsearch will look for the configuration file specified by the
2402 "config" input parameter.
2403 <li>The configuration file is not readable by the user ID under
2404 which your web server, and thus htsearch, runs. Similarly,
2405 if the directories from CONFIG_DIR up to the root directory
2406 are not executable by this same user ID, htsearch won't be
2407 able to access the configuration files.
2408 </ul>
2409
2410 <strong>5.33. <a name="q5.33">How can I find out which version
2411 of ht://Dig I have installed?</a></strong><br>
2412 <p>You should always check which version of ht://Dig you're
2413 running, before you report any problems, or even if you
2414 suspect a problem. You can find out the version number of an
2415 installed ht://Dig package by running the command:</p>
2416 <blockquote>
2417 <code>htdig -\? | head</code>
2418 </blockquote>
2419 <p>(or use "more" if you don't have a "head" command). The
2420 full version number appears on the third line of output,
2421 after "This program is part of ht://Dig", and it should also
2422 include the snapshot date if you're running a pre-release
2423 snapshot. Always include this full version number with any
2424 bug report or problem report on a mailing list. You can save
2425 yourself and others a lot of grief by being certain of which
2426 version you're running, especially if you've installed more than
2427 one. If you're running ht://Dig from an RPM package, you should
2428 also report the package version and release number, which you
2429 can determine with the command "<code>rpm -q htdig</code>",
2430 and mention where you obtained the package. This will alert
2431 us to the ideosyncracies and/or patches in a particular RPM
2432 package. Also, if you've applied any patches yourself (see
2433 question <a href="#q2.5">2.5</a>) please mention which ones.
2434 See also question <a href="#q1.8">1.8</a>, on reporting bugs
2435 or configuration problems.</p>
2436
2437 <strong>5.34. <a name="q5.34">When running htdig, I get "Error (0):
2438 PDF file is damaged - attempting to reconstruct xref table..."</a></strong><br>
2439 <p>This message comes from the pdftotext utility, when a PDF file
2440 has been truncated. Find the largest PDF file on the site you're
2441 indexing, and set max_doc_size to at least that size (see question
2442 <a href="#q5.2">5.2</a>). If you need to track down which PDF is
2443 causing the error, try running "htdig -i -v &gt; log.txt 2&gt;&amp;1" so you
2444 can see which URL is being indexed when the error occurs. The output
2445 redirects in that command combine stdout (where htdig's output goes)
2446 and stderr (where pdftotext's error messages go) into one output
2447 stream. If you're using acroread to index PDF files, the error
2448 message for a truncated PDF file is simply "Could not repair file."
2449 It's also possible to get errors like this from PDF files that are
2450 smaller than max_doc_size, if they're already truncated or corrupted
2451 on the server.</p>
2452
2453 <strong>5.35. <a name="q5.35">When running htdig on Mandrake Linux,
2454 I get "host not found" and "no server running" errors.</a></strong><br>
2455 <p>The default htdig.conf configuration in Mandrake's RPM package
2456 of htdig very stupidly enables the
2457 <a href="attrs.html#local_urls_only">local_urls_only</a> attribute
2458 by default, which means you can only index a limited set of files
2459 on the local server. Anything else, where htdig would normally fall
2460 back to using HTTP, will fail. To make matters worse, they put a very
2461 misleading comment above that attribute setting, which throws users
2462 off track. This attribute is useful in certain circumstances where
2463 you never want htdig to fall back to HTTP, but enabling it by default
2464 was a very bad judgement call on Mandrake's part.</p>
2465
2466 <strong>5.36. <a name="q5.36">When I run htsearch, it gives me the
2467 list of matching documents, but no header or footer.</a></strong><br>
2468 <p>The header and footer typically contain the followup search
2469 form, an indication of the total number of matches, and buttons
2470 to other pages of matches if the results don't fit on one
2471 page. If these don't show up, it could be that in attempting
2472 to customize these (see question <a href="#q4.2">4.2</a>),
2473 you removed them or rendered them unusable. Even if you didn't
2474 customize them, make sure you installed the
2475 <a href="attrs.html#search_results_header">search_results_header</a>
2476 and
2477 <a href="attrs.html#search_results_footer">search_results_footer</a>
2478 files (or the
2479 <a href="attrs.html#search_results_wrapper">search_results_wrapper</a>
2480 file) in the correct location (where you told ht://Dig they'd be
2481 when you configured prior to compiling). Also make sure they
2482 have read permission for the user ID under which htsearch runs,
2483 and all directories leading up to these template files are
2484 searchable (i.e. executable) by htsearch, or it won't be able
2485 to open the files.</p>
2486
2487 <p>This is the opposite problem of that described in question
2488 <a href="#q5.11">5.11</a>. If htsearch displays nothing at
2489 all, you may have both problems or you may have no matches or
2490 a boolean query syntax error and the
2491 <a href="attrs.html#nothing_found_file">nothing_found_file</a>
2492 or <a href="attrs.html#syntax_error_file">syntax_error_file</a>
2493 is missing or unreadable.</p>
2494
2495 <strong>5.37. <a name="q5.37">When I index files with doc2html.pl,
2496 it fails with the "UNABLE to convert" error.</a></strong><br>
2497 <p>This is an indication that doc2html.pl wasn't configured
2498 properly. Carefully follow all the directions for installation
2499 in the DETAILS file that comes with the script. In addition to
2500 installing doc2html.pl, you must:</p>
2501 <ul>
2502 <li>Install xpdf and check that pdftotext and pdfinfo work from
2503 the command line,
2504 <li>Configure pdf2html.pl to use pdftotext and pdfinfo and check
2505 that it works from the command line,
2506 <li>Configure doc2html.pl to use pdf2html.pl and check that it
2507 works from the command line:
2508 <pre>doc2html.pl /full/path/to/sample/filename.pdf "application/pdf" url</pre>
2509 </ul>
2510 <p>You should repeat a similar set of steps to configure and test
2511 doc2html.pl for other document types, such as Word, RTF, Excel and
2512 other document types. See also questions <a href="#q4.8">4.8</a>,
2513 <a href="#q4.9">4.9</a> and <a href="#q5.39">5.39</a>.</p>
2514
2515 <strong>5.38. <a name="q5.38">Why do my searches find search terms
2516 in pathnames, or how do I prevent matching filenames?</a></strong><br>
2517 <p>htdig doesn't normally add the URL components to the index
2518 itself, but when you index a directory where the filenames are
2519 used as link description text (such as an automatic DirectoryIndex
2520 created by Apache's mod_autoindex) then these link descriptions
2521 get indexed, carrying the weight assigned to them by the
2522 <a href="attrs.html#description_factor">description_factor</a>
2523 attribute. Thus, a search for a filename will match this link
2524 description, and the file will show up in search results.
2525 To avoid that, make sure your DirctoryIndexes don't get indexed
2526 as detailed in question <a href="#q4.23">4.23</a>.</p>
2527
2528 <p>Conversely, there is no way to force htdig to index URL
2529 components so that a search for a file name will yield a match
2530 on that file, unless you index an HTML file (or several) containing
2531 links to all the files you want, where the link description text
2532 does contain the full URL or the pathname components you want.</p>
2533
2534 <strong>5.39. <a name="q5.39">I set up an external parser but I still
2535 can't index Word/Excel/PowerPoint/PDF documents.</a></strong><br>
2536 <p>You probably need to carefully re-read and follow questions
2537 <a href="#q4.8">4.8</a>, <a href="#q4.9">4.9</a>,
2538 <a href="#q5.25">5.25</a> and <a href="#q5.27">5.27</a>.
2539 When you can't index documents with an external parser or converter,
2540 there are three main issues, or points of failure, that you need
2541 to resolve. You need to figure out on which of the three stages the
2542 process is failing, and focus on that stage to get to the bottom of
2543 why it's not working at that stage. You need to run htdig with
2544 anywhere from 1 to 4 -v options, to get the debugging output you
2545 need to see where it's failing and why. This may be an iterative
2546 process, if htdig is failing at more than one stage: you might fix
2547 one problem only to run into another.</p>
2548
2549 <ol>
2550 <li>Is htdig actually finding links to the PDF, Word, etc. documents
2551 you want to index? Make sure you're not making false assumptions
2552 about how htdig finds these (questions <a href="#q5.25">5.25</a>
2553 and <a href="#q5.18">5.18</a>), and then find out how htdig is
2554 looking at the links in your HTML files to see if it's ignoring
2555 or rejecting links to your externally parsed documents (questions
2556 <a href="#q4.1">4.1</a> and <a href="#q5.27">5.27</a>).<br><br>
2557 <li>If it is finding and accepting the links to these documents, is
2558 it correctly fetching them and passing them on to the appropriate
2559 external converter to be able to index them? Look at htdig -vvv
2560 output, around the time it tries to fetch one of these, and see
2561 what it does next. Does the file size look right? Are there any
2562 error messages around there? If the external converter isn't even
2563 being called, take a close look at your
2564 <a href="attrs.html#external_parsers">external_parsers</a>
2565 attribute setting to make sure it's correct (see question
2566 <a href="#q5.31">5.31</a>).<br><br>
2567 <li>If it is attempting to convert them, is the external converter
2568 doing what it should, to feed some indexable text back into htdig's
2569 parser? You can also try htdig -vvvv (4 -v options) to see if it's
2570 actually parsing individual words from any of these. If this is
2571 too much output to wade through, try setting
2572 <a href="attrs.html#start_url">start_url</a> to the URL
2573 of a single document that you want to test, so you can look in
2574 detail at what htdig does with it. You can also try running the
2575 external converter manually on one of these documents to see
2576 what it spits out. See question <a href="#q5.37">5.37</a>.
2577 Make sure your documents actually contain indexable text. Some
2578 PDFs are nothing but scanned images of pages, so it looks like
2579 text but it's just images with no computer-readable text.
2580 </ol>
2581
2582 <br>
2583
2584 <hr noshade size=4>
2585 Last modified: $Date: 2004/05/28 13:15:16 $
2586 <br>
2587 <a href="http://sourceforge.net/">
2588 <img src="http://sourceforge.net/sflogo.php?group_id=4593&amp;type=1" width="88" height="31" border="0" alt="SourceForge Logo"></a>
2589 </body>
2590 </html>