3 <li><a href="#TWiki Installation Guide"> TWiki Installation Guide</a><ul>
4 <li><a href="#Overview"> Overview</a></li>
5 <li><a href="#Standard Installation"> Standard Installation</a><ul>
6 <li><a href="#Step 1: Create Configure the Di"> Step 1: Create & Configure the Directories</a></li>
7 <li><a href="#Step 2: Check the Server Directo"> Step 2: Check the Server Directory Settings</a></li>
8 <li><a href="#Step 3: Enable Perl File Permiss"> Step 3: Enable Perl File Permissions</a></li>
9 <li><a href="#Step 4: Set the Main Configurati"> Step 4: Set the Main Configuration File</a></li>
10 <li><a href="#Step 5: Finish Up from Your Brow"> Step 5: Finish Up from Your Browser</a></li>
13 <li><a href="#Extra Server-Level Options"> Extra Server-Level Options</a><ul>
14 <li><a href="#Creating a New Web"> Creating a New Web</a></li>
15 <li><a href="#Adding Variables Rendering Rule"> Adding Variables & Rendering Rules </a></li>
16 <li><a href="#Enabling Basic Authentication (."> Enabling Basic Authentication (.htaccess)</a></li>
19 <li><a href="#TWiki File System Snapshot"> TWiki File System Snapshot</a></li>
25 # <a name="TWiki Installation Guide"></a> TWiki Installation Guide
27 _Clean install of the current public release (01-Sep-2001)_
29 ## <a name="Overview"></a> Overview
31 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 well-documented. More on that at <http://TWiki.org/cgi-bin/view/Codev/TWikiOnWindows>.)
33 **_NOTE:_** Below installation steps 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.
35 **_NOTE:_** Below installation steps assume that you have control over the web server configuraton files. In case you don't - you may be installing on an ISP-hosted server - follow the steps but use these directories instead:
37 <table border="1" cellpadding="0" cellspacing="0">
39 <th bgcolor="#99CCCC"><strong> TWiki dir: </strong></th>
40 <th bgcolor="#99CCCC"><strong> What it is: </strong></th>
41 <th bgcolor="#99CCCC"><strong> Where to copy: </strong></th>
42 <th bgcolor="#99CCCC"><strong> Example: </strong></th>
45 <td><code>twiki/bin</code></td>
47 <td> cgi-bin enabled dir </td>
48 <td><code>/home/smith/public_html/cgi-bin/twiki</code></td>
51 <td><code>twiki/pub</code></td>
52 <td> public files </td>
53 <td> htdoc enabled dir </td>
54 <td><code>/home/smith/public_html/pub</code></td>
57 <td><code>twiki/data</code></td>
59 <td> outside of htdoc tree (for security) </td>
60 <td><code>/home/smith/twiki/data</code></td>
63 <td><code>twiki/templates</code></td>
64 <td> web templates </td>
65 <td> outside of htdoc tree (for security) </td>
66 <td><code>/home/smith/twiki/templates</code></td>
70 Read <http://TWiki.org/cgi-bin/view/Codev/SourceForgeHowTo> in case you want to install TWiki on SourceForge.
72 ## <a name="Standard Installation"></a> Standard Installation
74 Request and download the TWiki 01-Sep-2001 distribution in Unix ZIP format from <http://TWiki.org/download.html>.
76 ### <a name="Step 1: Create Configure the Di"></a> Step 1: Create & Configure the Directories
78 - Create directory `/home/httpd/twiki` and unzip the TWiki distribution into this directory.
79 - 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.
80 - 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` ).
81 - 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 />
83 > **Example `httpd.conf` entries:**
85 > ScriptAlias /twiki/bin/ "/home/httpd/twiki/bin/"
86 > Alias /twiki/ "/home/httpd/twiki/"
87 > <Directory "/home/httpd/twiki/bin">
89 > SetHandler cgi-script
92 > <Directory "/home/httpd/twiki/pub">
93 > Options FollowSymLinks +Includes
98 ### <a name="Step 2: Check the Server Directo"></a> Step 2: Check the Server Directory Settings
100 - Restart Apache by `/etc/rc.d/rc5.d/S85httpd restart` .
101 - Test if the `twiki/bin` directory is cgi-enabled:
102 - 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."`
103 - Execute the `testenv` script from your browser ( `http://your.domain.com/twiki/bin/testenv` ). It shows a table with all CGI environment variables and tests the settings in your <code>**twiki/bin/wikicfg.pm**</code> configuration file.
105 ### <a name="Step 3: Enable Perl File Permiss"></a> Step 3: Enable Perl File Permissions
107 - Make sure Perl 5 and the Perl CGI library are 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 <code>**twiki/bin**</code> directory must be changed (alternatively you can create a symbolic link from <code>**/usr/bin/perl**</code> ).
108 - **IMPORTANT:** On most ISP virtual domain accounts, Perl CGI scripts require a <code>**.cgi**</code> extension to run. Some systems need <code>**.pl**</code>, the regular Perl extension. Change all <code>**twiki/bin**</code> scripts appropriately if necssary.
109 - To be able to edit the Perl scripts and <code>**.tmpl**</code> files it is necessary to <code>**chown**</code> and <code>**chgrp -R twiki**</code> so all the files have the owner you want.
110 - The scripts execute as <code>**nobody**</code>. Set the file permission of all Perl scripts in the <code>**twiki/bin**</code> directory as executable to <code>**-rwxr-xr-x**</code> (755).
111 - Set the permission of all files below `twiki/data` so that they are writable by user `nobody`. A simple way is to <code>**chmod**</code> them to <code>**-rw-rw-rw-**</code> (666).
112 - Set the permission of the <code>**twiki/data**</code> directory and its subdirectories so that files in there are writable by user <code>**nobody**</code>. A simple way is to chmod them to <code>**drwxrwxrwx**</code> (777).
113 - Set the permission of the `twiki/pub` directory and all its subdirectories so that files in there are writable by user `nobody`. A simple way is to chmod them to <code>**drwxrwxrwx**</code> (777).
115 ### <a name="Step 4: Set the Main Configurati"></a> Step 4: Set the Main Configuration File
117 - Edit the file <code>**twiki/bin/wikicfg.pm**</code> and set the variables at the beginning of the file to your needs.
118 - Set the file extension in the `$scriptSuffix` variable to <code>**cgi**</code> or <code>**pl**</code> if required.
119 - Make sure RCS is installed. Set `$rcsDir` in `twiki/bin/wikicfg.pm` to mach the location of your RCS binaries.
120 - 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`
121 - **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)
122 - Enable email notification of topic changes, [[Notification of Changes|Main/TWikiDocumentation#TWiki_Notification_of_Changes]] has more.
123 - Add the [TWiki:Main.PoweredByTWikiLogo](http://TWiki.org/cgi-bin/view/Main/PoweredByTWikiLogo) to your [[WebHome]] topic.
125 ### <a name="Step 5: Finish Up from Your Brow"></a> Step 5: Finish Up from Your Browser
127 - Point your Web browser at <code>**http://your.domain.com/twiki/bin/view**</code> and start TWiki-ing away!
128 - Edit the [[TWikiPreferences]] topic in the TWiki:TWiki web to set the WIKIWEBMASTER email address, the WEBCOPYRIGHT message and other preferences.
129 - If you use `.htaccess`, edit the file and add the file extension to `edit`, `view`, `preview`, etc.
130 - Edit the [[WebNotify]] topic in all webs and set the users you want to notify.
132 That's it for the standard virgin installation of TWiki. Read on to learn how to customize TWiki.
134 ## <a name="Extra Server-Level Options"></a> Extra Server-Level Options
136 Complete a Standard Installation and your new TWiki site should be up and running. You can develop and manage most aspects of your site from the browser interface. Core set-up functions require direct access to the server file system, via Telnet or FTP. You can make server-level site changes during installation, or at any time afterwards.
138 <a name="CreateWeb"></a>
140 ### <a name="Creating a New Web"></a> Creating a New Web
142 - To create a new web:
143 - Use a name for the web consisting of characters `A..Z` , `a..z` but **not** in [[WikiNotation]].
144 - Create a new template directory under `twiki/templates` .
145 - Create a new data directory under `twiki/data` and check the file permission of the directory.
146 - 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.
147 - Add the new web to the web list (visible in the upper right corner of each topic) by editing the site-level preferences [[TWikiPreferences]]:
148 - Add the new web to the `%WIKIWEBLIST%` variable.
149 - Add the new web to the web table (at the bottom of each [[WebHome]] topic) by editing the [[TWikiWebsTable]] topic.
150 - Change the web preferences by editing the WebPreferences topic of the new web:
151 - 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.)
152 - Customize the `%WEBTOPICLIST%` variable to contain the web specific links you prefer.
153 - Optional: Set the `%WEBCOPYRIGHT%` variable to have a web-specific copyright text (at the bottom of each topic).
154 - If needed, create customized templates in the new templates directory. (Non existing templates are inherited from `twiki/templates` )
155 - If you want to use Form Templates - see [[TWiki Form Template|Main/TWikiDocumentation#TWiki_Form_Templates]]
156 - 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.
157 - Note that user home topics are only located in the %WIKITOOLNAME%.Main web, so don't try to move them or create them in other webs. From any web you can refer to users located in the %WIKITOOLNAME%.Main web like `Main.UserName` or `%MAINWEB%.UserName`.
159 ### <a name="Adding Variables Rendering Rule"></a> Adding Variables & Rendering Rules
161 - 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` .
163 ### <a name="Enabling Basic Authentication (."></a> Enabling Basic Authentication (.htaccess)
165 - If you are on a non authenticated server (i.e. not using SSL) and you would like to authenticate users:
166 - 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)). In particular, the following <font>red</font> part needs to be configured correctly: <br /><code>Redirect <font>/urlpath/to/TWiki/index.html</font> http://<font>your.domain.com/urlpath/to/TWiki/bin/</font>view</code><br /><code>AuthUserFile <font>/filepath/to/TWiki/data/</font>.htpasswd</code><br /><code>ErrorDocument 401 <font>/urlpath/to/TWiki/bin/</font>oops/TWiki/TWikiRegistration?template=oopsauth</code>
167 - **_Note:_** The browser should ask for login name and password when you click on the <u>Edit</u> link. In case `.htaccess` does not have the desired effect you need to enable it: Add "AllowOverride All" to the Directory section of `access.conf` for your `twiki/bin` directory.
168 - Copy the [[TWikiRegistrationPub]] topic to [[TWikiRegistration]]. Do that by either editing the topics in theTWiki web, or by renaming the `.txt` and `.txt,v` files in the `twiki/data/TWiki` directory.
169 - **_Note:_** You can customize the registration form if needed, like deleting or adding input tags. 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.
170 - A new line containing user name and encrypted password gets added to the `data/.htpasswd` file when a users registers. The file that comes with the TWiki installation contains a few user accounts of TWiki core team members (needed for testing). You can edit the file and delete those lines.
172 ## <a name="TWiki File System Snapshot"></a> TWiki File System Snapshot
174 Here are partial directory listings showing typical file permissions and ownership. This is provided for general debugging use only and isn't an exact representation of the current distribution. There is also a file [[listing by directory|Main/TWikiDocumentatin#DocsATWikiFileSystem]], with individual file descriptions, for the current TWiki release.
176 Directory `twiki/bin` :
178 drwxrwxr-x 2 twiki twiki 4096 Jun 17 16:34 .
179 drwxrwxr-x 3 twiki twiki 4096 Jun 17 16:34 ..
180 -rw-rw-r-- 1 twiki twiki 650 Feb 10 2000 .htaccess
181 -rwxrwxr-x 1 twiki twiki 4322 Mar 12 00:31 attach
182 -rwxrwxr-x 1 twiki twiki 1426 Jun 20 19:52 delete
183 -rwxrwxr-x 1 twiki twiki 9001 Jul 28 11:03 edit
184 -rwxrwxr-x 1 twiki twiki 1811 Mar 11 02:27 geturl
185 -rwxrwxr-x 1 twiki twiki 5006 Mar 11 02:41 mailnotify
186 -rwxrwxr-x 1 twiki twiki 1769 Mar 11 03:07 oops
187 -rwxrwxr-x 1 twiki twiki 6890 Jun 21 19:58 preview
188 -rwxrwxr-x 1 twiki twiki 7606 Mar 31 18:30 rdiff
189 -rwxrwxr-x 1 twiki twiki 8349 Jun 21 18:12 register
190 -rwxrwxr-x 1 twiki twiki 2693 Jul 5 14:32 save
191 -rwxrwxr-x 1 twiki twiki 3831 Jul 20 12:13 search
192 -rwxrwxr-x 1 twiki twiki 9835 Jun 20 19:03 statistics
193 -rwxrwxr-x 1 twiki twiki 509 Feb 7 2000 testenv
194 -rwxrwxr-x 1 twiki twiki 14543 Jul 20 18:46 upload
195 -rwxrwxr-x 1 twiki twiki 4755 May 22 18:11 view
196 -rwxrwxr-x 1 twiki twiki 1689 Jun 20 20:10 viewfile
198 Directory `twiki/templates/` :
200 drwxrwxr-x 4 twiki twiki 4096 Aug 3 01:17 .
201 drwxrwxr-x 4 twiki twiki 4096 Aug 19 18:38 ..
202 drwxrwxr-x 2 twiki twiki 4096 Jun 17 16:35 Know
203 drwxrwxr-x 2 twiki twiki 4096 May 1 01:24 Main
204 -rw-rw-r-- 1 twiki twiki 2688 Aug 15 18:15 attach.tmpl
205 -rw-rw-r-- 1 twiki twiki 1283 Jul 20 15:56 attachtable.tmpl
206 -rw-rw-r-- 1 twiki twiki 1907 Jul 28 16:41 changes.tmpl
207 -rw-rw-r-- 1 twiki twiki 2265 Aug 15 17:57 edit.tmpl
208 -rw-rw-r-- 1 twiki twiki 965 Feb 8 2000 mailnotify.tmpl
209 -rw-rw-r-- 1 twiki twiki 30 Jan 13 1999 notedited.tmpl
210 -rw-rw-r-- 1 twiki twiki 940 Jul 20 15:59 notext.tmpl
211 -rw-rw-r-- 1 twiki twiki 907 Jul 20 16:01 notwiki.tmpl
212 -rw-rw-r-- 1 twiki twiki 341 Mar 8 11:39 noweb.tmpl
213 -rw-rw-r-- 1 twiki twiki 1000 Mar 8 11:40 oops.tmpl
214 -rw-rw-r-- 1 twiki twiki 1043 Oct 23 19:17 oopsaccesschange.tmpl
215 -rw-rw-r-- 1 twiki twiki 1036 Oct 23 19:17 oopsaccessview.tmpl
216 -rw-rw-r-- 1 twiki twiki 914 Mar 8 11:40 oopsdel.tmpl
217 -rw-rw-r-- 1 twiki twiki 1423 May 29 01:23 oopslocked.tmpl
218 -rw-rw-r-- 1 twiki twiki 1067 Mar 8 11:41 oopsregexist.tmpl
219 -rw-rw-r-- 1 twiki twiki 955 Mar 8 11:41 oopsregpasswd.tmpl
221 Directory `twiki/data/` :
223 drwxrwxrwx 6 nobody nobody 4096 Aug 3 01:09 .
224 drwxrwxr-x 4 twiki twiki 4096 Aug 19 18:38 ..
225 -rw-rw-r-- 1 nobody nobody 51 Apr 21 16:48 .htpasswd
226 drwxrwxrwx 2 nobody nobody 4096 Aug 20 17:18 Know
227 drwxrwxrwx 2 nobody nobody 4096 Aug 19 04:15 Main
228 drwxrwxrwx 2 nobody nobody 4096 Aug 20 17:56 TWiki
229 -rw-rw-rw- 1 twiki twiki 1 Mar 11 04:19 debug.txt
230 -rw-r--r-- 1 nobody nobody 1516 Aug 20 17:56 log200008.txt
232 Partial file list for `twiki/data/Main` :
234 drwxrwxrwx 2 nobody nobody 4096 Aug 19 04:15 .
235 drwxrwxrwx 6 nobody nobody 4096 Aug 3 01:09 ..
236 -rw-rw-rw- 1 twiki twiki 3716 Aug 19 02:19 .changes
237 -rw-rw-rw- 1 twiki twiki 9 Aug 19 02:45 .mailnotify
238 -rw-r--r-- 1 nobody nobody 358 Aug 18 17:22 OfficeLocations.txt
239 -r--r--r-- 1 nobody nobody 878 Aug 18 17:22 OfficeLocations.txt,v
240 -rw-r--r-- 1 nobody nobody 680 Aug 18 17:36 TWikiGuest.txt
241 -r--r--r-- 1 nobody nobody 1989 Aug 18 17:36 TWikiGuest.txt,v
242 -rw-r--r-- 1 nobody nobody 459 Aug 18 17:19 TWikiUsers.txt
243 -r--r--r-- 1 nobody nobody 3840 Aug 18 17:19 TWikiUsers.txt,v
244 -rw-r--r-- 1 nobody nobody 95 Aug 19 03:06 WebChanges.txt
245 -r--r--r-- 1 nobody nobody 284 Aug 19 03:06 WebChanges.txt,v
246 -rw-r--r-- 1 nobody nobody 1853 Aug 18 18:08 WebHome.txt
247 -r--r--r-- 1 nobody nobody 6523 Aug 18 18:08 WebHome.txt,v
249 Directory `twiki/pub/` :
251 drwxrwxrwx 6 nobody nobody 4096 Aug 3 01:21 .
252 drwxrwxr-x 3 twiki twiki 4096 Jun 17 16:35 ..
253 drwxrwxrwx 3 nobody nobody 4096 Jun 17 16:35 Know
254 drwxrwxrwx 2 nobody nobody 4096 Aug 3 01:21 Main
255 drwxrwxrwx 3 nobody nobody 4096 Aug 3 01:21 TWiki
256 -rw-rw-r-- 1 twiki twiki 1078 Jan 14 2000 favicon.ico
257 drwxrwxr-x 2 twiki twiki 4096 Jun 17 16:35 icn
258 -rw-rw-r-- 1 twiki twiki 3016 Oct 5 1999 twikilogo.gif
259 -rw-rw-r-- 1 twiki twiki 5320 Oct 5 1999 twikilogo1.gif
260 -rw-rw-r-- 1 twiki twiki 6125 Oct 5 1999 twikilogo2.gif
261 -rw-rw-r-- 1 twiki twiki 7218 Oct 5 1999 twikilogo3.gif
262 -rw-rw-r-- 1 twiki twiki 6710 Oct 5 1999 twikilogo4.gif
263 -rw-rw-r-- 1 twiki twiki 2877 Jun 7 1999 wikiHome.gif
265 Partial file list for `twiki/pub/icn/` :
267 drwxrwxr-x 2 twiki twiki 4096 Jun 17 16:35 .
268 drwxrwxrwx 6 nobody nobody 4096 Aug 3 01:21 ..
269 -rw-rw-r-- 1 twiki twiki 801 Mar 26 1999 _filetypes.txt
270 -rw-rw-r-- 1 twiki twiki 143 Mar 9 1999 bat.gif
271 -rw-rw-r-- 1 twiki twiki 926 Mar 9 1999 bmp.gif
272 -rw-rw-r-- 1 twiki twiki 141 Mar 25 1999 c.gif
273 -rw-rw-r-- 1 twiki twiki 144 Mar 9 1999 dll.gif
274 -rw-rw-r-- 1 twiki twiki 152 Mar 9 1999 doc.gif
276 -- [[MikeMannix]] - 07 Sep 2001 <br />