none
[openafs-wiki.git] / TWiki / TWikiSiteTools.mdwn
1 <div>
2   <ul>
3     <li><a href="#TWikiSiteTools"> TWikiSiteTools</a><ul>
4         <li><a href="#WebNotify Recent Changes Alert"> WebNotify Recent Changes Alert</a><ul>
5             <li><a href="#Configuring Outgoing Mail"> Configuring Outgoing Mail</a></li>
6             <li><a href="#Setting the Automatic Email Sche"> Setting the Automatic Email Schedule</a></li>
7           </ul>
8         </li>
9         <li><a href="#WebStatistics Site Usage Log"> WebStatistics Site Usage Log</a><ul>
10             <li><a href="#Configuring for Automatic Operat"> Configuring for Automatic Operation</a></li>
11             <li><a href="#Generating Statistics Manually b"> Generating Statistics Manually by URL</a></li>
12           </ul>
13         </li>
14         <li><a href="#WebSearch"> WebSearch</a><ul>
15             <li><a href="#WebChanges"> WebChanges</a></li>
16             <li><a href="#WebIndex"> WebIndex</a></li>
17           </ul>
18         </li>
19       </ul>
20     </li>
21   </ul>
22 </div>
23
24 # <a name="TWikiSiteTools"></a><a name="_TWikiSiteTools"></a> TWikiSiteTools
25
26 _Utilities for searching, navigation, and monitoring site activity_
27
28 [[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.
29
30 ## <a name="WebNotify Recent Changes Alert"></a><a name="_WebNotify Recent Changes Alert"></a> WebNotify Recent Changes Alert
31
32 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.
33
34 - You can create a [[WebNotify]] using [[TWikiVariables]] with <code>**%NOTIFYTOPIC%**</code>
35
36 ### <a name="Configuring Outgoing Mail"></a> Configuring Outgoing Mail
37
38 %WIKITOOLNAME% will use the <code>**Net::SMTP**</code> module if it is installed on your system. Set this with the <code>**SMTPMAILHOST**</code> variable in [[TWikiPreferences]].
39
40 You can use an external mail program, like <code>**sendmail**</code>, if the `Net::SMTP` module is not installed. Set the program path in <code>**$mailProgram**</code> in <code>**TWiki.cfg**</code>.
41
42 - %H% Net::SMTP can be easily disabled (ex: if there is an installation error) by setting <code>**SMTPMAILHOST**</code> in [[TWikiPreferences]] to an empty value.
43
44 - %T% You can set a separate <code>**SMTPSENDERHOST**</code> variable to define the mail sender host (some SMTP installations require this).
45
46 ### <a name="Setting the Automatic Email Sche"></a> Setting the Automatic Email Schedule
47
48 **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:
49
50     % crontab -e
51     15,45 * * * * (cd ~twiki/public_html/bin; ./mailnotify -q)
52
53 The above line will call mailnotify at 15 minutes and 45 minutes past every hour. The `-q` switch suppresses all normal output.
54
55 **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.
56
57 **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).
58
59 ## <a name="WebStatistics Site Usage Log"></a><a name="_WebStatistics Site Usage Log"></a> WebStatistics Site Usage Log
60
61 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.
62
63 - You can create a [[WebStatistics]] link using [[TWikiVariables]] with <code>**%STATISTICSTOPIC%**</code>
64
65 ### <a name="Configuring for Automatic Operat"></a> Configuring for Automatic Operation
66
67 - You can automatically generate usage statistics for all webs. To enable this:
68   - Make sure variable `$doLogTopicView, $doLogTopicSave and $doLogTopicUpload` in `TWiki.cfg` are set. This will generate log entries in file `twiki/data/log<date>.txt` .
69   - 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.
70   - Call the `twiki/bin/statistics` script from a cron job, once a day is recommended. This will update the [[WebStatistics]] topics in all webs.
71   - **_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)`
72   - 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)`
73
74 ### <a name="Generating Statistics Manually b"></a> Generating Statistics Manually by URL
75
76 - The `twiki/bin/statistics` script can also be executed as a CGI script, just enter the URL in your browser. Examples:
77   - Update current month for all webs: <br />`http://mydomain.com/twiki/bin/statistics`
78   - Update current month for Main web only: <br />`http://mydomain.com/twiki/bin/statistics/Main`
79   - Update January 2000 for Main web: <br />`http://mydomain.com/twiki/bin/statistics/Main?logdate=200001`
80
81 ## <a name="WebSearch"></a><a name="_WebSearch"></a> WebSearch
82
83 [[WebSearch]] is an extremely fast and flexible search facility, part of the core TWiki feature set. Options include:
84
85 - topic title or full-text search
86 - regular expressions
87 - search within web or site-wide
88 - index-style A-Z alphabetical listing sorted topic title
89 - many more
90
91 See also: [[TWikiVariables]] for including hard-coded searches in text.
92
93 ### <a name="WebChanges"></a><a name="_WebChanges"></a> WebChanges
94
95 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.
96
97 This is simply a preset `SEARCH`. The number of topics listed by the `limit` parameter.:
98
99 > <pre>
100 > %SEARCH{".*" web="%INCLUDINGWEB%" regex="on" nosearch="on" order="modified" <br />reverse="on" limit="50"}%
101 > </pre>
102
103 ### <a name="WebIndex"></a><a name="_WebIndex"></a> WebIndex
104
105 [[WebIndex]] lists all web topics in alphabetical order, with the first couple of lines of text. This is simply a preset `SEARCH`:
106
107 > %SEARCH{"\.*" scope="topic" regex="on" nosearch="on"}%
108
109 -- [[MikeMannix]] - 01 Dec 2001