Add note about DNS SRV records
[openafs-wiki.git] / TWiki / TWikiInstallationGuide.mdwn
1 # <a name="TWiki Installation Guide"></a> TWiki Installation Guide
2
3 **The following is installation instructions for the TWiki 4.2 production release on an Apache web server on Linux.** Visit TWiki:TWiki.InstallingTWiki for the latest updates to this guide and supplemental information for installing or upgrading TWiki, including notes on installing TWiki on different platforms, environments and web hosting sites.
4
5 If you are upgrading from a previous version of TWiki, you probably want to read `TWikiUpgradeGuide` instead.
6
7 Both this document and the TWikiUpgradeGuide are also available in the root of the distribution as HTML files. For this reason links to pages inside your own TWiki are written like `TWiki.WebHome` and not like live web links.
8
9 <div>
10   <ul>
11     <li><a href="#TWiki Installation Guide"> TWiki Installation Guide</a><ul>
12         <li><a href="#Preparing to install TWiki"> Preparing to install TWiki</a></li>
13         <li><a href="#Basic Installation"> Basic Installation</a></li>
14         <li><a href="#Important Server Security Settin"> Important Server Security Settings</a></li>
15         <li><a href="#Next Steps"> Next Steps</a></li>
16         <li><a href="#Enable Authentication of Users"> Enable Authentication of Users</a></li>
17         <li><a href="#Define the Administrator User(s)"> Define the Administrator User(s)</a></li>
18         <li><a href="#Set TWiki Preferences"> Set TWiki Preferences</a></li>
19         <li><a href="#Enable Email Notification"> Enable Email Notification</a></li>
20         <li><a href="#Enable Signed Email Notification"> Enable Signed Email Notification</a></li>
21         <li><a href="#Enable _WebStatistics"> Enable WebStatistics</a></li>
22         <li><a href="#Automate removal of expired sess"> Automate removal of expired sessions and lease files</a></li>
23         <li><a href="#Enable Localisation"> Enable Localisation</a></li>
24         <li><a href="#Tailor New Users Home Topic"> Tailor New Users Home Topic</a></li>
25         <li><a href="#Install Plugins"> Install Plugins</a></li>
26         <li><a href="#Customize Your TWiki!"> Customize Your TWiki!</a></li>
27         <li><a href="#Customization of Special Pages"> Customization of Special Pages</a></li>
28         <li><a href="#WYSIWYG vs Raw Edit"> WYSIWYG vs Raw Edit</a></li>
29         <li><a href="#Copyright, License and Classific"> Copyright, License and Classification Statements</a></li>
30         <li><a href="#Troubleshooting"> Troubleshooting</a></li>
31         <li><a href="#Appendices"> Appendices</a></li>
32         <li><a href="#TWiki System Requirements"> TWiki System Requirements</a><ul>
33             <li><a href="#Server Requirements"> Server Requirements</a></li>
34             <li><a href="#Required CPAN Modules"> Required CPAN Modules</a></li>
35             <li><a href="#Optional CPAN Modules"> Optional CPAN Modules</a></li>
36             <li><a href="#Client Requirements"> Client Requirements</a></li>
37             <li><a href="#Important note about TWiki Plugi"> Important note about TWiki Plugins</a></li>
38           </ul>
39         </li>
40         <li><a href="#Notes on Installing TWiki on Non"> Notes on Installing TWiki on Non-Root Account</a></li>
41         <li><a href="#Installing Manually Without Conf"> Installing Manually Without Configure</a></li>
42       </ul>
43     </li>
44   </ul>
45 </div>
46
47 ## <a name="Preparing to install TWiki"></a> Preparing to install TWiki
48
49 Before attempting to install TWiki, you are encouraged to review the TWiki:TWiki.AdminSkillsAssumptions. This guide assumes the person installing TWiki has, at a minimum, basic knowledge of server administration on the system on which TWiki is to be installed. While it is possible to install TWiki with FTP access alone (for example, on a hosted site), it is tricky and may require additional support from your hosting service (for example, in setting file ownership and installing missing perl CPAN libraries).
50
51 To help setup a correct Apache configuration, you are very much encouraged to use the automatic tool TWiki:TWiki.ApacheConfigGenerator which generates the contents for an Apache config file for TWiki based on your inputs.
52
53 While this installation guide specifically describes installation on an Apache web server on Linux, TWiki should be fine with any web server and OS that meet the system requirements (see below). For additional notes on installing TWiki on other systems, see TWiki:TWiki.InstallingTWiki#OtherPlatforms.
54
55 If you are installing TWiki without Unix/Linux root (administrator) priviledges (for example, on a hosted domain), see "Notes on Installing TWiki on Non-Root Account" below for supplemental instructions to the basic steps presented below.
56
57 If you are upgrading from an earlier major version of TWiki such as Cairo (TWiki 3) you will need the information found in TWiki:TWiki.TWikiUpgradeGuide. There is also a static HTML `TWikiUpgradeGuide.html` included in the root of your TWiki distribution.
58
59 Upgrading from a recent TWiki4 release is much simpler. Upgraders from earlier TWiki4 versions can follow the steps described in TWiki:TWiki.UpgradingTWiki04x00PatchReleases to ensure a safe upgrade without accidently overwriting customizations.
60
61 One of the more difficult tasks is installation of addition CPAN libraries. See TWiki:TWiki.HowToInstallCpanModules for detailed information on how to install CPAN libraries.
62
63 If you need help, ask a question in the TWiki:Support web or on TWiki:Codev.TWikiIRC (irc.freenode.net, channel #twiki)
64
65 <a name="StandardInstallation"></a>
66
67 ## <a name="Basic Installation"></a> Basic Installation
68
69 1. **Download** the TWiki distribution from <http://TWiki.org/download.html>.
70 2. **Make a directory** for the installation and **unpack the distribution** in it. In the rest of this document we assume this directory is called `twiki`.
71   - **Note!** that TWiki does not allow spaces in the directory names. Especially on Windows make sure to use a directory path without spaces.
72 3. **Setup access file and directory rights** to enable the webserver user (the user Apache runs the CGI scripts as) to read and write inside the twiki directory.
73   - **Warning!** Do not just just run a `chmod -R 770 twiki`. The access rules have different meaning for files and directories. This is the most common mistake installers make.
74   - The distribution tgz has the file and directory access rights setup to work with a reasonable security level that will work for all types of installations including shared hosting.
75   - The ownership of the twiki directory tree is normally set to the user that unpacked the tgz and will have to be changed to the webserver user using the command `chown -R user:group /path/to/twiki`. The webserver username varies from Distributions. Examples for some major distributions:
76     - RedHat, Fedora, CentOS, Gentoo, Mandriva : `chown -R apache:apache /path/to/twiki`
77     - debian/Ubuntu/Kubunto : `chown -R www-data:www-data /path/to/twiki`
78     - Suse : `chown -R wwwrun:www /path/to/twiki`
79   - If you mistakenly change the access rights in a way that makes TWiki stop working, simply run the script found at TWiki:TWiki.SettingFileAccessRightsLinuxUnix to set the access right of the entire TWiki tree back to the distributed defaults.
80   - It is possible to define tighter access rules than the ones given by default after the installation is complete. But how tight they should be depends on your distribution and local needs. Typically you may want to limit all access from world if the webserver machine has login access for other users than root and the web server administrator. For a dedicated web server made just for running TWiki with limited login access the default access rights have a good safety level.
81 4. **Check the Perl installation**. Ensure that Perl 5 and the Perl CGI library are installed on your system.
82   - The default location of Perl is `/usr/bin/perl`. **If it's somewhere else**, change the path to Perl in the first line of each script in the `twiki/bin` directory.
83   - Some systems require a special extension on perl scripts (e.g. `.cgi` or `.pl`). This is normally only needed under Windows and only where perl scripts are only recognized by file extension. Linux and Unix users should normally never need to do this. If necessary, rename all files in `twiki/bin` (i.e. rename `view` to `view.pl` etc). If you do this, make sure you set the `ScriptSuffix` option in `configure` (Step 6).
84 5. **Create the file LocalLib.cfg** located as `twiki/bin/LocalLib.cfg`
85   - There is a template for this file in `twiki/bin/LocalLib.cfg.txt`. Simply copy [[LocalLib]].cfg.txt to [[LocalLib]].cfg. Make sure the ownership and access rights of the copy are the same as [[LocalLib]].cfg.txt
86   - The file `twiki/bin/LocalLib.cfg` must contain a setting for `$twikiLibPath`, which must point to the absolute file path of your `twiki/lib` e.g. `/var/www/twiki/lib`.
87   - If you need to install additional [CPAN](http://cpan.perl.org/) modules, but can't update the main Perl installation files on the server, you can set `$CPANBASE` to point to your personal [CPAN](http://cpan.perl.org/) install. Don't forget that the webserver user has to be able to read those files as well.
88 6. **Choose best configuration method** for your webserver. There are two ways to configure Apache: config file included from httpd.conf or .htaccess files
89   - Apache config file: The recommended method is using a config file. With a config file you can put the entire TWiki configuration in ONE file (typically named `twiki.conf`). Performance is much better with a config file, and one file gives the best overview and ensures that you get a safe installation . However using a config file requires that you can restart Apache which again means that you need root or sudo access to stop and start Apache. The TWiki apache config file is included from the main Apache config file http.conf. Most distributions have a directory from which any file that ends with `.conf` gets included when you restart Apache (Example RedHat/Fedora/Centos: /etc/httpd/conf.d). If you use a virtual host setup in Apache you should include the twiki.conf file from inside the desired virtual host config in your Apache configuration.
90   - .htaccess file: This should only be used when you cannot use a config file. Performance is slowed down because Apache has to look through _all_ directories in search for possible .htaccess files each time someone views a page in TWiki. Normally this is the only way to control Apache in a shared host environment where you have no root or sudo priviledges.
91 7. **Configure the webserver**
92   - Unless you are an Apache expert setting up the webserver can be quite difficult. But TWiki has three resources that make setting up Apache easier.
93     - The best and easiest way is to use webpage TWiki:TWiki.ApacheConfigGenerator which contains a tool that can generate a safe and working config file for TWiki on Apache.
94     - In the root of the twiki installation you find an example config file `twiki_httpd_conf.txt`
95     - In the root of the twiki installation and in the `twiki/bin` directory you find example `.htaccess` files you can copy and modify. The files contains help text explaining how to set them up. In `twiki/bin` you find `.htaccess.txt` which can be copied to `.htaccess` and defined access to the CGI scripts. In the root of TWiki you find `pub-htaccess.txt` which you can copy to `pub/.htaccess`, `subdir-htaccess.txt` which you can copy to all directories as `.htaccess` except bin and pub, and you find `root-htaccess.txt` which you can copy to `.htaccess` in the twiki root directory. But again only use .htaccess files if you do not have root priviledges.
96   - If you are unsure about how to do this on your system, see TWiki:TWiki.InstallingTWiki#OtherPlatforms for links to information about various server setups.
97   - **Note!** When you use config files you need to restart Apache each time you change a setting to make the new setting active.
98 8. **Protect the configure script**
99   - You should never leave the `configure` script open to the public. Limit access to the `twiki/bin/configure` script to either localhost, an IP address or a specific user using basic Apache authentication. The TWiki:TWiki.ApacheConfigGenerator lets you setup who has access to the configure script. Also the example twiki-httpd-conf.txt and bin/.htaccess.txt files includes the needed setting to protect the configure script.
100   - If you limit the access to a particular user then you need to setup a .htpasswd file that contains the user name and password that Apache will authenticate against. Per default both TWiki:TWiki.ApacheConfigGenerator and the example config files and .htaccess files uses `twiki/data/.htpasswd` but this file does not exist until you have TWiki running and have registered the first user. You therefore have two options. Either limit the access to localhost or an IP address, or make a .htpasswd file. To make a .htpasswd file change directory to `twiki/data` and issue the command `htpasswd -c .htpasswd username` and enter your password when asked. The username must match the `Require user username` directive in the Apache config file or .htaccess file. Do not use a username you will later use to register in TWiki because TWiki will then claim that you are already registered.
101 9. **Run the `configure` script** from your browser (enter `http://yourdomain/twiki/bin/configure` into your browser address bar)
102   - Resolve any errors or warnings it tells you about.
103   - **Note!** When you run `configure` for the first time, you can only edit the section `General Path Settings`. Save these settings, and then return to `configure` to continue configuration.
104   - If your webserver can be accessed by more than one domain name make sure to add the additional alternative URLs to `{PermittedRedirectHostUrls}`
105   - When you return to configure you now need to setup _Mail and Proxies_. Especially the `{WebMasterEmail}`, and `{SMTP}{MAILHOST}` must be defined to enable TWiki to send administrative emails, such as for registration and notification of topic changes. Many ISPs have introduced authentication when sending emails to fight spam so you may also have to set `{SMTP}{Username}` and `{SMTP}{Password}`. If you do not want to enable mailing or want to enable it later you can uncheck `{EnableEmail}`.
106   - If you want administrative e-mails to be signed, see [[S/MIME setup instructions below|Main/WebHome#SmimeSetup]].
107
108 You now have a basic, unauthenticated installation running. At this point you can just point your Web browser at `http://yourdomain.com/twiki/bin/view` and start TWiki-ing away!
109
110 ## <a name="Important Server Security Settin"></a> Important Server Security Settings
111
112 Before you continue any further there are some basic and very important security settings you have to make sure are set correctly.
113
114 - As already described above you should protect the configure script from general access. The configure script is designed for use by administrators only and should be restricted to invocation by them only, by using the basic Apache authentication. Because of this there has not been put much effort into hardening the script. The configure script cannot save any settings once the password has been saved the first time, but the script could still be vulnerable to specially crafted field values and the script reveals many details about the webserver that you should not display in public.
115 - You absolutely must turn off any kind of PHP, Perl, Python, Server Side Includes etc in the `pub` directory. TWiki has some built-in protection which renames files with dangerous filenames by appending .txt to the filename. But this is a secondary security measure. The essential action that you must take is to turn off any possible execution of any of the attached files.<br /> Most Linux distributions have a default Apache installation which has PHP and server side include (SSI) enabled.
116 - Make sure that you deny access to all other twiki directories than the `bin` and `pub` directories. When you have access to the Apache config files the `twiki_httpd_conf.txt` file mentioned above also contains protection of these directories.<br /> For those that do not have access to the Apache config files a sample `subdir-htaccess.txt` file can be copied as `.htaccess` to the data, lib, locale, templates, tools and working directories.
117
118 The TWiki:TWiki.ApacheConfigGenerator as well as the example `twiki_httpd_conf.txt` and example `htaccess.txt` files include the needed settings that protect against all 3 security elements.
119
120 ## <a name="Next Steps"></a> Next Steps
121
122 Once you have TWiki installed and running, you might consider the following optional steps for setting up and customizing your TWiki site. Many of the references below refer to topics within your TWiki installation. For example, `TWiki.TWikiSkins` refers to the `TWikiSkins` topic in your TWiki web. Easy way to jump directly to view the pages is to open your own TWiki in your browser and write `TWiki.TWikiSkins` in the Jump test box to the right in the top bar and hit Enter. You can find these topics in the on-line reference copy at the official TWiki website: [[TWiki Release 4.2|TWiki:TWiki04x02/WebHome]]
123
124 <a name="AuthenticationOfUsers"></a>
125
126 ## <a name="Enable Authentication of Users"></a> Enable Authentication of Users
127
128 This step provides for site access control and user activity tracking on your TWiki site. **_This is particularly important for sites that are publicly accessible on the web._** This guide describes only the most common of several possible authentication setups for TWiki and is suitable for public web sites. For information about other setups, see `TWiki.TWikiUserAuthentication`, and TWiki:TWiki.TWikiUserAuthenticationSupplement.
129
130 These are the steps for enabling "Template Login" which asks for a username and password in a web page, and processes them using the Apache 'htpasswd' password manager. Users can log in and log out.
131
132 1. Under the `Security Settings` pane of `configure` :
133   1. Select `TWiki::LoginManager::TemplateLogin` for `{LoginManager}`.
134   2. Select `TWiki::Users::HtPasswdUser` for `{PasswordManager}`.
135   3. Save your `configure` settings.
136   4. Register yourself using the `TWiki.TWikiRegistration` topic.<br /> %H% Check that the password manager recognizes the new user. Check that a new line with the username and encrypted password is added to the `data/.htpasswd` file. If not, you probably got a path wrong, or the permissions may not allow the webserver user to write to that file.
137 2. Edit a topic (by clicking on the `Edit` link at beginning or end of topic) to check if authentication works.
138
139 You are strongly encouraged to read `TWiki.TWikiUserAuthentication`, TWiki:TWiki.TWikiUserAuthenticationSupplement, and TWiki:TWiki.SecuringTWikiSite for further information about managing users and security of your TWiki site.
140
141 **Note!** The other `LoginManager` option `TWiki::LoginManager::ApacheLogin` uses a basic Apache type authentication where the browser itself prompts you for username and password. Most will find the TemplateLogin looking nicer. But ApacheLogin is required when you use Apache authentication methods like mod\_ldap where all authentication is handled by an Apache module and not by the TWiki perl code. When you use ApacheLogin the apache configuration must be set up to require authentication of the some but not all the scripts in the bin directory. This section in the Apache config (or .htaccess) controls this
142
143     <FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|rest|.*auth).*">
144        require valid-user
145     </FilesMatch>
146
147 The TWiki:TWiki.ApacheConfigGenerator includes this section when you choose _ApacheLogin_. In the example `twiki_httpd_conf.txt` and `bin/.htaccess.txt` files this section is commented out with #. Uncomment the section when you use _ApacheLogin_. It is important that this section is commented out or removed when you use _TemplateLogin_.
148
149 <a name="DefineAdminUser"></a>
150
151 ## <a name="Define the Administrator User(s)"></a> Define the Administrator User(s)
152
153 Administrators have read and write access to any topic in TWiki, irrespectively of TWiki access controls. When you install TWiki one of the first things you will want to do is define yourself as an administrator. You become an administrator simply by adding yourself to the `TWikiAdminGroup`. It is the [[WikiName]] and not the login name you add to the group. Editing the `Main.TWikiAdminGroup` topic requires that you are an administrator. So to add the first administrator you need to login using the internal TWiki admin user login and the password you defined in configure.
154
155 - Navigate to the `Main.TWikiAdminGroup` topic
156 - Follow carefully the steps `Main.TWikiAdminGroup` of how to become an admin
157 - Note that if you use _ApacheLogin_ you have to be registered and logged in before you use the _internal admin login_
158
159 <a name="SetPreferences"></a>
160
161 ## <a name="Set TWiki Preferences"></a> Set TWiki Preferences
162
163 Preferences for customizing many aspects of TWiki are set simply by editing a special topic with TWiki.
164
165 - `TWiki.TWikiPreferences`. Read through it and identify any additional settings or changes you think you might need. You can edit the settings in `TWiki.TWikiPreferences` but these will be overwritten when you later upgrade to a newer TWiki version. Instead copy any settings or variables that you want to customize from `TWiki.TWikiPreferences` and paste them into `Main.TWikiPreferences`. When you later upgrade TWiki simply avoid overwriting the `data/Main/TWikiPreferences.txt` file and all your settings will be kept. Settings in `Main.TWikiPreferences` overrides settings in both `TWiki.TWikiPreferences` and any settings defined in Plugin topics. See notes at top of `TWiki.TWikiPreferences` for more information.
166
167 ## <a name="Enable Email Notification"></a> Enable Email Notification
168
169 Each TWiki web has an automatic email notification service that sends you an email with links to all of the topics modified since the last alert. To enable this service:
170
171 1. Confirm the Mail and Proxies settings in the Configure interface.
172 2. Setup a cron job (or equivalent) to call the `tools/mailnotify` script as described in the `TWiki.MailerContrib` topic.
173
174 <a name="SmimeSetup"></a>
175
176 ## <a name="Enable Signed Email Notification"></a> Enable Signed Email Notification
177
178 TWiki administrative e-mails are an attractive target for SPAM generators and phishing attacks. One good way to protect against this possibility to enable S/MIME signatures on all administrative e-mails. To do this, you need an an X.509 certificate and private key for the the `{WebMasterEmail}` email account. Obtain these as you would for any other S/MIME e-mail user.
179
180 To enable TWiki to sign administrative e-mails:
181
182 1. Enable e-mail as described above
183 2. If necessary, convert your certificate and key files to **PEM** format ( _openssl_ has all the necessary utilities)
184 3. Place the certificate anyplace convenient that the webserver can read. It should be protected against write. The conventional place under linux is `/etc/pki/tls/certs`
185 4. Place the key file in a secure location that **only** the webserver can read. It **must not** be readable by anyone else, and **must not** be served by the webserver.
186 5. Using the `configure` script, change the following settings under **Mail and Proxies**:
187   1. Follow the directions under `{MailProgram}` to enable an external mail program such as _sendmail_. Net::SMTP is not supported.
188   2. Enter the full path to the certificate file in the `{SmimeCertificateFile}` configuration variable
189   3. Enter the full path to the private key file in the `{SmimeKeyFile}` configuration variable
190   4. Save the configuration
191 6. Re-run the `configure` script an resolve any errors that it identifies
192
193 All out-going administrative e-mails will now be signed.
194
195 ## <a name="Enable _WebStatistics"></a> Enable WebStatistics
196
197 You can generate a listing manually, or on an automated schedule, of visits to individual pages, on a per web basis. For information on setting up this feature, see the `TWiki.TWikiSiteTools` topic.
198
199 ## <a name="Automate removal of expired sess"></a> Automate removal of expired sessions and lease files
200
201 Per default TWiki cleans out expired session and lease files each time any topic is viewed. This however cost performance. It is an advantage to define a negative value in `configure` for \{Sessions\}\{ExpireAfter\} and install let cron run the `tools/tick_twiki.pl` script. Read The topic `TWikiScripts#tick_twiki_pl` for details how to do this.
202
203 ## <a name="Enable Localisation"></a> Enable Localisation
204
205 TWiki now supports displaying of national (non-ascii) characters and presentation of basic interface elements in different languages. To enable these features, see the `Localisation` section of `configure`. For more information about these features, see TWiki:TWiki.InternationalizationSupplement.
206
207 <a name="TailorUsersTopic"></a>
208
209 ## <a name="Tailor New Users Home Topic"></a> Tailor New Users Home Topic
210
211 When a new users registers on your TWiki, a home topic is created for them based on the `TWiki.NewUserTemplate` topic (and its `TWiki.UserForm`). It contains additional resources you can use to:
212
213 - Localise the user topic.
214 - Add a default ALLOWTOPICCHANGE so only the user can edit their own home topic. We do not encourage this for Intranet sites as it sends a wrong signal to new users, but it can be necessary on a public TWiki to prevent spam.
215 - Add and remove fields defined in the `TWiki.UserForm`
216
217 If you choose to tailor anything you are strongly adviced to copy `NewUserTemplate` and `UserForm` to the Main web and tailor the Main web copies. TWiki will look for the `NewUserTemplate` in the Main web first and if it does not exist it uses the default from the TWiki web. By creating a `Main.NewUserTemplate` and its `Main.UserForm` you will not loose your tailorings next time you upgrade TWiki.
218
219 If you added or removed fields from the user form you may also need to tailor `TWiki.TWikiRegistration`.
220
221 ## <a name="Install Plugins"></a> Install Plugins
222
223 TWiki:Plugins is an extensive library of Plugins for TWiki, that enhance functionality in a huge number of ways. A few plugins are pre-installed in the TWiki distribution. For more information on these, see `TWiki.InstalledPlugins`.
224
225 You activate installed plugin in the _Plugins_ section of `configure`. In this section you also find a _Find More Extensions_ button which opens an application which can install additional plugins from the TWiki.org website. If you are behind a firewall or your server has no access to the Internet it is also possible to install plugins manually. Manual installation instructions for the plugins can be found in the plugin topics on TWiki.org. Additional documenation on TWiki plugins can be found at TWiki:TWiki.TWikiPluginsSupplement.
226
227 Some plugins require that you define their settings in `configure`. You fill find these under the _Extensions_ section of configure.
228
229 ## <a name="Customize Your TWiki!"></a> Customize Your TWiki!
230
231 The real power of TWiki lies in it's flexibility to be customized to meet your needs. You can with small means change the looks of the default skin (called PatternSkin) by reading the `TWiki.PatternSkinCustomization`
232
233 At the official TWiki website you can find more resources. A good place to start for exploring what's possible is [TWiki:TWiki.TWikiAdminCookBook](http://twiki.org/cgi-bin/view/TWiki/TWikiAdminCookBook 'TWiki/TWikiAdminCookBook' on TWiki.org) which offers tips and tricks for customizing your TWiki site. Many of these are appropriate to implement immediately after installing TWiki and before adding content so now's a good time to look at these.
234
235 ## <a name="Customization of Special Pages"></a> Customization of Special Pages
236
237 Some pages are meant to be customized after choice of authentication. If you do not use the internal TWiki password manager the topics that contains the features for changing and resetting passwords and changing the email address should be changed to a note describing how to perform these tasks in your organization. The topics are:
238
239 - `TWiki.ChangePassword`
240 - `TWiki.ResetPassword`
241 - `TWiki.ChangeEmailAddress`
242
243 ## <a name="WYSIWYG vs Raw Edit"></a> WYSIWYG vs Raw Edit
244
245 From TWiki release 4.2.0 the WYSIWYG editor has been replaced by a much better and more powerful editor and it was decided that WYSIWYG would be the default edit mode. An Edit Raw link is available for those that have a need or preference for this mode.
246
247 However you may prefer to have the same user interface as in TWiki 4.1 where _Edit_ was the raw text editor and you had a WYSIWYG button. You can modify the templates that define the buttons by following the description on TWiki:Codev.TWikiRawEditDefault04x02.
248
249 ## <a name="Copyright, License and Classific"></a> Copyright, License and Classification Statements
250
251 In the bottom of each topic you will find a default copyright messages saying "Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors." It is a setting WEBCOPYRIGHT that defines this. This is often not adequate.
252
253 - If your TWiki is used in a commercial application without public access you should replace this by your normal copyright notice. You should also consider adding classifications (e.g. For Internal Use Only) so people do not have to add this manually to every new topic.
254 - If your TWiki is public with public access you need to decide which copyright and license the contributions should be covered by. For open source type applications licenses such as [the GNU Free Documentation License](http://www.gnu.org/licenses/fdl.html), [FreeBSD Documentation License](http://www.freebsd.org/copyright/freebsd-doc-license.html), and [Creative Commons license](http://creativecommons.org/licenses/) are possible licenses to consider. Remember that once people have started contributing it is difficult and not correct to change or impose licenses on existing contributions.
255
256 You change the copy right statement globally by taking these steps.
257
258 - Copy the setting WEBCOPYRIGHT from `TWiki.TWikiPreferences` to `Main.TWikiPreferences` and alter the copied text to your need.
259 - You can create a unique message for each web by adding the WEBCOPYRIGHT setting to `WebPreferences` in each web. E.g. adding a confidencial classification to a very restricted web.
260 - The WEBCOPYRIGHT in `TWiki.WebPreferences` covers the documentation that comes with TWiki and is covered by the original TWiki Copyright and GPL License. You will normally leave this unchanged.
261
262 ## <a name="Troubleshooting"></a> Troubleshooting
263
264 The first step is to re-run the `configure` script and make sure you have resolved all errors, and are satisfied that you understand any warnings.
265
266 Failing that, please check **[TWiki:TWiki.InstallingTWiki](http://twiki.org/cgi-bin/view/TWiki.InstallingTWiki 'TWiki.InstallingTWiki' on TWiki.org)** on TWiki.org, the supplemental documentation that help you **install TWiki on different platforms, environments and web hosting sites**. For example:
267
268 - For Unix or Linux, check [TWiki:Codev.TWikiOnUnix](http://twiki.org/cgi-bin/view/Codev/TWikiOnUnix 'Codev/TWikiOnUnix' on TWiki.org) and [TWiki:Codev.TWikiOnLinux](http://twiki.org/cgi-bin/view/Codev/TWikiOnLinux 'Codev/TWikiOnLinux' on TWiki.org).
269 - For Windows, check the [TWiki:Codev.WindowsInstallCookbook](http://twiki.org/cgi-bin/view/Codev/WindowsInstallCookbook 'Codev/WindowsInstallCookbook' on TWiki.org).
270 - For MacOS X, check TWiki:Codev.TWikiOnMacOSX.
271
272 It is also advisable to review TWiki:Codev.KnownIssuesOfTWiki04x02.
273
274 If you need help, ask a question in the TWiki:Support web or on TWiki:Codev/TWikiIRC (irc.freenode.net, channel #twiki)
275
276 ## <a name="Appendices"></a> Appendices
277
278 <a name="SystemRequirements"></a>
279
280 ## <a name="TWiki System Requirements"></a> TWiki System Requirements
281
282 Low client and server base requirements are core features that keep TWiki widely deployable, particularly across a range of browser platforms and versions.
283
284 ### <a name="Server Requirements"></a> Server Requirements
285
286 TWiki is written in Perl 5, uses a number of shell commands, and requires [RCS (Revision Control System)](http://www.gnu.org/software/rcs/rcs.html), a GNU Free Software package. TWiki is developed in a basic Linux/Apache environment. It also works with Microsoft Windows, and should have no problem on any other platform that meets the requirements.
287
288 <table border="1" cellpadding="0" cellspacing="0">
289   <tr>
290     <th bgcolor="#99CCCC"><strong> Resource </strong></th>
291     <th bgcolor="#99CCCC"><strong> Required Server Environment </strong></th>
292   </tr>
293   <tr>
294     <td> Perl </td>
295     <td> 5.8.4 or higher is recommended. TWiki will run in perl 5.6.1 but only with Wysiwyg editor disabled. Wysiwyg requires unicode support which is provided by perl 5.8.1 and forward. </td>
296   </tr>
297   <tr>
298     <td> RCS </td>
299     <td> 5.7 or higher (including GNU <code>diff</code>) <br /> Optional, TWiki includes a pure perl implementation of RCS that can be used instead (although it's slower) </td>
300   </tr>
301   <tr>
302     <td> GNU <code>diff</code></td>
303     <td> GNU <code>diff</code> 2.7 or higher is required when not using the all-Perl [[Main/RcsLite]]. <br /> Install on PATH if not included with RCS (check version with <code>diff -v</code>) <br /> Must be the version used by RCS, to avoid problems with binary attachments - RCS may have hard-coded path to <code>diff</code></td>
304   </tr>
305   <tr>
306     <td> Other external programs </td>
307     <td><code>fgrep, egrep</code></td>
308   </tr>
309   <tr>
310     <td> Cron/scheduler </td>
311     <td> • Unix: <code>cron</code><br />• Windows: <code>cron</code> equivalents </td>
312   </tr>
313   <tr>
314     <td> Web server </td>
315     <td> Apache is well supported; for information on other servers, see <a href="http://twiki.org/cgi-bin/view/TWiki.InstallingTWiki#OtherWebServers" title="'TWiki.InstallingTWiki#OtherWebServers' on TWiki.org">TWiki:TWiki.InstallingTWiki#OtherWebServers</a>. </td>
316   </tr>
317 </table>
318
319 ### <a name="Required CPAN Modules"></a> Required CPAN Modules
320
321 Most of the CPAN libraries listesd below are part of a standard Perl installation so you most likely have them all!
322
323 See [TWiki:TWiki.HowToInstallCpanModules](http://twiki.org/cgi-bin/view/TWiki/HowToInstallCpanModules 'TWiki/HowToInstallCpanModules' on TWiki.org) for detailed information on how to install CPAN libraries
324
325 The following Perl [CPAN](http://cpan.perl.org/) modules are used by TWiki:
326
327 <table border="1" cellpadding="0" cellspacing="0">
328   <tr>
329     <th bgcolor="#99CCCC"><strong> Module </strong></th>
330     <th bgcolor="#99CCCC"><strong> Preferred version </strong></th>
331   </tr>
332   <tr>
333     <td> Algorithm::Diff (included) </td>
334     <td>   </td>
335   </tr>
336   <tr>
337     <td> CGI </td>
338     <td> Versions 2.89 and 3.37 must be avoided. Most version from 3.15 and onwards should work. </td>
339   </tr>
340   <tr>
341     <td> CGI::Carp </td>
342     <td> &gt;=1.26 </td>
343   </tr>
344   <tr>
345     <td> Config </td>
346     <td> &gt;=0 </td>
347   </tr>
348   <tr>
349     <td> Cwd </td>
350     <td> &gt;=3.05 </td>
351   </tr>
352   <tr>
353     <td> Data::Dumper </td>
354     <td> &gt;=2.121 </td>
355   </tr>
356   <tr>
357     <td> Error (included) </td>
358     <td>   </td>
359   </tr>
360   <tr>
361     <td> File::Copy </td>
362     <td> &gt;=2.06 </td>
363   </tr>
364   <tr>
365     <td> File::Find </td>
366     <td> &gt;=1.05 </td>
367   </tr>
368   <tr>
369     <td> File::Spec </td>
370     <td> &gt;=3.05 </td>
371   </tr>
372   <tr>
373     <td> FileHandle </td>
374     <td> &gt;=2.01 </td>
375   </tr>
376   <tr>
377     <td> IO::File </td>
378     <td> &gt;=1.10 </td>
379   </tr>
380   <tr>
381     <td> Text::Diff (included) </td>
382     <td>   </td>
383   </tr>
384   <tr>
385     <td> Time::Local </td>
386     <td> &gt;=1.11 </td>
387   </tr>
388 </table>
389
390 ### <a name="Optional CPAN Modules"></a> Optional CPAN Modules
391
392 The following Perl modules may be used by TWiki:
393
394 See [TWiki:TWiki.HowToInstallCpanModules](http://twiki.org/cgi-bin/view/TWiki/HowToInstallCpanModules 'TWiki/HowToInstallCpanModules' on TWiki.org) for detailed information on how to install CPAN libraries
395
396 <table border="1" cellpadding="0" cellspacing="0">
397   <tr>
398     <th bgcolor="#99CCCC"><strong> Module </strong></th>
399     <th bgcolor="#99CCCC"><strong> Preferred version </strong></th>
400     <th bgcolor="#99CCCC"><strong> Description </strong></th>
401   </tr>
402   <tr>
403     <td> Archive::Tar </td>
404     <td>   </td>
405     <td> May be required by the Extensions Installer in configure if command line tar or unzip is not available </td>
406   </tr>
407   <tr>
408     <td> CGI::Cookie </td>
409     <td> &gt;=1.24 </td>
410     <td> Used for session support </td>
411   </tr>
412   <tr>
413     <td> CGI::Session </td>
414     <td> &gt;=3.95 </td>
415     <td> Highly recommended! Used for session support </td>
416   </tr>
417   <tr>
418     <td> Crypt::SMIME </td>
419     <td> &gt;=0.09 </td>
420     <td> Required if S/MIME-signed administrative e-mail is enabled. </td>
421   </tr>
422   <tr>
423     <td> Digest::base </td>
424     <td>   </td>
425     <td>   </td>
426   </tr>
427   <tr>
428     <td> Digest::SHA1 </td>
429     <td>   </td>
430     <td>   </td>
431   </tr>
432   <tr>
433     <td> Jcode </td>
434     <td>   </td>
435     <td> Used for I18N support with perl 5.6 </td>
436   </tr>
437   <tr>
438     <td> Locale::Maketext::Lexicon </td>
439     <td> &gt;=0 </td>
440     <td> Used for I18N support </td>
441   </tr>
442   <tr>
443     <td> Net::SMTP </td>
444     <td> &gt;=2.29 </td>
445     <td> Used for sending mail </td>
446   </tr>
447   <tr>
448     <td> Unicode::Map </td>
449     <td>   </td>
450     <td> Used for I18N support with perl 5.6 </td>
451   </tr>
452   <tr>
453     <td> Unicode::Map8 </td>
454     <td>   </td>
455     <td> Used for I18N support with perl 5.6 </td>
456   </tr>
457   <tr>
458     <td> Unicode::MapUTF8 </td>
459     <td>   </td>
460     <td> Used for I18N support with perl 5.6 </td>
461   </tr>
462   <tr>
463     <td> Unicode::String </td>
464     <td>   </td>
465     <td> Used for I18N support with perl 5.6 </td>
466   </tr>
467   <tr>
468     <td> URI </td>
469     <td>   </td>
470     <td> Used for configure </td>
471   </tr>
472 </table>
473
474 Most of them will probably already be available in your installation. You can check version numbers with the `configure` script, or if you're still trying to get to that point, check from the command line like this:
475
476     perl -e 'use FileHandle; print $FileHandle::VERSION."\n"'
477
478 <a name="ClientRequirements"></a>
479
480 ### <a name="Client Requirements"></a> Client Requirements
481
482 The TWiki standard installation has relatively low browser requirements:
483
484 - HTML 3.2 compliant
485 - Cookies, if persistent sessions are required
486
487 CSS and Javascript are used in most skins, although there is a low-fat skin (Classic skin) available that minimises these requirements. Some skins will require more recent releases of browsers. The default skin (Pattern) is tested on IE 6, Safari, and Mozilla 5.0 based browsers (such as Firefox).
488
489 You can easily select a balance of browser capability versus look and feel. Try the installed skins at `TWiki/TWikiSkinBrowser` and more at TWiki:Plugins.SkinPackage.
490
491 ### <a name="Important note about TWiki Plugi"></a> Important note about TWiki Plugins
492
493 - Plugins can require just about anything - browser-specific functions, stylesheets (CSS), Java applets, cookies, specific Perl modules,... - check the individual Plugin specs.
494   - **_%T% Note:_** Plugins included in the TWiki distribution do not add requirements, except for the [[CommentPlugin]] which requires Perl 5.6.1.
495
496 <a name="NonRootInstallNotes"></a>
497
498 ## <a name="Notes on Installing TWiki on Non"></a> Notes on Installing TWiki on Non-Root Account
499
500 The following supplemental notes to the [Basic Installation](#StandardInstallation) instructions apply to installing TWiki on a system where you don't have Unix/Linux root (administrator) privileges, for example, on a hosted Web account or an intranet server administered by someone else.
501
502 Referring to the [Basic Installation](#StandardInstallation) steps presented above:
503
504 - **Step 2:** If you cannot unpack the TWiki distribution directly in your installation directory, you can unpack the distribution on your local PC and then manually create the directory structure on your host server and upload the files as follows:
505   - Using the table below, create a directory structure on your host server
506   - Upload the TWiki files by FTP (transfer as text except for the image files in `pub` directory.)
507   - **_Note:_** Don't worry if you are not able to put the twiki/lib directory at the same level as the `twiki/bin` directory (e.g. because CGI bin directories can't be under your home directory and you don't have root access). You can create this directory elsewhere and configure the `twiki/bin/setlib.cfg` file (done in Step 2).
508
509 > <table border="1" cellpadding="0" cellspacing="0">
510 >   <tr>
511 >     <th bgcolor="#99CCCC"><strong> TWiki dir: </strong></th>
512 >     <th bgcolor="#99CCCC"><strong> What it is: </strong></th>
513 >     <th bgcolor="#99CCCC"><strong> Where to copy: </strong></th>
514 >     <th bgcolor="#99CCCC"><strong> Example: </strong></th>
515 >   </tr>
516 >   <tr>
517 >     <td><code>twiki</code></td>
518 >     <td> start-up pages </td>
519 >     <td> root TWiki dir </td>
520 >     <td><code>/home/smith/twiki/</code></td>
521 >   </tr>
522 >   <tr>
523 >     <td><code>twiki/bin</code></td>
524 >     <td> CGI bin </td>
525 >     <td> CGI-enabled dir </td>
526 >     <td><code>/home/smith/twiki/bin</code></td>
527 >   </tr>
528 >   <tr>
529 >     <td><code>twiki/lib</code></td>
530 >     <td> library files </td>
531 >     <td> same level as <code>twiki/bin</code></td>
532 >     <td><code>/home/smith/twiki/lib</code></td>
533 >   </tr>
534 >   <tr>
535 >     <td><code>twiki/locale</code></td>
536 >     <td> language files </td>
537 >     <td> dir secure from public access </td>
538 >     <td><code>/home/smith/twiki/locale</code></td>
539 >   </tr>
540 >   <tr>
541 >     <td><code>twiki/pub</code></td>
542 >     <td> public files </td>
543 >     <td> htdoc enabled dir </td>
544 >     <td><code>/home/smith/twiki/pub</code></td>
545 >   </tr>
546 >   <tr>
547 >     <td><code>twiki/data</code></td>
548 >     <td> topic data </td>
549 >     <td> dir secure from public access </td>
550 >     <td><code>/home/smith/twiki/data</code></td>
551 >   </tr>
552 >   <tr>
553 >     <td><code>twiki/templates</code></td>
554 >     <td> web templates </td>
555 >     <td> dir secure from public access </td>
556 >     <td><code>/home/smith/twiki/templates</code></td>
557 >   </tr>
558 >   <tr>
559 >     <td><code>twiki/tools</code></td>
560 >     <td> TWiki utlilities </td>
561 >     <td> dir secure from public access </td>
562 >     <td><code>/home/smith/twiki/tools</code></td>
563 >   </tr>
564 >   <tr>
565 >     <td><code>twiki/working</code></td>
566 >     <td> Temporary and internal files </td>
567 >     <td> dir secure from public access </td>
568 >     <td><code>/home/smith/twiki/working</code></td>
569 >   </tr>
570 > </table>
571
572 - **Step 3:** Files in the pub directory must be readable as a url. This means that directory permissions should be set to `755` (or `775` ) and file permissions should be set to `644` (or `664`). If you can run a `chmod` command, you can accomplish this in two quick steps by running these commands from the root direct:
573   - `chmod -R 755 pub`
574   - ``chmod 644 `find pub -type f -print```
575   - In addition, you should create a `.htaccess` file in the pub directory, using the template included in the root level of the distribution entitled `pub-htaccess.txt`.
576   - Note: This setup does not provide for absolute security for TWiki attachments. For more information, see TWiki:Codev.SecuringYourTWiki.
577
578 - **Step 6:** In order to run the configure script, create a file called `.htaccess` in the bin directory that includes the following single line: `SetHandler cgi-script` . This informs the server to treat all the perl scripts in the bin directory as scripts.
579
580 For additional information about installing TWiki on a hosted accounts, see TWiki:TWiki.InstallingTWiki#WebHostingSites
581
582 ## <a name="Installing Manually Without Conf"></a> Installing Manually Without Configure
583
584 It is highly recommended to use run configure from the browser when setting up TWiki. Configure does a lot of the hard work for you.
585
586 But there may be instances where you do not want to use configure or where configure simply won't run because of a missing dependency.
587
588 The manual steps you have to take are:
589
590 - Copy the file `lib/TWiki.spec` to `lib/LocalSite.cfg`
591 - Remove the comment # in front of `$TWiki::cfg{DefaultUrlHost}`, `$TWiki::cfg{ScriptUrlPath}`, `$TWiki::cfg{PubUrlPath}`, `$TWiki::cfg{PubDir}`, `$TWiki::cfg{TemplateDir}`, `$TWiki::cfg{DataDir}`, `$TWiki::cfg{LocalesDir}`, and `$TWiki::cfg{OS}` and make sure these settings have the correct values.
592 - Make sure to define at least these settings: `$TWiki::cfg{LoginManager}`, `$TWiki::cfg{WebMasterEmail}`, `$TWiki::cfg{SMTP}{MAILHOST}`, `$TWiki::cfg{SMTP}{SENDERHOST}`.
593
594 **_Related Topics:_** [[AdminDocumentationCategory]], TWiki:TWiki.InstallingTWiki