58d882b3744655674fe182eda42fdb5c26bd1dca
[openafs-wiki.git] / TWiki / TWikiSiteTools.mdwn
1 <div>
2   <ul>
3     <li><a href="#TWikiSiteTools"> TWikiSiteTools</a><ul>
4         <li><a href="#Overview"> Overview</a></li>
5         <li><a href="#WebNotify Recent Changes Alert"> WebNotify Recent Changes Alert</a><ul>
6             <li><a href="#Configuring Outgoing Mail"> Configuring Outgoing Mail</a></li>
7             <li><a href="#Setting the Automatic Email Sche"> Setting the Automatic Email Schedule</a></li>
8           </ul>
9         </li>
10         <li><a href="#WebStatistics Site Usage Log"> WebStatistics Site Usage Log</a><ul>
11             <li><a href="#Configuring for Automatic Operat"> Configuring for Automatic Operation</a></li>
12             <li><a href="#Generating Statistics Manually b"> Generating Statistics Manually by URL</a></li>
13           </ul>
14         </li>
15         <li><a href="#WebSearch"> WebSearch</a><ul>
16             <li><a href="#WebChanges"> WebChanges</a></li>
17             <li><a href="#WebIndex"> WebIndex</a></li>
18           </ul>
19         </li>
20       </ul>
21     </li>
22   </ul>
23 </div>
24
25 # <a name="TWikiSiteTools"></a><a name="_TWikiSiteTools"></a> TWikiSiteTools
26
27 _Utilities for searching, navigation, and monitoring site activity_
28
29 ## <a name="Overview"></a> Overview
30
31 [[TWikiSiteTools]] include utilities for navigating, searching and keeping up with site activity. Preferences can be configured by web or site-wide. You are currently in the **TWiki** web. In particular, TWiki provides two highly configurable, automated site monitoring tools, **WebNotify**, to email alerts when topics are edited, and **WebStats**, to generate detailed activity reports.
32
33 ## <a name="WebNotify Recent Changes Alert"></a><a name="_WebNotify Recent Changes Alert"></a> WebNotify Recent Changes Alert
34
35 Each TWiki web has an automatic email alert service that sends a list of recent changes on a preset schedule, like once a day. Users can subscribe and unsubscribe using [[WebNotify]] in each web. The Perl script `mailnotify` is called by a deamon in regular intervals. The script sends an automated email to subscribed users if topics were changed in a web within last interval.
36
37 - You can create a [[WebNotify]] using [[TWikiVariables]] with <code>**%NOTIFYTOPIC%**</code>
38
39 ### <a name="Configuring Outgoing Mail"></a> Configuring Outgoing Mail
40
41 %WIKITOOLNAME% will use the `Net::SMTP` module in case it is installed on your system. You need to specify the `SMTPMAILHOST` variable in [[TWikiPreferences]].
42
43 You can use an external mail program like `sendmail` in case the `Net::SMTP` module is not installed. In this case specify the `$mailProgram` in `twiki/bin/TWiki.cfg`.
44
45 ### <a name="Setting the Automatic Email Sche"></a> Setting the Automatic Email Schedule
46
47 **For Unix platforms:** Edit the `cron` table so that `mailnotify` is called in an interval of your choice. Please consult `man crontab` of how to modify the table that schedules program execution at certain intervals. Example:
48
49     % crontab -e
50     15,45 * * * * (cd ~twiki/public_html/bin; ./mailnotify -q)
51
52 The above line will call mailnotify at 15 minutes and 45 minutes past every hour. The `-q` switch suppresses all normal output.
53
54 **For ISP installations:** Many ISPs don't allow hosted accounts direct cron access, as it's often used for things that can heavily load the server. Workaround scripts are available.
55
56 **On Windows NT/2000:** You can use a scheduled task if you have administrative privileges. **_Note:_** AT on an NT machine is pretty limited. Microsoft lists several third-party [replacements](http://www.microsoft.com/ntserver/partners/findoffering/serversolutions/Maintnce.asp#cron) (as of 2001-11-20, none of them free).
57
58 ## <a name="WebStatistics Site Usage Log"></a><a name="_WebStatistics Site Usage Log"></a> WebStatistics Site Usage Log
59
60 You can generate a listing manually, or on an automated schedule, of visits to individual pages, on a per web basis. Compiled as a running total on a monthly basis. Includes totals for Topic Views, Topic Saves, Attachment Uploads, Most Popular Topics with number of views, and Top Contributors showing total of saves and attachment uploads. Previous months are saved.
61
62 - You can create a [[WebStatistics]] link using [[TWikiVariables]] with <code>**%STATISTICSTOPIC%**</code>
63
64 ### <a name="Configuring for Automatic Operat"></a> Configuring for Automatic Operation
65
66 - You can automatically generate usage statistics for all webs. To enable this:
67   - Make sure variable `$doLogTopicView, $doLogTopicSave and $doLogTopicUpload` in `TWiki.cfg` are set. This will generate log entries in file `twiki/data/log<date>.txt` .
68   - The [[WebStatistics]] topic must be present in all webs where you want to have statistics. You can use the topic in the Main web as a template.
69   - Call the `twiki/bin/statistics` script from a cron job, once a day is recommended. This will update the [[WebStatistics]] topics in all webs.
70   - **_Attention:_** The script must run as the same user as the CGI scripts are running, which is user `nobody` on most systems. Example crontab entry: <br />`0 0 * * * (cd /path/to/TWiki/bin; ./statistics >/dev/null 2>&1)`
71   - There is a workaround in case you can't run the script as user `nobody` : Run the utility `twiki/bin/geturl` in your cron job and specify the URL of the `twiki/bin/statistics` script as a parameter. Example: <br />`0 0 * * * (cd /path/to/TWiki/bin; ./geturl mydomain.com /urlpath/to/TWiki/bin/statistics >/dev/null 2>&1)`
72
73 ### <a name="Generating Statistics Manually b"></a> Generating Statistics Manually by URL
74
75 - The `twiki/bin/statistics` script can also be executed as a CGI script, just enter the URL in your browser. Examples:
76   - Update current month for all webs: <br />`http://mydomain.com/twiki/bin/statistics`
77   - Update current month for Main web only: <br />`http://mydomain.com/twiki/bin/statistics/Main`
78   - Update January 2000 for Main web: <br />`http://mydomain.com/twiki/bin/statistics/Main?logdate=200001`
79
80 ## <a name="WebSearch"></a><a name="_WebSearch"></a> WebSearch
81
82 [[WebSearch]] is an extremely fast and flexible search facility, part of the core TWiki feature set. Options include:
83
84 - topic title or full-text search
85 - regular expressions
86 - search within web or site-wide
87 - index-style A-Z alphabetical listing sorted topic title
88 - many more
89
90 See also: [[TWikiVariables]] for including hard-coded searches in text.
91
92 ### <a name="WebChanges"></a><a name="_WebChanges"></a> WebChanges
93
94 To check for the most recently edited topics while on-site, use the [[WebChanges]] link, usually located on the upper toolbar. It lists the most recently modified topics, newest first, along with the first couple of lines of the page content.
95
96 This is simply a preset `SEARCH`. The number of topics listed by the `limit` parameter.:
97
98 > <pre>
99 > %SEARCH{".*" web="%INCLUDINGWEB%" regex="on" nosearch="on" order="modified" <br />reverse="on" limit="50"}%
100 > </pre>
101
102 ### <a name="WebIndex"></a><a name="_WebIndex"></a> WebIndex
103
104 [[WebIndex]] lists all web topics in alphabetical order, with the first couple of lines of text. This is simply a preset `SEARCH`:
105
106 > %SEARCH{"\.*" scope="topic" regex="on" nosearch="on"}%
107
108 -- [[MikeMannix]] - 01 Dec 2001