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