none
[openafs-wiki.git] / TWiki / TWikiSiteTools.mdwn
1 <div>
2   <ul>
3     <li><a href="#TWiki Site Tools"> TWiki Site Tools</a><ul>
4         <li><a href="#WebNotify - recent changes alert"> WebNotify - recent changes alert</a></li>
5         <li><a href="#WebSearch - search TWiki site"> WebSearch - search TWiki site</a></li>
6         <li><a href="#WebChanges - what's new"> WebChanges - what's new</a></li>
7         <li><a href="#WebIndex - list of topics"> WebIndex - list of topics</a></li>
8         <li><a href="#WebStatistics - site statistics"> WebStatistics - site statistics</a><ul>
9             <li><a href="#Configuring for automatic operat"> Configuring for automatic operation</a></li>
10             <li><a href="#Generating statistics manually b"> Generating statistics manually by URL</a></li>
11           </ul>
12         </li>
13         <li><a href="#Log Files"> Log Files</a></li>
14         <li><a href="#E-mail"> E-mail</a><ul>
15             <li><a href="#Configuring outgoing mail"> Configuring outgoing mail</a></li>
16             <li><a href="#Setting the automatic e-mail sch"> Setting the automatic e-mail schedule</a></li>
17           </ul>
18         </li>
19         <li><a href="#Site Permissions"> Site Permissions</a></li>
20       </ul>
21     </li>
22   </ul>
23 </div>
24
25 # <a name="TWiki Site Tools"></a> TWiki Site Tools
26
27 _Utilities for searching, navigation, and monitoring site activity_
28
29 TWiki Site Tools 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 e-mail alerts when topics are edited, and **WebStatistics**, to generate detailed activity reports.
30
31 <a name="WebNotify"></a>
32
33 ## <a name="WebNotify - recent changes alert"></a><a name="_WebNotify - recent changes aler"></a> WebNotify - recent changes alert
34
35 Each TWiki web has an automatic e-mail 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 background process at regular intervals. The script sends an automated e-mail to subscribed users if topics were changed in a web since the script was last run.
36
37 - You can create a [[WebNotify]] link using [[TWikiVariables]] with <code>**%NOTIFYTOPIC%**</code>
38
39 You can also use `%MAINWEB%` instead of `Main`, but this is not necessary even if you have renamed the main web by configuring `{MainWebName}` in [configure](http://www.dementia.org/twiki/configure).
40
41 <a name="WebSearch"></a>
42
43 ## <a name="WebSearch - search TWiki site"></a><a name="_WebSearch - search TWiki site"></a> WebSearch - search TWiki site
44
45 [[WebSearch]] is an extremely fast and flexible search facility, part of the core TWiki feature set. [[WebSearchAdvanced]] offers more options, including:
46
47 - topic title or full-text search
48 - regular expressions
49 - search within web or site-wide
50 - index-style A-Z alphabetical listing sorted topic title
51 - many more
52
53 See also: [[SearchHelp]] for help; [[TWikiVariables]] and [[FormattedSearch]] for including hard-coded searches in text.
54
55 <a name="WebChanges"></a>
56
57 ## <a name="WebChanges - what&#39;s new"></a><a name="_WebChanges - what&#39;s new"></a> WebChanges - what's new
58
59 To check for the most recently edited topics while on-site, use the [[WebChanges]] link, usually located in the toolbar. It lists the most recently modified topics, newest first, along with the first couple of lines of the page content.
60
61 This is simply a preset `SEARCH`. The number of topics listed by the `limit` parameter.:
62
63 > %SEARCH{ ".*" web="%INCLUDINGWEB%" regex="on" nosearch="on" order="modified"%BR% reverse="on" limit="50" }%
64
65 <a name="WebIndex"></a>
66
67 ## <a name="WebIndex - list of topics"></a><a name="_WebIndex - list of topics"></a> WebIndex - list of topics
68
69 [[WebIndex]] lists all web topics in alphabetical order, with the first couple of lines of text. This is simply a preset `SEARCH`:
70
71 > %SEARCH{ "\.*" scope="topic" regex="on" nosearch="on" }%
72
73 <a name="WebStatistics"></a>
74
75 ## <a name="WebStatistics - site statistics"></a><a name="_WebStatistics - site statistics"></a> WebStatistics - site statistics
76
77 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.
78
79 - You can create a [[WebStatistics]] link using [[TWikiVariables]] with <code>**%STATISTICSTOPIC%**</code>
80
81 ### <a name="Configuring for automatic operat"></a> Configuring for automatic operation
82
83 - You can automatically generate usage statistics for all webs. To enable this:
84   - Make sure variable **\{Log\}\{view\}**, **\{Log\}\{save\}** and \*\{Log\}\{upload\} in are set in [configure](http://www.dementia.org/twiki/configure). This will generate log file entries (see below).
85   - 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.
86   - Call the `twiki/bin/statistics` script from a cron job, once a day is recommended. This will update the [[WebStatistics]] topics in all webs.
87   - **_Attention:_** The script must run as the same user as the CGI scripts are running, which is user `nobody` on many systems. Example crontab entry: %BR% `0 0 * * * (cd /path/to/twiki/bin; ./statistics >/dev/null 2>&1)`
88   - 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)`
89
90 ### <a name="Generating statistics manually b"></a> Generating statistics manually by URL
91
92 - The `twiki/bin/statistics` script can also be executed as a CGI script, just enter the URL in your browser. Examples:
93   - Update current month for all webs: %BR% `http://www.dementia.org/twiki/statistics`
94   - Update current month for Main web only: %BR% `http://www.dementia.org/twiki/statistics/Main`
95   - Update January 2000 for Main web: %BR% `http://www.dementia.org/twiki/statistics/Main?logdate=201006`
96
97 <a name="LogFiles"></a>
98
99 ## <a name="Log Files"></a> Log Files
100
101 TWiki generates monthly log files which are used by the statistics script
102
103 - The log file is defined by the **\{LogFileName\}** setting in [configure](http://www.dementia.org/twiki/configure)
104 - The file name is `log<year><month>.txt`
105 - Example path name: `twiki/logs/log201006.txt`
106 - Each access gets logged as: %BR% `| <time> | <wikiusername> | <action> | <web>.<topic> | <extra info> | <IP address> |`
107 - Example log entry: %BR% <code>| 29 Jun 2010 - 11:59 | [[TWikiGuest]] | view | [[WebRss]] |  | 66.124.232.02 |</code>
108 - Actions are logged if enabled in [configure](http://www.dementia.org/twiki/configure) by the **\{Log\}\{_action_\}** flags
109 - Logged actions: <table border="1" cellpadding="0" cellspacing="0">
110   <tr>
111     <th bgcolor="#99CCCC"><strong> Script </strong></th>
112     <th bgcolor="#99CCCC"><strong> Action name </strong></th>
113     <th bgcolor="#99CCCC"><strong> Extra info </strong></th>
114   </tr>
115   <tr>
116     <td> attach </td>
117     <td><code>attach</code></td>
118     <td> when viewing attach screen of previous uploaded attachment: <code>filename</code></td>
119   </tr>
120   <tr>
121     <td> changes </td>
122     <td><code>changes</code></td>
123     <td>   </td>
124   </tr>
125   <tr>
126     <td> edit </td>
127     <td><code>edit</code></td>
128     <td> when editing non-existing topic: <code>(not exist)</code></td>
129   </tr>
130   <tr>
131     <td> rdiff </td>
132     <td><code>rdiff</code></td>
133     <td> higher and lower revision numbers: <code>4 3</code></td>
134   </tr>
135   <tr>
136     <td> register </td>
137     <td><code>regstart</code></td>
138     <td> WikiUserName, e-Mail address, [[Main/LoginName]]: <code>user attempts to register</code></td>
139   </tr>
140   <tr>
141     <td> register </td>
142     <td><code>register</code></td>
143     <td> E-mail address: <code>user successfully registers</code></td>
144   </tr>
145   <tr>
146     <td> register </td>
147     <td><code>bulkregister</code></td>
148     <td> WikiUserName of new, e-mail address, admin ID </td>
149   </tr>
150   <tr>
151     <td> rename </td>
152     <td><code>rename</code></td>
153     <td> when moving topic: <code>moved to Newweb.NewTopic</code></td>
154   </tr>
155   <tr>
156     <td> rename </td>
157     <td><code>move</code></td>
158     <td> when moving attachment: <code>Attachment filename moved to Newweb.NewTopic</code></td>
159   </tr>
160   <tr>
161     <td> passwd </td>
162     <td><code>resetpasswd</code></td>
163     <td>[[Main/LoginName]], [[Main/WikiName]], E-mail address, success code from addUserPassword </td>
164   </tr>
165   <tr>
166     <td> passwd </td>
167     <td><code>changepasswd</code></td>
168     <td>[[Main/LoginName]], [[Main/WikiName]]</td>
169   </tr>
170   <tr>
171     <td> save </td>
172     <td><code>save</code></td>
173     <td> when replacing existing revision: <code>repRev 3</code> %BR% when user checks the minor changes box: <code>dontNotify</code></td>
174   </tr>
175   <tr>
176     <td> search </td>
177     <td><code>search</code></td>
178     <td> search string </td>
179   </tr>
180   <tr>
181     <td> upload </td>
182     <td><code>upload</code></td>
183     <td> filename </td>
184   </tr>
185   <tr>
186     <td> view </td>
187     <td><code>view</code></td>
188     <td> when viewing non-existing topic: <code>(not exist)</code> %BR% when viewing previous topic revision: <code>r3</code></td>
189   </tr>
190 </table>
191
192 <a name="ConfigureEmail"></a>
193
194 ## <a name="E-mail"></a> E-mail
195
196 ### <a name="Configuring outgoing mail"></a> Configuring outgoing mail
197
198 Outgoing mail is required for [[TWikiRegistration]] and for [[recent changes alert|Main/WebHome#WebNotify]].
199
200 TWiki 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]].
201
202 The notify e-mail uses the default `changes.tmpl` template, or a skin if activated in the [[TWikiPreferences]].
203
204 mailnotify also relies on two hidden files in each `twiki/data/Web` directory: `.changes` and `.mailnotify.` Make sure both are writable by your web server process. `.changes` contains a list of changes; go ahead and make this empty. `.mailnotify` contains a timestamp of the last time notification was done.
205
206 You can use an external mail program, such as <code>**sendmail**</code>, if the `Net::SMTP` module is not installed. Set the program path in <code>**\{MailProgram\}**</code> in [configure](http://www.dementia.org/twiki/configure).
207
208 - %H% Net::SMTP can be easily disabled (if there is an installation error) by setting <code>**SMTPMAILHOST**</code> in [[TWikiPreferences]] to an empty value.
209
210 - %T% You can set a separate <code>**SMTPSENDERHOST**</code> variable to define the mail sender host (some SMTP installations require this).
211
212 ### <a name="Setting the automatic e-mail sch"></a> Setting the automatic e-mail schedule
213
214 **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:
215
216     % crontab -e
217     0 2 * * * (cd /path/to/twiki/bin; ./mailnotify -q)
218
219 The above line will run mailnotify nightly at 02:00. The `-q` switch suppresses all normal output.
220
221 **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.
222
223 **On Windows:** You can use a scheduled task if you have administrative privileges. TWiki:Codev/CronTabWin is a free scheduler for Windows.
224
225 ## <a name="Site Permissions"></a> Site Permissions
226
227 - [[TWikiAccessControl]] describes how to restrict read and write access to topics and webs, by users and groups
228 - [[SitePermissions]] lists the permissions settings of the webs on this TWiki site
229
230 **_Related Topics:_** [[AdminDocumentationCategory]], [[AdminToolsCategory]]