home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / ph-faq < prev    next >
Internet Message Format  |  1997-12-17  |  31KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!tribune.meitca.com!ulowell.uml.edu!cam-news-feed2.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news-feed1.tiac.net!newsfeed.direct.ca!Supernews60!supernews.com!Supernews69!not-for-mail
  2. From: noel@camelcity.com
  3. Newsgroups: info.ph,comp.infosystems.gopher,comp.infosystems.www.providers,comp.answers,news.answers
  4. Subject: ph (cso nameserver) Frequently Asked Questions (FAQ)
  5. Supersedes: <ph-faq-1-847825057@ols.net>
  6. Followup-To: info.ph
  7. Date: 16 Dec 1997 10:48:57 -0500
  8. Organization: ols.net - OnLine South
  9. Lines: 862
  10. Approved: news-answers-request@MIT.Edu
  11. Distribution: world
  12. Message-ID: <ph-faq-1-882287335@ols.net>
  13. Reply-To: noel@camelcity.com (PH FAQ Coordinators)
  14. NNTP-Posting-Host: 2082@206.27.1.1
  15. Keywords: FAQ PH CSO
  16. X-Posting-Frequency: posted on the 5th and 20th of each month
  17. X-Content-Currency: This FAQ changes regularly.  
  18. Xref: senator-bedfellow.mit.edu info.ph:1611 comp.infosystems.gopher:18412 comp.answers:29309 news.answers:118930
  19.  
  20. Posted-By: auto-faq 3.1.1.2
  21. Archive-name: ph-faq
  22.  
  23. FAQ (Frequently-asked Questions) for ph (cso nameserver)
  24.  
  25. ------------------------------
  26.  
  27. Subject: Recent changes
  28.  
  29. Corrected wfu.edu addresses which were no longer valid.
  30.  
  31. Numerous corrections from Paul Pomes, including change of software location
  32. for ph, qi, and phquery (Jan 17, 1996)
  33.  
  34. Added HTML to FAQ (Jun 17, 1996)
  35.  
  36. Moved location of FAQ (Jan 3, 1996)
  37.  
  38. Gopher access to FAQ no longer available (Sep 7, 1995)
  39.  
  40. Corrected listserv address again (Jul 20, 1995)
  41.  
  42. Corrected listserve address (Apr 15, 1995)
  43.  
  44. Added information about linux (Feb 27, 1995)
  45.  
  46. Added uwho client (Feb 27, 1995)
  47.  
  48. Added automatic posting with Supersedes header (Feb 6, 1995)
  49.  
  50. Changed http location of archive (Jan 16, 1995)
  51.  
  52. Added 1.2.1 Where should the database files be kept? (Jan 9, 1995)
  53.  
  54. Added to phquery section 1.4 (Oct 13, 1994)
  55.  
  56. Added new database build script 1.3 (Oct 13, 1994)
  57.  
  58. Added mirror site for ph-FAQ (Oct 13, 1994)
  59.  
  60. Added samples to Subject: 1.5 Can I run multiple databases on different 
  61. ports? (Oct 13, 1994)
  62.  
  63. Removed annoying tabs and spaces (Oct 13, 1994)
  64.  
  65. ------------------------------
  66.  
  67. Subject: Acknowledgements
  68.  
  69. The FAQ is maintained by Noel Hunter <noel@camelcity.com>.  
  70.  
  71. This FAQ is automatically posted on the 5th and 20th of each month. The
  72. latest version of the FAQ is available in the following ways:
  73.  
  74. http://www.camelcity.com/~noel/usenet/ph-FAQ.htm
  75.  
  76. A mirror is maintained at:
  77.  
  78. http://www.tas.gov.au/ph/contents.html
  79.  
  80. This FAQ is also mailed to the list info-ph@postoffice.cso.uiuc.edu. To get
  81. on the ph mailing list, send mail to listserv@postoffice.cso.uiuc.edu
  82. with "subscribe info-ph" in the BODY (not Subject: !)
  83.  
  84. Many of these answers came from the info-ph list.  Some are paraphrased,
  85. edited, or otherwise altered, and some are not credited.  But my thanks
  86. goes out to all who have contributed to the list.  And if you see
  87. something of yours here which you want credited, let me know, and I will
  88. credit it. 
  89.  
  90. Thanks to Sandra Louie for her list of several FAQs.
  91.  
  92. ------------------------------
  93.  
  94. Subject: Submissions
  95.  
  96. The maintainer is not an expert on ph/cso.  I am relying on experts to
  97. submit FAQs and answers.  I am also relying on users of the FAQ to let me
  98. know which answers are unclear, and where there are errors or omissions.
  99. At present, this is just a start.  You can help make it more complete. 
  100.  
  101. To submit, send email to: noel@camelcity.com.  If you do NOT want your name
  102. credited in the FAQ, please say so. 
  103.  
  104. ------------------------------
  105.  
  106. Subject: Contents
  107.  
  108. Section 0: What is CSO/qi/ph?
  109.  
  110. Section 1: Setting up and installing a server
  111.         1.1 Where do I get the ph / cso software?
  112.         1.2 How do I install the ph / cso software
  113.     1.2.1 Where should the database files be kept?
  114.     1.3 How do I create a ph database?
  115.     1.4 How do I enable phquery for fuzzy mail addressing?
  116.     1.5 Can I run multiple databases on different ports?
  117.     1.6 How can I register my server?
  118.     1.7 How to I give everyone passwords?
  119.  
  120. Section 2: Common problems / error messages
  121.     2.1 How do I fix "Oops, lost connection to server"
  122.     2.2 How do I do searches using strings with blanks in them?
  123.     2.3 How do I limit the number of responses?
  124.     2.4 Ph is working fine for some entries, but returns "No matches to
  125.         your query" for other entries (especially new entries)
  126.         2.5 How can you get a qi server to not only compile but actually
  127.         serve queries off of a Solaris 2.X machine?
  128.  
  129. Section 3: Questions that have not been answered
  130.     3.1 To which Unix platforms has `ph' been ported?
  131.  
  132. Section 4: Other questions
  133.     4.1 What does CSO stand for?
  134.  
  135. ------------------------------
  136.  
  137. Subject: Section 0: What is CSO/qi/ph?
  138.  
  139. The CSO nameserver provides an efficient database for the storage and
  140. retrieval of a variety of information over the Internet.  Its primary use
  141. is for telephone and email directories, but it may be used to store any
  142. type of information. 
  143.  
  144. CSO is the informal name given to an electronic phonebook/nameserver
  145. database developed at the Computing and Communications Services Office at
  146. the University of Illinois by Steve Dorner and others, and since adopted
  147. by a number of other institutions. The database follows the client server
  148. model; the server maintains the actual data and runs a program called qi
  149. (query interpreter) that receives requests and sends back information. The
  150. client runs a program (often called ph) that sends requests to the server.
  151. The ph client has been ported to most major platform in use on the
  152. Internet, from Unix to Mac and PC.  Client functions are also built into
  153. many of the programs used to provide friendly interfaces to the Internet,
  154. such as gopher, World-Wide Web, and their associated clients (lynx,
  155. mosaic, etc.). 
  156.  
  157. The database is loosely structured and keyed only on people's names and on
  158. their alias, which is a unique identifier for their entry, or on other
  159. "Indexed" and "Public" fields specified in the server configuration; this
  160. permits fast lookup by name or alias, but not lookup by other criteria,
  161. such as phone number.  The server can limit the number of hits returned,
  162. to make it difficult for people to use it to make handy mailing lists.
  163. Most fields of an entry can also be concealed from public view. 
  164.  
  165. The database can be used to store assorted information in addition to
  166. people's ordinary phone book information, and can be used to store
  167. non-people information as well, such as weather data. An email address
  168. might be registered in the database for a person; in this case the
  169. nameserver performs the additional service of routing addresses of the
  170. form fullname@uiuc.edu to a registered 'real' address such as
  171. username@ux1.cso.uiuc.edu. It permits one to have a single email address
  172. at an institution, regardless of the number of host accounts they have.
  173. This conversion is actually done by yet another client called phquery and
  174. not the nameserver itself.  The nameserver in effect stores the mapping
  175. between (alias || callsign || name) and (physical email address).  phquery
  176. is designed to be called by sendmail, perform the lookup, then re-invoke
  177. sendmail with the new address obtained via nameserver lookup. 
  178.  
  179. A CSO database can also be used for security purposes, to validate entry
  180. to important services such as dial-in terminal servers. The present
  181. implementation of the terminal server security software (qtacacsd for
  182. Cisco terminal servers) does indeed query the nameserver. 
  183.  
  184. At the University of Illinois, UofI Direct, the registration service, will
  185. actually use Kerberos for authentication.  The nameserver is a very
  186. important part of this as it provides the initial set of principle names
  187. and passwords to load into Kerberos.  The qi database and the V5 Kerberos
  188. KDC will be maintained in lockstep.  Eventually only a valid Kerberos
  189. ticket will be accepted for login purposes to the UofI qi server.  The
  190. terminal server software will also be changed in the future to obtain
  191. Kerberos ticket granting tickets to verify users. 
  192.  
  193. Thanks to Stan Kerr at the Computing & Communications Services Office at U
  194. of Illinois, for providing most of the information in this section, and to
  195. Paul Pomes and Steve Dorner for reviewing it. 
  196.  
  197. ------------------------------
  198.  
  199. Subject Section 1: Setting up and installing a server
  200.  
  201. ------------------------------
  202.  
  203. Subject: 1.1 Where do I get the ph / cso software?
  204.  
  205. The ph/qi distribution directory previously on vixen.cso.uiuc.edu is
  206. available at
  207.  
  208.         ftp://uiarchive.cso.uiuc.edu/pub/packages/ph
  209.  
  210. The latest beta release of the ph/qi software is in
  211.  
  212.         ftp://uiarchive.cso.uiuc.edu/pub/packages/ph/qi-3.1b7.tar.gz
  213.  
  214. A general Web-based search engine is available on uiarchive to help you
  215. locate other software packages that have moved to this new server.  This
  216. search engine is accessed from the URL:
  217.  
  218.         http://uiarchive.cso.uiuc.edu/elocate.html
  219.  
  220. A patch for linux compilation is available from:
  221.  
  222.         http://www.camelcity.com/~noel/usenet/ph-linux
  223.  
  224. ------------------------------
  225.  
  226. Subject: 1.2 How do I install the ph / cso software?
  227.  
  228. Server
  229. ------
  230.  
  231. To install the server without reading any instructions, look in the
  232. configs directory (in qi).  Change the file "defaults" to include your
  233. domain name, desired directories, and features.  Then look for a config
  234. file for your system.  Finally, in the main qi dir, type: 
  235.  
  236. Configure systemtype
  237. make install
  238.  
  239. Finally, build the database (see 1.3, below), and modify your inetd.conf
  240. file and your services files to reference the server.  Here are sample
  241. entries: 
  242.  
  243. In services:
  244. ns                  105/tcp
  245.  
  246. If you are using NIS, run ypmake after modifying services.
  247.  
  248. In inetd.conf:
  249. ns                  stream tcp nowait root   /usr/local/lib/cso/qi qi -d -t30
  250.  
  251. After modifying inetd.conf, make the inetd reload inetd.conf:
  252.  
  253. inetd -c
  254.  
  255. Client
  256. ------
  257.  
  258. Unix: The Unix client comes as part of the server package.  The easiest
  259. way to install it is to do it as part of the server package, above.  The
  260. Configure script will automatically generate a Makefile for your system,
  261. and will make and install the ph client.  If for some reason you cannot
  262. make the entire qi package, here are the minimal steps for making the
  263. client: 
  264.  
  265. Look in the configs directory (in qi).  Change the file "defaults" to
  266. include your domain name, desired directories, and features.  Then look
  267. for a config file for your system.  Finally, in the main qi dir, type: 
  268.  
  269. Configure systemtype
  270.  
  271. Next, make the api library used by ph:
  272. cd api
  273. make
  274.  
  275. Finally, go back to the qi dir, cd to the ph dir, and do a make:
  276.  
  277. cd ..
  278. cd ph
  279. make
  280.  
  281. If all goes well, finish with:
  282. make install
  283.  
  284. Note that the client distribution (a separate from the entire qi
  285. distribution), includes a Makefile already generated for a system at uiuc.
  286. While it is possible to edit this Makefile (despite the "Do not edit"
  287. warning at the top of the file), it is much easier to make ph as a part of
  288. qi. 
  289.  
  290. Other clients:
  291.  
  292. The ph distribution comes with clients for the following systems:
  293.  
  294. a. CMS, requires TCP/IP for VM Version 1.2 or later IBM C/370 Compiler and
  295.    Runtime library (Version 1.2.0)
  296. b. DOS, with both source and executable, requires MS-DOS, PC/TCP by FTP
  297.    Software
  298. c. MAC, requires MacTCP
  299. d. Next
  300. e. PC-NFS version (for MS-DOS and SUN's PC-NFS)
  301. f. VM, in Pascal
  302. g. VMS 5.3 with Wollongong WIN/TCP 5.1
  303. h. Windows (with winsock)
  304. i. X-Windows
  305.  
  306. Some other clients not part of the distribution:
  307.  
  308. uwho (pronounced "you-who") is another people-finding front end program
  309. that was created by Daniel Kegel (dank@alumni.caltech.edu), because whois
  310. seemed difficult to use- you had to know what the hostname of the whois
  311. server was, which is a detail that users shouldn't have to know. 
  312.  
  313. uwho is a front end to several white pages services (currently, whois,
  314. ph, and KIS). It accepts a name and partial organization name, does a
  315. search for matching organizations, runs whois, ph, or KIS queries (as
  316. appropriate) in parallel, then shows the user the results. It is
  317. powerful simply because it accesses a continually updated list of white
  318. pages servers [i.e., it searches current information, not its "own list
  319. of users"], so its power will grow as more [user-information] servers
  320. come online.
  321.  
  322. Uwho is written in C and runs under Unix, VMS, NT, and MS-DOS. For more
  323. information, consult uwho.doc. The latest version is uwho218b.tar.Z or
  324. uwho218b.zip and can be browsed as individual files. 
  325.  
  326. Or, if you don't have Web access, everything can be had at
  327.     ftp://alumni.caltech.edu/pub/dank/uwho
  328.  
  329. uwho2html, a WWW front end to uwho, is also available.
  330.  
  331.  
  332. Most gopher browsers support PH queries
  333. Many World-Wide-Web browsers
  334. Some Mail packages (notably Eudora)
  335.  
  336.  
  337. Other Vax/VMS clients available via anonymous ftp:
  338.   UCX:           esa.lanl.gov
  339.   UCX:           noc.macc.wisc.edu
  340.   Multinet:      icaen.llnl.gov
  341.   UCX & Mulinet: ftp.ceri.memst.edu
  342.  
  343. ------------------------------
  344.  
  345. Subject: 1.2.1 Where should the database files be kept?
  346.  
  347. (contributed by Gregg TeHennepe gat@jax.org)
  348.  
  349. > Can someone please tell in which directory the database files (prod-*) 
  350. > should be kept or in which file we specify its location.
  351.  
  352. I got confused by this the first time I set qi up... if the prod.* files
  353. are in the directory /usr/local/lib/qi, your DATABASE declaration in the
  354. defaults config should be "/usr/local/lib/qi/prod".  I originally thought
  355. this was set to a directory, and so created the directory
  356. /usr/local/lib/qi/prod, and had the prod.* files there (and it didn't work).
  357.  
  358. ------------------------------
  359.  
  360. Subject: 1.3 How do I create a ph database?
  361.  
  362. To create a database, you need to define the fields for the database,
  363. determine its size, create a text file of data to be input into the
  364. database, then run the database building programs. 
  365.  
  366. a. Defining the database
  367.  
  368. A ph database is defined by a "cnf" file.  The default file which comes
  369. with ph is "prod.cnf".  It's a good idea to start with a copy of this
  370. file, and to change as little as possible.  Some clients rely on the names
  371. of certain fields in the cnf file, so changing them can cause unforeseen
  372. problems.  The ph installation instructions specifically state that you
  373. should NOT change the following fields: 
  374.  
  375. Used in ph source code
  376. ----------------------
  377. 2:email
  378. 3:name
  379. 4:type
  380. 5:id
  381. 6:alias
  382. 7:password
  383. 8:proxy
  384. 23:nickname
  385. 25:all
  386. 30:hero
  387. 43:suppress
  388.  
  389. Used by utilities and clients
  390. -----------------------------
  391. 0:address
  392. 1:phone
  393. 9:department
  394. 10:title
  395. 11:curriculum
  396. 20:home_address
  397. 21:permanent_address
  398. 22:office_address
  399. 26:callsign
  400. 31:no_update
  401. 32:office_phone
  402. 33:home_phone
  403. 35:high_school
  404. 37:permanent_phone
  405. 42:left_uiuc
  406.  
  407. You should be able to change other fields without causing too many
  408. problems.  For each field in the file, you will see a field number, a
  409. field name, the number of bytes in the field, a descriptive name, and a
  410. list of properties for the field.  Each of these items is separated by a
  411. colon, with field entries separated by new lines.  You will probably want
  412. to change the descriptions of some of the fields, as well as their length
  413. in bytes, but you should generally leave the names and numbers alone. 
  414.  
  415. There are numerous properties you can assign to a field, and most sites
  416. will want to customize these properties.  The most commonly changed
  417. properties are as follows: 
  418.  
  419. 1. Lookup: if present, clients can search on this field
  420.  
  421. 2. Public: if present, clients can see this field.  LocalPub is a
  422. variation which allows only clients in the local domain to see the field. 
  423. If neither is present, only the system administrators and owners can see
  424. the field. 
  425.  
  426. 3. Default: If this is present, the contents of the field are returned on
  427. normal searches.  If not present, the contents are returned only when
  428. specifically requested by the client. 
  429.  
  430. 4. Change: if present, clients who have authenticated (logged in) can
  431. change the contents of the field. 
  432.  
  433. b. Creating an input file
  434.  
  435. To create an input file, you create a tab-delimited file containing the
  436. information for the database.  Each line will be composed of field
  437. numbers, a colon, the data for the field, and a tab (if another field
  438. follows).  The format looks like this: 
  439.  
  440. fieldnum:data-for-field (tab)    fieldnum:data-for-field... (new line)
  441.  
  442. Here's a simple example:
  443.  
  444. 3:Hunter, Noel C    32:759-5812     22:POBox 7408    4:p
  445. 3:Dominick, James Lyon    32:759-5261    4:p
  446.  
  447. This example has two records, one for Noel Hunter, and one for James
  448. Dominick.  Both records include data for fields 3,4 and 32, and the entry
  449. for Noel Hunter also has data for field 22. 
  450.  
  451. Notice that the entries do not have to be in any order, and that some
  452. entries can contain more fields than others.  Field 4, the "type" field,
  453. must be present if you want ph to limit the number of entries returned by
  454. searches. 
  455.  
  456. c. Building the database
  457.  
  458. Assuming that the database cnf file (see a, above) is called "prod.cnf",
  459. and the database text input file (see b, above) is called "qi.input", we
  460. can create a ph database with the following shell script (note that this
  461. version now works on a copy rather than the production database,
  462. minimizing the time that the server is down): 
  463.  
  464. #!/bin/sh
  465. # PH database build script
  466. # Designed from numerous contributions to the info-ph list
  467. # Coded by Noel Hunter (noel@camelcity.com)
  468. # Builds a PH Database from the input stored in the file qi.input.
  469. # During the build, works on a copy of the database, not the working version.
  470. # If disk space is a premium, modify the script to work on prod, not prod-new.
  471. #
  472. # The latest version of this script is available from:
  473. # http://www.camelcity.com/~noel/usenet/ph-build.sh
  474. #
  475. echo "PH database build script started..."
  476. #
  477. # cd to the cso library directory.  We assume all the cso programs  
  478. # are installed here:
  479. cd /usr/local/lib/cso
  480. #
  481. echo "Making a working copy of prod.cnf for building the new database..."
  482. cp prod.cnf prod-new.cnf
  483. #
  484. # Determine the size for the database using the "sizedb" program
  485. # that comes with the server.  You need perl to use sizedb, along
  486. # with the file primes.shar.  If you don't have these, you can hard-
  487. # code in a prime bigger than the number of indexed fields (from the
  488. # cnf file) times the number of records in your database (qi.input):
  489. echo "Calculating size..."
  490. size=`./sizedb prod-new.cnf qi.input`
  491. #
  492. # Build the database using the specifications in "prod-new.cnf", and the
  493. # data in "qi.input"
  494. echo "Executing credb..."
  495. ./credb $size prod-new
  496. echo "Executing maked..."
  497. ./maked prod-new <qi.input
  498. echo "Executing makei..."
  499. ./makei prod-new
  500. echo "Executing build..."
  501. ./build -s prod-new
  502. #
  503. # Move the new database into place:
  504. echo "Moving database into place..."
  505. mv prod-new.bdx prod.bdx
  506. mv prod-new.bnr prod.bnr
  507. mv prod-new.dir prod.dir
  508. mv prod-new.dov prod.dov
  509. mv prod-new.idx prod.idx
  510. mv prod-new.iov prod.iov
  511. mv prod-new.lck prod.lck
  512. mv prod-new.seq prod.seq
  513. #
  514. # Set permissions so that users cannot access the database directly.
  515. # We assume that the qi server is running under a login that can
  516. # access the files, if not, change "whois" below to the appropriate
  517. # user name:
  518. chown whois *
  519. chmod -R o-rwx,g-rwx *
  520. #
  521. echo "PH database build script complete."
  522.  
  523. ------------------------------
  524.  
  525. Subject: 1.4 How do I enable phquery for fuzzy mail addressing?
  526.  
  527. (contributed by Sverre Froyen, modified by Noel Hunter)
  528.  
  529. Fuzzy addressing is done by the program "phquery", part of the ph client
  530. distribution.  Fuzzy addressing allows users to send mail based on a
  531. person's real name, rather than their login ID.  Phquery performs the
  532. conversion from the real name to an email address, using the ph database. 
  533. Adding phquery is complicated, and you must be very careful or you will
  534. disrupt incoming mail.  If possible, try it out on a non-production system
  535. first. 
  536.  
  537. For phquery to work, alias must be at least "Indexed:Lookup:Public" in
  538. prod.cnf.  Default is also good to add.  Ditto for the callsign and name
  539. fields (Paul Pomes). 
  540.  
  541. To make it work, first compile phquery on your machine.  It's part of the
  542. ph client distribution available from the main ftp archive (see 1.3,
  543. below). 
  544.  
  545. After compiling it, you want to make sure that it works correctly by
  546. running it in debug mode. Type, e.g.,
  547.  
  548. phquery -d -f your-address test-name < /dev/null
  549.  
  550. If it works, you are ready to install it by changing you sendmail
  551. configuration file to route incoming messages through phquery.  How you do
  552. this will vary with each version of Unix, but here is a sample. 
  553.  
  554. On most Unix systems, the file to alter is sendmail.cf.  Here are diffs of
  555. how it was done on one system: 
  556.  
  557. Adding the phquery mailer:
  558.  
  559. *** 235,240 ****
  560. --- 239,248 ----
  561.   Mlocal,       P=/bin/mail, F=flsSDFMmnP, S=10, R=20, A=mail -d $u
  562.   Mprog,        P=/bin/sh,   F=lsDFMeuP,  S=10, R=20, A=sh -c $u
  563.  
  564. + # Phquery specification
  565. +
  566. + MPH,  P=/etc/phquery, F=DFMhnmur, A=phquery $u
  567. +
  568.   S10
  569.   # None needed.
  570.  
  571. ***************
  572.  
  573. Adding the rule to invoke phquery:
  574.  
  575. *** 353,364 ****
  576. --- 361,376 ----
  577.   # Handle special cases.....
  578.   R@                    $#local $:$n                    handle <> form
  579.  
  580. + # Invoke phquery to resolve names addressed to domain (sverre)
  581. + R$+<@LOCAL>           $#PH $@$w $:$1
  582. +
  583.   # resolve the local hostname to "LOCAL".
  584.   R$*<$*$=w.LOCAL>$*    $1<$2LOCAL>$4                   thishost.LOCAL
  585.   R$*<$*$=w.uucp>$*     $1<$2LOCAL>$4                   thishost.uucp
  586.   R$*<$*$=w>$*          $1<$2LOCAL>$4                   thishost
  587.  
  588. ***************
  589.  
  590. Note that I had to add the phquery rule before the local hostname gets
  591. resolved to LOCAL.  After this point there is no way to distinguish mail
  592. to the domain from mail to the local host and a mail loop will result.
  593. Also make sure that From: line contains the hostname and not just the
  594. domain name.  Our mailer used just the domainname and I had a wonderful
  595. mail loop bouncing mail with another site because phquery could not
  596. resolve MAILER_DAEMON.  You can check your sendmail.cf file by running
  597. sendmail (by hand) with the -bt option, i.e.,
  598.  
  599. /usr/lib/sendmail -bt -C new-configuration file
  600.  
  601. and asking it to invoke the various rules, type for instance
  602.  
  603. 4,0 some-address
  604.  
  605. and it will show how rules 4 and 0 treats the address.
  606.  
  607. ***************
  608.  
  609. AN ARCHIVE of sendmail.cf diff files is maintained at:
  610.  
  611. http://www.camelcity.com/~noel/usenet/phquery-diffs/
  612.  
  613. You can use these diffs to make changes to your sendmail.cf file. 
  614. Currently, only two diffs are available: 
  615.  
  616. sendmailV8 (UCB Sendmail Version 8)
  617. sunos52    (SUN OS Version 5.2)
  618.  
  619. For IDA sendmail, the phquery program is now part of the qi distribution on 
  620. uiarchive (see Subject: 1.1 Where do I get the ph / cso software?)
  621.  
  622. If you have phquery working, PLEASE send us a diff by executing the command:
  623.  
  624. diff -c sendmail.cf.clean sendmail.cf
  625.  
  626. (provided your original file is sendmail.cf.clean).  Then mail the output
  627. of the command, along with the output of "uname -a" to noel@camelcity.com. 
  628.  
  629. ------------------------------
  630.  
  631. Subject: 1.5 Can I run multiple databases on different ports?
  632.  
  633. Yes.  You can use one binary (copy of the software).  On a Unix system,
  634. make multiple entries in /etc/services and /etc/inetd.conf, and use the
  635. -DATABASE option with each entry in /etc/inetd.conf to specify the desired
  636. database for that port. 
  637.  
  638. Here are some sample entries from /etc/services and /etc/inetd.conf
  639.  
  640. /etc/services:
  641. ns              105/tcp         # CCSO nameserver
  642. ns-clio         106/tcp
  643. ns-eha          107/tcp
  644.  
  645. /etc/inetd.conf:
  646. ns              stream  tcp     nowait  root    /usr/local/etc/qi qi
  647. ns-clio         stream  tcp     nowait  root    /usr/local/etc/qi qi \
  648.  -DATABASE=/usr/users/nameserv/db/clio
  649. ns-eha          stream  tcp     nowait  root    /usr/local/etc/qi qi \
  650.  -DATABASE=/usr/users/nameserv/db/eha
  651.  
  652.         (ns-clio and ns-eha are each one line, no breaks.)
  653.  
  654. (Samples contributed by Steve Madsen  <smadsen@cs.muohio.edu>)
  655.  
  656. ------------------------------
  657.  
  658. Subject: 1.6 How can I register my CSO server?
  659.  
  660. You can send a note to Joel Cooper (cooper@utopia.cc.nd.edu) or (John
  661. Norstad, j-norstad@nwu.edu) . They need to know the name of your
  662. institution as you wish it to appear in the directory, plus the domain
  663. name of your new CSO server.  Joel maintains the list used by Gopher. They
  664. try to keep their lists synchronized, so you only need to tell one of
  665. them. John had announced that he would soon stop maintaining the list for
  666. the Mac client, but has since been persuaded to continue maintaining the
  667. list. 
  668.  
  669. ------------------------------
  670.  
  671. Subject: 1.7 How to I give everyone passwords?
  672.  
  673. (contributed by Brian T. Shelden)
  674.  
  675. Password is just a field in the database, like any other. So, in your
  676. tab-separated input file (see question 1.3) just add values for the
  677. Password field in your .cnf file.  (Usually 7.)
  678.  
  679. Here's how I give everyone randomly generated passwords for the Directory
  680. of Legal Academia <gopher://gopher.law.cornell.edu/11/csodir/>. 
  681.  
  682. % mdump all > output.qi
  683. % qi2readable output.qi | givepw | readable2qi > input.qi
  684.  
  685. Now remake the database with input.qi.  Below are the scripts qi2readable,
  686. givepw, and readable2qi.  (Yes, it could be done in one script, but
  687. qi2readable and and readable2qi are useful for other things, too.)
  688.  
  689.  
  690. ==================== qi2readable ==================== (cut here)
  691. #! /usr/local/bin/perl
  692.  
  693. while (<>) {
  694.         chop;
  695.         @a = split(/\t/);
  696.         foreach $a (@a) {
  697.                 print "$a\n" if $a !~ /^\s*$/;
  698.         }
  699.         print "--------------------\n";
  700. }
  701.  
  702. ==================== readable2qi ==================== (cut here)
  703. #! /usr/local/bin/perl
  704.  
  705. while (<>) {
  706.         if (/^[-]+$/) {
  707.                 print "\t\n";
  708.         }
  709.         elsif (/\S+/) {
  710.                 chop;
  711.                 print $_, "\t";
  712.         }
  713. }
  714.  
  715. ==================== givepw ==================== (cut here)
  716. #! /usr/local/bin/perl -w
  717.  
  718. $pwnum = 7;
  719.  
  720. srand($$|time);
  721.  
  722. $hadapw = 0;
  723. while (<>) {
  724.         if (/^[\-]+$/) {
  725.                 if (! $hadapw) {
  726.                         $ascii_passwd = &pw_generate;
  727.                         print "${pwnum}:$ascii_passwd\n";
  728.                 }
  729.                 $hadapw = 0;
  730.         }
  731.         elsif (/^${pwnum}:/) {
  732.                 $hadapw = 1;
  733.         }
  734.         print;
  735. }
  736.  
  737. #------------------------------------------------------------------------------
  738. # Generate funky random password:
  739. #------------------------------------------------------------------------------
  740. sub pw_generate {
  741.         local(@passset, $rnd_passwd, $randum_num);
  742.         local($randum_num);
  743.         
  744.         @passset = ('a'..'k', 'm'..'z', 'A'..'N', 'P'..'Z', '2'..'9');
  745.         $rnd_passwd = "";
  746.         for ($i = 0; $i < 8; $i++) {
  747.                 $randum_num = int(rand($#passset + 1));
  748.                 $rnd_passwd .= @passset[$randum_num];
  749.         }
  750.  
  751.         return $rnd_passwd;
  752. }
  753.  
  754.  
  755. ------------------------------
  756.  
  757. Subject: Section 2: Common problems / error messages
  758.  
  759. ------------------------------
  760.  
  761. Subject: 2.1 How do I fix "Oops, lost connection to server"
  762.  
  763. There are many possible causes for this problem.  Here is a list of things
  764. to check: 
  765.  
  766. 1. Are the permissions set so that the login running qi (look in your
  767. "inetd.conf" file to determine the login) can read all of the files?  The
  768. permissions should look something like this (assuming the user is root): 
  769.  
  770. -rw-------   1 root     sys      3153408 Dec  6 05:03 prod.*
  771. -rwx------   1 root     sys       180224 Nov 30 11:22 qi
  772.  
  773. If qi is not running as root, you need to chown the files so that the qi
  774. user can read them, and can execute qi. 
  775.  
  776. 2. Are the ph binaries installed in the right place (specified during the
  777. make and in "inetd.conf"?  Is the ph directory accessible?  Did you move
  778. the sources after you installed (this can cause problems). 
  779.  
  780. 3. Did you build the database, and did it work (see 1.3)?
  781.  
  782. 4. Are the service names in /etc/services and /etc/inted.conf the same,
  783. and are they the same as the one specified in the makefiles? 
  784.  
  785. 5. Did you restart inetd (with inetd -c), and rebuild the NIS database (if
  786. using NIS, run ypmake), after you installed ph? 
  787.  
  788. 6. Is the prod.cnf (or other cnf) file for your database in the same
  789. directory as the database (it has to be). 
  790.  
  791. 7. If the client does not have a registered domain name, qi may be denying
  792. access.  Try compiling with the the -DNOCHECKNET option (add that to your
  793. "$Cflags" variable in the config file used to build qi and then rebuild
  794. qi.)
  795.  
  796. ------------------------------
  797.  
  798. Subject: 2.2 How do I do searches using strings with blanks in them?
  799.  
  800. (contributed by guthery@austin.slcs.slb.com)
  801.  
  802. Suppose the field you are searching is called Address and you want all the
  803. Smiths who live in "New York".  You would enter the following in the Ph
  804. command box: 
  805.  
  806. name=Smith address=New address=York
  807.  
  808. ------------------------------
  809.  
  810. Subject: 2.3 How do I limit the number of responses?
  811.  
  812. To limit the number of responses returned, you need to do two things:
  813.  
  814. 1. When compiling the server, set the "person limit", in the file
  815. qi/configs/defaults.  Look for the line: 
  816.  
  817. "PersonLimit","100",                  # max # of people to return
  818.  
  819. and set the value (100 in this example) to the desired number of entries.
  820.  
  821. 2. For all records you want to limit, you must set the "type" field to
  822. "person", or "p".  When you are building the database, just include data
  823. for the type field (field 4) with each person's entry (see the example in
  824. section 1.3). 
  825.  
  826. ------------------------------
  827.  
  828. Subject: 2.4 Ph is working fine for some entries, but returns "No matches
  829. to your query" for other entries (especially new entries)
  830.  
  831. After building a small test database then adding and modifying entries, a
  832. query to the database returns "No matches to your query".  Since the entry
  833. has just been added (and qi acknowledged that it has been added), the user
  834. knows the entry is there.  If the user queries one of the original entries
  835. in the database that has not been modified, that entry will usually be
  836. found. This problem is due to the fact that the original database is small
  837. so the SIZE returned from sizedb is small.  If SIZE is used when building
  838. the database, there is not much room for the database to grow. Use a
  839. larger value for size to avoid this problem (see Subject 1.3). 
  840.  
  841. ------------------------------
  842.  
  843. Subject: 2.5 How can you get a qi server to not only compile but actually
  844. serve queries off of a Solaris 2.X machine? 
  845.  
  846. The latest version comes with a solaris2 configuration file already.  It
  847. compiled nicely with gcc on both Solaris 2.3 and Solaris 2.2.  It works,
  848. too. :-)
  849.  
  850. Submitted by: Aleks Margan <margan@triglav.cis.yale.edu>
  851.  
  852. ------------------------------
  853.  
  854. Subject: Section 3: Questions that have not been answered.
  855.  
  856. ------------------------------
  857.  
  858. Subject: 3.1 To which Unix platforms has `ph' been ported?
  859.  
  860. ------------------------------
  861.  
  862. Subject: Section 4: Other questions
  863.  
  864. ------------------------------
  865.  
  866. Subject: 4.1 What does CSO stand for?
  867.  
  868. CSO was the acronym for the University of Illinois Computing Services
  869. Office, which is now the Computing and Communications Services Office
  870. (CCSO). 
  871.  
  872. ------------------------------
  873.  
  874. End of ph-FAQ
  875. *************
  876. -- 
  877. * Noel Hunter                            noel@camelcity.com *
  878. * The power behind the pages...    http://www.camelcity.com *
  879. * Free database, shopping software -   CGI, PHP, Javascript *
  880.  
  881.