/Tools/faqwiz/README

http://unladen-swallow.googlecode.com/ · #! · 114 lines · 88 code · 26 blank · 0 comment · 0 complexity · 3b618f59c42c0d4c32b738646bf822b9 MD5 · raw file

  1. FAQ Wizard
  2. ----------
  3. Author: Guido van Rossum <guido@python.org>
  4. Version: 1.0
  5. Date: 6 April 1998
  6. This is a CGI program that maintains a user-editable FAQ. It uses RCS
  7. to keep track of changes to individual FAQ entries. It is fully
  8. configurable; everything you might want to change when using this
  9. program to maintain some other FAQ than the Python FAQ is contained in
  10. the configuration module, faqconf.py.
  11. Note that the bulk of the code is not an executable script; it's an
  12. importable module. The actual script in cgi-bin is minimal.
  13. Files:
  14. faqw.py executable script to be edited and installed in cgi-bin
  15. faqwiz.py main module, lives in same directory as FAQ entry files
  16. faqconf.py main configuration module
  17. faqcust.py additional local customization module (optional)
  18. move-faqwiz.sh Script to move faqwiz entries.
  19. What's New?
  20. -----------
  21. Version 1.0 corrects some minor bugs and uses tab-agnostic
  22. indentation; it is otherwise unchanged from version 0.9.0.
  23. Version 0.9.0 uses the re module (Perl style regular expressions) for
  24. all its regular expression needs, instead of the regex and regsub
  25. modules (Emacs style). This affects the syntax for regular
  26. expressions entered by the user as search strings (with "regular
  27. expression" checked), hence the version number jump.
  28. Setup Information
  29. -----------------
  30. This assumes you are familiar with Python, with your http server, and
  31. with running CGI scripts under your http server. You need Python 1.5
  32. or better.
  33. Select a place where the Python modules that constitute the FAQ wizard
  34. will live (the directory where you unpacked it is an obvious choice).
  35. This will be called the SRCDIR. This directory should not be writable
  36. by other users of your system (since they would be able to execute
  37. arbitrary code by invoking the FAQ wizard's CGI script).
  38. Create a dedicated working directory, preferably one that's not
  39. directly reachable from your http server. This will be called the
  40. FAQDIR. Create a subdirectory named RCS. Make both the working
  41. directory and the RCS subdirectory wrld-writable. (This is essential,
  42. since the FAQ wizard runs as use nobody, and needs to create
  43. additional files here!)
  44. Edit faqconf.py to reflect your setup. You only need to edit the top
  45. part, up till the line of all dashes. The comments should guide you
  46. in your edits. (Actually, you can also choose to add your changes to
  47. faqcust.py and leave faqconf.py alone. This is essential if you are
  48. maintaining multiple FAQs; see below.)
  49. Don't forget to edit the SECTION_TITLES variables to reflect the set
  50. of section titles for your FAQ!
  51. Next, edit faqw.py to reflect the pathname of your Python interpreter
  52. and the values for SRCDIR and FAQDIR that you just chose. Then
  53. install faqw.py in your cgi-bin directory. Make sure that it is
  54. world-executable. You should now be able to connect to the FAQ wizard
  55. by entering the following URL in your web client (subsituting the
  56. appropriate host and port for "your.web.server", and perhaps
  57. specifying a different directory for "cgi-bin" if local conventions so
  58. dictate):
  59. http://your.web.server/cgi-bin/faqw.py
  60. If you are unable to get this working, check your server's error_log
  61. file. The documentation for Python's cgi module in the Python Library
  62. Reference Manual gives plentyu additional information about installing
  63. and debugging CGI scripts, including setup debugging. This
  64. documentation is repeated in the doc string in the cgi module; try
  65. ``import cgi; print cgi.__doc__''.
  66. Assuming this works, you should now be able to add the first entry to
  67. your FAQ using the FAQ wizard interface. This creates a file
  68. faq01.001.htp in your working directory and an RCS revision history
  69. file faq01.001.htp,v in the RCS subdirectory. You can now exercise
  70. the other FAQ wizard features (search, index, whole FAQ, what's new,
  71. roulette, and so on).
  72. Maintaining Multiple FAQs
  73. -------------------------
  74. If you have multiple FAQs, you need a separate FAQDIR per FAQ, and a
  75. different customization file per FAQ. The easiest thing to do would
  76. be to have the faqcust.py for each FAQ live in the FAQDIR for that
  77. FAQ, but that creates some security concerns, since the FAQDIR must be
  78. world writable: *if* someone who breaks into your system (or a
  79. legitimate user) manages to edit the faqcust.py file they can get
  80. arbitrary code to execute through the FAQ wizard. Therefore, you will
  81. need a more complex setup.
  82. The best way is probably to have a directory that is only writable by
  83. you for each FAQ, where you place the copy of faqcust.py for that FAQ,
  84. and have a world-writable subdirectory DATA for the data. You then
  85. set FAQDIR to point to the DATA directory and change the faqw.py
  86. bootstrap script to add FAQDIR/.. to sys.path (in front of SRCDIR, so
  87. the dummy faqcust.py from SRCDIR is ignored).
  88. --Guido van Rossum (home page: http://www.python.org/~guido/)