none
[openafs-wiki.git] / TWiki / TWikiInstallationGuide.mdwn
1 These installation steps use the Apache web server on Linux as an example. TWiki should run on other web servers and Unix systems as well. (TWiki on Windows is possible, but has not been documented well. More on that at <http://twiki.sourceforge.net/cgi-bin/view/Codev/TWikiOnWindows> )
2
3 **_Note:_** These installation notes assume user `nobody` for all files manupulated by the cgi scripts (executed by the web server), and user `twiki` for all other files. You need to replace user `nobody` with an other user in case the web server executes the script with a different user ( default for Debian is `www-data` ). Also, you can substitute user `twiki` with your own user name.
4
5 - Request the TWiki distribution (in Unix ZIP format) from <http://TWiki.SourceForge.net/download.html> .
6 - Create directory `/home/httpd/twiki` and unzip the TWiki distribution into this directory.
7 - The `twiki/bin` directory of TWiki must be set as a cgi-bin directory. Add `/home/httpd/twiki/bin` to file `/etc/httpd/httpd.conf` with only `ExecCGI` option.
8 - The `twiki/pub` directory of TWiki must be set so that it is visible as a URL. Add `/home/httpd/twiki` to file `httpd.conf` with normal access options (copy from `/home/httpd/html` ).
9 - Now add `ScriptAlias` for `/twiki/bin` and `Alias` for `/twiki` to file `httpd.conf` . <br />**_Note:_** The `ScriptAlias` **must** come before the `Alias` in Apache, otherwise it will fail to correctly set up `/twiki/bin/` , due to the fact that it sees that as being just another subdirectory of the `/twiki/` alias. <br />
10 - Here are example `httpd.conf` entries:      ScriptAlias /twiki/bin/ "/home/httpd/twiki/bin/"
11      Alias /twiki/ "/home/httpd/twiki/pub/"
12      <Directory "/home/httpd/twiki/bin">
13          Options +ExecCGI
14          SetHandler cgi-script
15          Allow from all
16      </Directory>
17      <Directory "/home/httpd/twiki/pub">
18          Options FollowSymLinks +Includes
19          AllowOverride None
20          Allow from all
21      </Directory>
22 - Restart Apache by `/etc/rc.d/rc5.d/S85httpd restart` .
23 - Test if the `twiki/bin` directory is cgi-enabled:
24   - Enter the URL of that directory into your browser ( `http://your.domain.com/twiki/bin` ). It is not set correctly as cgi-bin in case you get something like `"Index of /twiki/bin"` . It is OK if you get a message like `"Forbidden. You don't have permission to access /twiki/bin/ on this server."`
25   - Execute the `testenv` script from your browser ( `http://your.domain.com/twiki/bin/testenv` ). It should show a table wit all CGI environment variables.
26 - Make sure PERL 5 and the PERL CGI library is installed on your system. Default location of PERL executable is `/usr/bin/perl` . In case PERL is installed in a different location, the first line of all perl scripts in the `twiki/bin` directory need to be changed (alternatively you can create a symbolic link from `/usr/bin/perl` ).
27 - To be able to edit the perl scripts and .tmpl files it is necessary to `chown` and `chgrp -R twiki` so all the files have the owner you want.
28 - The scripts execute as `nobody` . Set the file permission of all Perl scripts in the `twiki/bin` directory as executable to `-rwxr-xr-x` .
29 - Set the file permission of all files below `twiki/data` to 666 ( `-rw-rw-rw-` ).
30 - Set the file permission of the `twiki/data` directory and all its subdirectories to 777 ( `drwxrwxrwx` ).
31 - Set the file permission of the `twiki/pub` directory to 777 ( `drwxrwxrwx` ).
32 - Edit the file `twiki/bin/wikicfg.pm` and set the variables at the beginning of the file to your needs.
33 - Make sure RCS is installed. Set `$rcsDir` in `twiki/bin/wikicfg.pm` to mach the location of your RCS binaries.
34 - Point your browser at <http://your.domain.com/twiki/bin/view> and start TWiki-ing away!
35 - Note in case the cgi scripts are **_not_** running as user `nobody`: The `*,v` RCS repository files delivered with the installation package are locked by user `nobody` . In case the user is different (e.g. `www-data` ), it is not possible to check in files, this has the effect that the topic version number does not increase when saving a topic. In this case you need to unlock all repository files and lock them as user `www-data` (check the rcs man pages), or simply delete all the repository files. A simple way to switch the locker of the RCS files is to use sed: <br />`for f in *,v; do sed 's/nobody/www-data/' $f > x; mv x $f; done`
36 - Security issue: Directories `twiki/data` , `twiki/templates` and all its subdirectories should be set so that they are **not** visible as a URL. (Alternatively, move the directries to a place where they are not visible, and change the variables in `twiki/bin/wikicfg.pm` accordingly)
37 - Enable email notification of topic changes, [(4)](TWikiDocumentation#notification) has more.
38 - Add the [PoweredByTWikiLogo](http://TWiki.SourceForge.net/cgi-bin/view/Main/PoweredByTWikiLogo) if TWiki is installed on a public web server.
39
40 - Optional: You can add new rendering rules or new %VARIABLES%. To insure an easy upgrade of TWiki it is recommended to do this customization in `twiki/bin/wikicfg.pm` , not `twiki/bin/wiki.pm` .
41
42 - Optional: If you are on a non authenticated server (i.e. not using SSL) and you would like to authenticate users:
43   - Rename file `.htaccess.txt` in the `twiki/bin` directory to `.htaccess` and change it to your needs. For details consult the HTTP server documentation (for Apache server: [[1]](http://www.apache.org/docs/mod/directives.html), [[2]](http://www.mcs.kent.edu/system/web_help/htaccess/introduction.html)). **_Note:_** In case `.htaccess` does not have any effect you need to enable it: Add "AllowOverride All" to the Directory section of `access.conf` for your `twiki/bin` directory.
44   - Copy the [[TWikiRegistrationPub]] topic to [[TWikiRegistration]]. You can customize the topic if needed. **_Note:_** You can delete or add new input tags to the registration form. The `name=""` parameter of the input tags must start with: `"Twk0..."` (if this is an optional entry), or `"Twk1..."` (if this is a required entry). This will ensure that the fields are processed correctly.
45
46 - Optional: You can automatically generate usage statistics for all webs. To enable this:
47   - Make sure variable `$doLogTopicView, $doLogTopicSave and $doLogTopicUpload` in `wikicfg.pm` are set. This will generate log entries in file `twiki/data/log<date>.txt` .
48   - Topic [[WebStatistics]] must be present in all webs where you want to have statistics. You can use the topic in the Main web as a template.
49   - Call the `twiki/bin/statistics` script from a cron job, once a day is recommended. This will update the [[WebStatistics]] topics in all webs.
50   - **_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)`
51   - 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)`
52   - The `twiki/bin/statistics` script can also be executed as a CGI script, just enter the URL in your browser. Examples:
53     - Update current month for all webs: <br />`http://mydomain.com/twiki/bin/statistics`
54     - Update current month for Main web only: <br />`http://mydomain.com/twiki/bin/statistics/Main`
55     - Update January 2000 for Main web: <br />`http://mydomain.com/twiki/bin/statistics/Main?logdate=200001`
56
57 - To create a new web:
58   - Use a name for the web consisting of characters `A..Z` , `a..z` but **not** in [[WikiNotation]].
59   - Create a new template directory under `twiki/templates` .
60   - Create a new data directory under `twiki/data` and check the file permission of the directory.
61   - Copy the `Web*.txt` files from the `twiki/data/Main` directory to the new data directory, preserving the original files' owner, group and permissions ( on Unix use `cp -p` ). The data files must be writable by the owner the CGI scripts are running on ( usually `nobody` ). Hint: You can set permissions of `.txt` and `.txt,v` files to `-rw-rw-rw-` and then edit the topic using your browser, RCS will restore the file permission correctly when saving the topic.
62   - Add the new web to the web list (visible in the upper right corner of each topic) by editing the site-level preferences [[TWikiPreferences]]:
63     - Add the new web to the WIKIWEBLIST variable.
64   - Add the new web to the web table (at the bottom of each [[WebHome]] topic) by editing the [[TWikiWebsTable]] topic.
65   - Change the web preferences by editing the WebPreferences topic of the new web:
66     - Set the WEBBGCOLOR variable to a color of your taste. The number represents the unique color for the web (consult an HTML book for colors.)
67     - Customize the WEBTOPICLIST variable to contain the web specific links you prefer.
68     - Optional: Set the WEBCOPYRIGHT variable to have a web-specific copyright text (at the bottom of each topic).
69   - If needed, create customized templates in the new templates directory. (Non existing templates are inherited from `twiki/templates` )
70   - If you want to use a category table, copy the three files `twikicatitems.tmpl` , `twikicatedit.tmpl` and `twikicatview.tmpl` from the `twiki/templates/Know` directory to the new templates directory, and customize it. More on that in [(5)](TWikiDocumentation#category) TWiki Category Table.
71   - In case you want usage statistics for this web: Copy file `WebStatistics.txt` from the `twiki/data/Main` directory to the new data directory. Edit topic WebStatistics in the new web and delete old usage entries.
72
73 Here are contents of directories showing file permissions. Please note that this is for debugging reasons only and does not exactly reflect the distribution:
74
75 Directory `twiki/bin` :
76
77     drwxrwxr-x  2 twiki twiki   4096 Jun 17 16:34 .
78     drwxrwxr-x  3 twiki twiki   4096 Jun 17 16:34 ..
79     -rw-rw-r--  1 twiki twiki    650 Feb 10  2000 .htaccess
80     -rwxrwxr-x  1 twiki twiki   4322 Mar 12 00:31 attach
81     -rwxrwxr-x  1 twiki twiki   1426 Jun 20 19:52 delete
82     -rwxrwxr-x  1 twiki twiki   9001 Jul 28 11:03 edit
83     -rwxrwxr-x  1 twiki twiki   1811 Mar 11 02:27 geturl
84     -rwxrwxr-x  1 twiki twiki   5006 Mar 11 02:41 mailnotify
85     -rwxrwxr-x  1 twiki twiki   1769 Mar 11 03:07 oops
86     -rwxrwxr-x  1 twiki twiki   6890 Jun 21 19:58 preview
87     -rwxrwxr-x  1 twiki twiki   7606 Mar 31 18:30 rdiff
88     -rwxrwxr-x  1 twiki twiki   8349 Jun 21 18:12 register
89     -rwxrwxr-x  1 twiki twiki   2693 Jul  5 14:32 save
90     -rwxrwxr-x  1 twiki twiki   3831 Jul 20 12:13 search
91     -rwxrwxr-x  1 twiki twiki   9835 Jun 20 19:03 statistics
92     -rwxrwxr-x  1 twiki twiki    509 Feb  7  2000 testenv
93     -rwxrwxr-x  1 twiki twiki  14543 Jul 20 18:46 upload
94     -rwxrwxr-x  1 twiki twiki   4755 May 22 18:11 view
95     -rwxrwxr-x  1 twiki twiki   1689 Jun 20 20:10 viewfile
96     -rw-rw-r--  1 twiki twiki  40103 Aug 18 13:00 wiki.pm
97     -rw-rw-r--  1 twiki twiki  11521 Aug 19 18:38 wikicfg.pm
98     -rw-rw-r--  1 twiki twiki  13969 Aug 19 00:30 wikisearch.pm
99
100 Directory `twiki/templates/` :
101
102     drwxrwxr-x  4 twiki twiki   4096 Aug  3 01:17 .
103     drwxrwxr-x  4 twiki twiki   4096 Aug 19 18:38 ..
104     drwxrwxr-x  2 twiki twiki   4096 Jun 17 16:35 Know
105     drwxrwxr-x  2 twiki twiki   4096 May  1 01:24 Main
106     -rw-rw-r--  1 twiki twiki   2688 Aug 15 18:15 attach.tmpl
107     -rw-rw-r--  1 twiki twiki   1283 Jul 20 15:56 attachtable.tmpl
108     -rw-rw-r--  1 twiki twiki   1907 Jul 28 16:41 changes.tmpl
109     -rw-rw-r--  1 twiki twiki   2265 Aug 15 17:57 edit.tmpl
110     -rw-rw-r--  1 twiki twiki    965 Feb  8  2000 mailnotify.tmpl
111     -rw-rw-r--  1 twiki twiki     30 Jan 13  1999 notedited.tmpl
112     -rw-rw-r--  1 twiki twiki    940 Jul 20 15:59 notext.tmpl
113     -rw-rw-r--  1 twiki twiki    907 Jul 20 16:01 notwiki.tmpl
114     -rw-rw-r--  1 twiki twiki    341 Mar  8 11:39 noweb.tmpl
115     -rw-rw-r--  1 twiki twiki   1000 Mar  8 11:40 oops.tmpl
116     -rw-rw-r--  1 twiki twiki    914 Mar  8 11:40 oopsdel.tmpl
117     -rw-rw-r--  1 twiki twiki   1423 May 29 01:23 oopslocked.tmpl
118     -rw-rw-r--  1 twiki twiki   1067 Mar  8 11:41 oopsregexist.tmpl
119     -rw-rw-r--  1 twiki twiki    955 Mar  8 11:41 oopsregpasswd.tmpl
120     -rw-rw-r--  1 twiki twiki    966 Mar  8 11:41 oopsregrequ.tmpl
121     -rw-rw-r--  1 twiki twiki   1244 Apr 28 17:11 oopsregthanks.tmpl
122     -rw-rw-r--  1 twiki twiki   1003 Jul 22 12:48 oopsregwiki.tmpl
123     -rw-rw-r--  1 twiki twiki   1607 Mar  8 11:42 oopsrev.tmpl
124     -rw-rw-r--  1 twiki twiki    949 Mar  8 11:43 oopsupload.tmpl
125     -rw-rw-r--  1 twiki twiki   1735 Aug 15 18:14 preview.tmpl
126     -rw-rw-r--  1 twiki twiki   1682 Aug 15 18:14 rdiff.tmpl
127     -rw-rw-r--  1 twiki twiki    530 Jul 22 12:10 register.tmpl
128     -rw-rw-r--  1 twiki twiki    690 Apr 28 16:53 registernotify.tmpl
129     -rw-rw-r--  1 twiki twiki   1900 Aug 15 18:15 search.tmpl
130     -rw-rw-r--  1 twiki twiki   1785 Aug 15 18:15 searchbookview.tmpl
131     -rw-rw-r--  1 twiki twiki   1559 Aug 19 02:53 view.tmpl
132
133 Directory `twiki/templates/Know` (has a TWiki Category Table) :
134
135     drwxrwxr-x  2 twiki twiki   4096 Jun 17 16:35 .
136     drwxrwxr-x  4 twiki twiki   4096 Aug  3 01:17 ..
137     -rw-rw-r--  1 twiki twiki    446 Jun  7  1999 notedited.tmpl
138     -rw-rw-r--  1 twiki twiki    206 Jun  7  1999 twikicatedit.tmpl
139     -rw-rw-r--  1 twiki twiki   1068 Aug 18 18:26 twikicatitems.tmpl
140     -rw-rw-r--  1 twiki twiki    231 Jun  7  1999 twikicatview.tmpl
141
142 Directory `twiki/data/` :
143
144     drwxrwxrwx  6 nobody  nobody  4096 Aug  3 01:09 .
145     drwxrwxr-x  4 twiki twiki   4096 Aug 19 18:38 ..
146     -rw-rw-r--  1 nobody  nobody         51 Apr 21 16:48 .htpasswd
147     drwxrwxrwx  2 nobody  nobody  4096 Aug 20 17:18 Know
148     drwxrwxrwx  2 nobody  nobody  4096 Aug 19 04:15 Main
149     drwxrwxrwx  2 nobody  nobody  4096 Aug 20 17:56 TWiki
150     -rw-rw-rw-  1 twiki twiki           1 Mar 11 04:19 debug.txt
151     -rw-r--r--  1 nobody  nobody  1516 Aug 20 17:56 log200008.txt
152
153 Part of directory `twiki/data/Main` :
154
155     drwxrwxrwx  2 nobody  nobody  4096 Aug 19 04:15 .
156     drwxrwxrwx  6 nobody  nobody  4096 Aug  3 01:09 ..
157     -rw-rw-rw-  1 twiki twiki     3716 Aug 19 02:19 .changes
158     -rw-rw-rw-  1 twiki twiki             9 Aug 19 02:45 .mailnotify
159     -rw-r--r--  1 nobody  nobody        358 Aug 18 17:22 OfficeLocations.txt
160     -r--r--r--  1 nobody  nobody        878 Aug 18 17:22 OfficeLocations.txt,v
161     -rw-r--r--  1 nobody  nobody        680 Aug 18 17:36 TWikiGuest.txt
162     -r--r--r--  1 nobody  nobody  1989 Aug 18 17:36 TWikiGuest.txt,v
163     -rw-r--r--  1 nobody  nobody        459 Aug 18 17:19 TWikiUsers.txt
164     -r--r--r--  1 nobody  nobody  3840 Aug 18 17:19 TWikiUsers.txt,v
165     -rw-r--r--  1 nobody  nobody         95 Aug 19 03:06 WebChanges.txt
166     -r--r--r--  1 nobody  nobody        284 Aug 19 03:06 WebChanges.txt,v
167     -rw-r--r--  1 nobody  nobody  1853 Aug 18 18:08 WebHome.txt
168     -r--r--r--  1 nobody  nobody  6523 Aug 18 18:08 WebHome.txt,v
169     -rw-r--r--  1 nobody  nobody         56 Aug 18 17:21 WebIndex.txt
170     -r--r--r--  1 nobody  nobody        245 Aug 18 17:21 WebIndex.txt,v
171     -rw-r--r--  1 nobody  nobody        495 Aug 18 17:40 WebNotify.txt
172     -r--r--r--  1 nobody  nobody  1896 Aug 18 17:40 WebNotify.txt,v
173     -rw-r--r--  1 nobody  nobody  1904 Aug 19 01:01 WebPreferences.txt
174     -r--r--r--  1 nobody  nobody  3108 Aug 19 01:01 WebPreferences.txt,v
175     -rw-r--r--  1 nobody  nobody  5553 Aug 19 02:30 WebSearch.txt
176     -r--r--r--  1 nobody  nobody  8406 Aug 19 02:30 WebSearch.txt,v
177     -rw-r--r--  1 nobody  nobody        729 Aug 18 17:41 WebStatistics.txt
178     -r--r--r--  1 nobody  nobody  1129 Aug 18 17:41 WebStatistics.txt,v
179
180 Directory `twiki/pub/` :
181
182     drwxrwxrwx  6 nobody  nobody  4096 Aug  3 01:21 .
183     drwxrwxr-x  3 twiki twiki   4096 Jun 17 16:35 ..
184     drwxrwxrwx  3 nobody  nobody  4096 Jun 17 16:35 Know
185     drwxrwxrwx  2 nobody  nobody  4096 Aug  3 01:21 Main
186     drwxrwxrwx  3 nobody  nobody  4096 Aug  3 01:21 TWiki
187     -rw-rw-r--  1 twiki twiki   1078 Jan 14  2000 favicon.ico
188     drwxrwxr-x  2 twiki twiki   4096 Jun 17 16:35 icn
189     -rw-rw-r--  1 twiki twiki   3016 Oct  5  1999 twikilogo.gif
190     -rw-rw-r--  1 twiki twiki   5320 Oct  5  1999 twikilogo1.gif
191     -rw-rw-r--  1 twiki twiki   6125 Oct  5  1999 twikilogo2.gif
192     -rw-rw-r--  1 twiki twiki   7218 Oct  5  1999 twikilogo3.gif
193     -rw-rw-r--  1 twiki twiki   6710 Oct  5  1999 twikilogo4.gif
194     -rw-rw-r--  1 twiki twiki   2877 Jun  7  1999 wikiHome.gif
195
196 Directory `twiki/pub/icn/` :
197
198     drwxrwxr-x  2 twiki twiki   4096 Jun 17 16:35 .
199     drwxrwxrwx  6 nobody  nobody  4096 Aug  3 01:21 ..
200     -rw-rw-r--  1 twiki twiki    801 Mar 26  1999 _filetypes.txt
201     -rw-rw-r--  1 twiki twiki    143 Mar  9  1999 bat.gif
202     -rw-rw-r--  1 twiki twiki    926 Mar  9  1999 bmp.gif
203     -rw-rw-r--  1 twiki twiki    141 Mar 25  1999 c.gif
204     -rw-rw-r--  1 twiki twiki    144 Mar  9  1999 dll.gif
205     -rw-rw-r--  1 twiki twiki    152 Mar  9  1999 doc.gif
206     -rw-rw-r--  1 twiki twiki    130 Mar  9  1999 else.gif
207     -rw-rw-r--  1 twiki twiki    876 Mar 26  1999 exe.gif
208     -rw-rw-r--  1 twiki twiki    147 Mar  9  1999 fon.gif
209     -rw-rw-r--  1 twiki twiki    142 Mar 25  1999 h.gif
210     -rw-rw-r--  1 twiki twiki    156 Mar  9  1999 hlp.gif
211     -rw-rw-r--  1 twiki twiki    186 Mar  9  1999 html.gif
212     -rw-rw-r--  1 twiki twiki    144 Mar 25  1999 java.gif
213     -rw-rw-r--  1 twiki twiki    148 Mar  9  1999 mov.gif
214     -rw-rw-r--  1 twiki twiki    150 Mar  9  1999 pdf.gif
215     -rw-rw-r--  1 twiki twiki    146 Mar 25  1999 pl.gif
216     -rw-rw-r--  1 twiki twiki    150 Mar  9  1999 ppt.gif
217     -rw-rw-r--  1 twiki twiki    148 Mar 25  1999 ps.gif
218     -rw-rw-r--  1 twiki twiki    148 Mar 25  1999 py.gif
219     -rw-rw-r--  1 twiki twiki    130 Mar  9  1999 ram.gif
220     -rw-rw-r--  1 twiki twiki    154 Mar  9  1999 reg.gif
221     -rw-rw-r--  1 twiki twiki    147 Mar 25  1999 sh.gif
222     -rw-rw-r--  1 twiki twiki    155 Mar  9  1999 sniff.gif
223     -rw-rw-r--  1 twiki twiki    149 Mar  9  1999 ttf.gif
224     -rw-rw-r--  1 twiki twiki    134 Mar  9  1999 txt.gif
225     -rw-rw-r--  1 twiki twiki    154 Mar  9  1999 wav.gif
226     -rw-rw-r--  1 twiki twiki    152 Mar  9  1999 wri.gif
227     -rw-rw-r--  1 twiki twiki    152 Mar  9  1999 xls.gif
228     -rw-rw-r--  1 twiki twiki    144 Mar  9  1999 zip.gif
229
230 -- [[PeterThoeny]] - 23 Sep 2000 <br />