We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> TWiki Web>TWikiInstallationGuide (10 Aug 2008, PeterThoeny)
Tags:
installation2Add my vote for this tag create new tag
, view all tags
ALERT! NOTE: This is a DistributionDocument. Please help maintain high quality documentation: This is a wiki, please fix the documentation if you find errors or incomplete content. Put questions and suggestions concerning the documentation of this topic in the comments section below. Use the Support web for problems you are having using TWiki.

TWiki Installation Guide

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.

If you are upgrading from a previous version of TWiki, you probably want to read TWikiUpgradeGuide instead.

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.

Preparing to install TWiki

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).

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.

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.

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.

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.

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.

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.

If you need help, ask a question in the TWiki:Support web or on TWiki:Codev.TWikiIRC (irc.freenode.net, channel #twiki)

Basic Installation

  1. Download the TWiki distribution from http://TWiki.org/download.html.
  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.
    • Note! that TWiki does not allow spaces in the directory names. Especially on Windows make sure to use a directory path without spaces.
  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.
    • 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.
    • 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.
    • 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:
      • RedHat, Fedora, CentOS, Gentoo, Mandriva : chown -R apache:apache /path/to/twiki
      • debian/Ubuntu/Kubunto : chown -R www-data:www-data /path/to/twiki
      • Suse : chown -R wwwrun:www /path/to/twiki
    • 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.
    • 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.
  4. Check the Perl installation. Ensure that Perl 5 and the Perl CGI library are installed on your system.
    • 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.
    • 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).
  5. Create the file LocalLib.cfg located as twiki/bin/LocalLib.cfg
    • 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
    • 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.
    • If you need to install additional CPAN modules, but can't update the main Perl installation files on the server, you can set $CPANBASE to point to your personal CPAN install. Don't forget that the webserver user has to be able to read those files as well.
  6. Choose best configuration method for your webserver. There are two ways to configure Apache: config file included from httpd.conf or .htaccess files
    • 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.
    • .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.
  7. Configure the webserver
    • 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.
      • 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.
      • In the root of the twiki installation you find an example config file twiki_httpd_conf.txt
      • 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.
    • 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.
    • Note! When you use config files you need to restart Apache each time you change a setting to make the new setting active.
  8. Protect the configure script
    • 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.
    • 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.
  9. Run the configure script from your browser (enter http://yourdomain/twiki/bin/configure into your browser address bar)
    • Resolve any errors or warnings it tells you about.
    • 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.
    • If your webserver can be accessed by more than one domain name make sure to add the additional alternative URLs to {PermittedRedirectHostUrls}
    • 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 registration emails. 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}.

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!

Important Server Security Settings

Before you continue any further there are some basic and very important security settings you have to make sure are set correctly.

  • 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.
  • 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.
    Most Linux distributions have a default Apache installation which has PHP and server side include (SSI) enabled.
  • 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.
    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.

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.

Next Steps

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

Enable Authentication of Users

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.

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.

  1. Under the Security Settings pane of configure :
    1. Select TWiki::Client::TemplateLogin for {LoginManager}.
    2. Select TWiki::Users::HtPasswdUser for {PasswordManager}.
    3. Save your configure settings.
    4. Register yourself using the TWiki.TWikiRegistration topic.
      HELP 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.
  2. Edit a topic (by clicking on the Edit link at beginning or end of topic) to check if authentication works.

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.

Note! The other LoginManager option TWiki::Client::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

<FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|rest|.*auth).*">
   require valid-user
</FilesMatch>

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.

Define the Administrator User(s)

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.

  • Navigate to the Main.TWikiAdminGroup topic
  • Follow carefully the steps Main.TWikiAdminGroup of how to become an admin
  • Note that if you use ApacheLogin you have to be registered and logged in before you use the internal admin login

Set TWiki Preferences

Preferences for customizing many aspects of TWiki are set simply by editing a special topic with TWiki.

  • 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.

Enable Email Notification

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:

  1. Confirm the Mail and Proxies settings in the Configure interface.
  2. Setup a cron job (or equivalent) to call the tools/mailnotify script as described in the TWiki.MailerContrib topic.

Enable WebStatistics

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.

Automate removal of expired sessions and lease files

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.

Enable Localisation

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.

Tailor New Users Home Topic

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:

  • Localise the user topic.
  • 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.
  • Add and remove fields defined in the TWiki.UserForm

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.

If you added or removed fields from the user form you may also need to tailor TWiki.TWikiRegistration.

Install Plugins

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.

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.

Some plugins require that you define their settings in configure. You fill find these under the Extensions section of configure.

Customize Your TWiki!

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

At the official TWiki website you can find more resources. A good place to start for exploring what's possible is TWiki:TWiki.TWikiAdminCookBook 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.

Customization of Special Pages

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:

  • TWiki.ChangePassword
  • TWiki.ResetPassword
  • TWiki.ChangeEmailAddress

WYSIWYG vs Raw Edit

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.

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.

Copyright, License and Classification Statements

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.

  • 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.
  • 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, FreeBSD Documentation License, and Creative Commons license 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.

You change the copy right statement globally by taking these steps.

  • Copy the setting WEBCOPYRIGHT from TWiki.TWikiPreferences to Main.TWikiPreferences and alter the copied text to your need.
  • 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.
  • 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.

Troubleshooting

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.

Failing that, please check TWiki:TWiki.InstallingTWiki on TWiki.org, the supplemental documentation that help you install TWiki on different platforms, environments and web hosting sites. For example:

It is also advisable to review TWiki:Codev.KnownIssuesOfTWiki04x02.

If you need help, ask a question in the TWiki:Support web or on TWiki:Codev/TWikiIRC (irc.freenode.net, channel #twiki)

Appendices

TWiki System Requirements

Low client and server base requirements are core features that keep TWiki widely deployable, particularly across a range of browser platforms and versions.

Server Requirements

TWiki is written in Perl 5, uses a number of shell commands, and requires RCS (Revision Control System), 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.

Resource Required Server Environment
Perl 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.
RCS 5.7 or higher (including GNU diff)
Optional, TWiki includes a pure perl implementation of RCS that can be used instead (although it's slower)
GNU diff GNU diff 2.7 or higher is required when not using the all-Perl RcsLite? .
Install on PATH if not included with RCS (check version with diff -v)
Must be the version used by RCS, to avoid problems with binary attachments - RCS may have hard-coded path to diff
Other external programs fgrep, egrep
Cron/scheduler • Unix: cron
• Windows: cron equivalents
Web server Apache is well supported; for information on other servers, see TWiki:TWiki.InstallingTWiki#OtherWebServers.

Required CPAN Modules

Most of the CPAN libraries listesd below are part of a standard Perl installation so you most likely have them all!

See TWiki:TWiki.HowToInstallCpanModules for detailed information on how to install CPAN libraries

The following Perl CPAN modules are used by TWiki:

Module Preferred version
Algorithm::Diff (included)  
CGI Versions 2.89 and 3.37 must be avoided. Most version from 3.15 and onwards should work.
CGI::Carp >=1.26
Config >=0
Cwd >=3.05
Data::Dumper >=2.121
Error (included)  
File::Copy >=2.06
File::Find >=1.05
File::Spec >=3.05
FileHandle >=2.01
IO::File >=1.10
Text::Diff (included)  
Time::Local >=1.11

Optional CPAN Modules

The following Perl modules may be used by TWiki:

See TWiki:TWiki.HowToInstallCpanModules for detailed information on how to install CPAN libraries

Module Preferred version Description
Archive::Tar   May be required by the Extensions Installer in configure if command line tar or unzip is not available
CGI::Cookie >=1.24 Used for session support
CGI::Session >=3.95 Highly recommended! Used for session support
Digest::base    
Digest::SHA1    
Jcode   Used for I18N support with perl 5.6
Locale::Maketext::Lexicon >=0 Used for I18N support
Net::SMTP >=2.29 Used for sending mail
Unicode::Map   Used for I18N support with perl 5.6
Unicode::Map8   Used for I18N support with perl 5.6
Unicode::MapUTF8   Used for I18N support with perl 5.6
Unicode::String   Used for I18N support with perl 5.6
URI   Used for configure

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:

perl -e 'use FileHandle; print $FileHandle::VERSION."\n"'

Client Requirements

The TWiki standard installation has relatively low browser requirements:

  • HTML 3.2 compliant
  • Cookies, if persistent sessions are required

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).

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.

Important note about TWiki Plugins

  • Plugins can require just about anything - browser-specific functions, stylesheets (CSS), Java applets, cookies, specific Perl modules,... - check the individual Plugin specs.
    • TIP Note: Plugins included in the TWiki distribution do not add requirements, except for the CommentPlugin which requires Perl 5.6.1.

Notes on Installing TWiki on Non-Root Account

The following supplemental notes to the Basic Installation 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.

Referring to the Basic Installation steps presented above:

  • 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:
    • Using the table below, create a directory structure on your host server
    • Upload the TWiki files by FTP (transfer as text except for the image files in pub directory.)
    • 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).

TWiki dir: What it is: Where to copy: Example:
twiki start-up pages root TWiki dir /home/smith/twiki/
twiki/bin CGI bin CGI-enabled dir /home/smith/twiki/bin
twiki/lib library files same level as twiki/bin /home/smith/twiki/lib
twiki/locale language files dir secure from public access /home/smith/twiki/locale
twiki/pub public files htdoc enabled dir /home/smith/twiki/pub
twiki/data topic data dir secure from public access /home/smith/twiki/data
twiki/templates web templates dir secure from public access /home/smith/twiki/templates
twiki/tools TWiki utlilities dir secure from public access /home/smith/twiki/tools
twiki/working Temporary and internal files dir secure from public access /home/smith/twiki/working

  • 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:
    • chmod -R 755 pub
    • chmod 644 `find pub -type f -print`
    • 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.
    • Note: This setup does not provide for absolute security for TWiki attachments. For more information, see TWiki:Codev.SecuringYourTWiki.

  • 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.

For additional information about installing TWiki on a hosted accounts, see TWiki:TWiki.InstallingTWiki#WebHostingSites

Installing Manually Without Configure

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.

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.

The manual steps you have to take are:

  • Copy the file lib/TWiki.spec to lib/LocalSite.cfg
  • 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.
  • Make sure to define at least these settings: $TWiki::cfg{LoginManager}, $TWiki::cfg{WebMasterEmail}, $TWiki::cfg{SMTP}{MAILHOST}, $TWiki::cfg{SMTP}{SENDERHOST}.

Related Topics: AdminDocumentationCategory, TWiki:TWiki.InstallingTWiki



Comments & Questions about this Distribution Document Topic

Please see older discussions in:

  • rev 218, removed from topic text on 13 May 2006.

-- PeterThoeny - 13 May 2006

I miss two things in the documentation:

  • Complete step-by-step instructions what one has to do to have rcs use RCS subdirectories (there are some hints in lib/TWiki.cfg, but they don't seem to be complete)

  • Instructions how to get TWiki working with SetUID scripts in bin. I tried that but files are still checked out with user nobody instead of twiki frown

frank

-- FrankThommen - 23 Jan 2006

After installing the packages of TWiki on my server Linux Debian with Apache 1.3.34. In the Step 3:Set Files Permissions When I try to relock the RCS files, "Fix: If needed, relock all the rcs files to user www-data", doing a click on relock, me a window appears asking for a user and password "Enter your TwikiName? , but in my installation of Twiki, I does not create any, which is default user with of the installation or as I create a user manager to relock the files.

-- RazielValle - 25 Jan 2006

As seen on a WikiMatrix post, TWiki is still difficult to install by some: "I gave up on a TWiki install on Debian after literally 8 straight hours of frustration, install docs have no exact verbatim step-by-step)". TWiki 4 removed the detailed step-by-step instructions, this was possibly a wrong move.

-- PeterThoeny - 23 Feb 2006

Absolutely not. I have been in conversation with Ryan Knoll (the poster) and his problem is with the install docs on twiki.org, not those in the release. The problem is the quality of those docs, and not the docs in the release (which make no pretence of being verbatim step-by-step).

-- CrawfordCurrie - 24 Feb 2006

Any software in today's time which is hard to install is not good. This installation manual in my opinion should be complete guide of installation process instead of comments like "...is beyond the scope of this topic".

-- GauravSharma - 01 May 2006

The TWiki 4 installation guide is written by experts for experts. Personally I agree that this should be more a step by step guide. The majority of people who want to install TWiki have never heared of CPAN and are not familiar with httpd.conf.

-- PeterThoeny - 01 May 2006

Unfortunately, for many, perhaps most TWiki installs, the ability to configure Apache is a necessity.

-- MeredithLesly - 02 May 2006

Lets focus on the reality and think more about users than developers. Cairo's step-by-step installation guide explained also how to install TWiki into existing Apache directories, without the need to change the Apache configuration file. This documentation does not yet exist for Dakar. How about creating this document instead of complaining about "lack of adequate documentation or poorly written documentation"?

-- PeterThoeny - 02 May 2006

I'm sorry you view what I wrote as complaining, as I was merely noting a fact which, after all, is presumably the reason for the focus group in the first place. Given both the (theoretical) existence of a focus group and a long conversation earlier today with Steffen wherein it was strongly suggested to wait for a high-level plan before writing new topics, I am currently waiting for consensus on what should be done.

I have tried numerous times -- starting at least as early as 09 March to take the initiative to write and organise user-oriented documentation and have been shot down every time in one way or another. At this point I am (understandably) gun-shy about writing any sort of documentation until there is discussion of and consensus reached regarding navigation/taxononomy/"some kind of Vision -> Strategy -> Operational hierarchy" (whatever that means; the last is a quote from Steffen).

Frequent discouragement and disparagement are not good motivators, at least not for me.

-- MeredithLesly - 02 May 2006

I am sorry you feel that way.

Please take some time to review TWiki.WebHome. That is the documentation entry point. There are SupplementalDocuments which are not part of the release. InstallingTWiki is the entry point for supplemental installation docs. A new StepByStepTWiki04x00InstallationGuide? (or DetailedTWiki04x00InstallationGuide or TWikiR04x00InstallationGuideForDummies) lends itself to be a supplemental document, it can be linked as such from the distributed TWikiInstallationGuide. Good timing to add the link to the 4.0.3 release, and to work on that document. So, there is no need to wait if you want to write supplemental documentation or improve the DistributionDocuments.

The pending doc restructuring to get a CustomerFocusedTWikiOrg is another thing, which intends to make TWiki.org easier for several personas visiting the site. This needs to be planned.

-- PeterThoeny - 02 May 2006

We need to archive the ancient and now irrelevant comments on these TWiki topics. Do we have a convention for archiving old comments here in the TWiki web? And no, my motivation is not to erase one of my earliest and most clueless posts on twiki.org. wink

-- LynnwoodBrown - 12 May 2006

So far we have just left the old comments on the topic. Good question what to do with them. In the Plugins web we have the xxxxxDevArchive convention for the Dev topics, but I am reluctant to do this here in the documentation web because of clutter. We could remove (aka cover up) old comments with a link to the version that shows the old comments (which I just did for this topic.)

-- PeterThoeny - 13 May 2006

I stumbled over TWiki via fiddling with VMWare (found the Twiki VM there) and was immediately caught: What a great thing. Then I tried to customise and localise (to german) the TWiki-Server to show this great thing to my german speaking collegues in the office, knowing, when it's not localised completely, they won't use it. So I searched and googled for hours to find a cookbook-recipee-like how-to to translate and localise my Twiki-Server and put it away again, pittyful. It would be really helpful to have a simple installation and a good documentation. I mean, if you get the IT-professionals and make their life easy, this is the first step to bring it into the offices and companies, isn't it? Somebody done good user tutorials and stuff, but I think this is just the second (and also important) step to go. Couldn't someone explain (or tell me where I can find it), what I have to customise the Twiki VM, which files to translate, what to tweak to cope german "Umlauts" (special characters) and so on? Anyway, I thank you all you've done work for others like me.

-- MichaelKaulard - 16 May 2006

Everywhere where the docs read: "Detailed instructions on file permissions are beyond the scope of this guide" or "Explicit instructions for doing this are beyond the scope of this document" should be replaced with "Detailed instructions are _here_", "Explicit instructions are _here_".

It would make this installation guide more useful. We should use links - that's the whole point of the web.

-- SebastienBailard - 25 May 2006

I would like to add in that the InstallationGuide? does not provide any information for newbies and thus it becomes frustrating after a point of time, if the creaters and SuperContributors? cant provide this then i must say that they are not helping the community in any way.

I would like the Contributors to help the newbies in providing a StepByStep? procedure in Linux / Windows for the newbies to start implementing and suggesting the concept to friends and colleagues.

Please do take this request and try to help the community in making it a better place.

-- SucharithMenon - 26 May 2006

Sucharith, we are aware of the issue. Until we improve the installation docs for new users, please see if you can use KentPoots' step-by-step installation instructions at KentPootsInstallExperiences.

-- PeterThoeny - 27 May 2006

I'm a TWiki newbie, and I have to say I am very disappointed with TWiki as a community-friendly platform. I've been running Media Wiki for 2 years, installing it on four sites. I've installed and developed on RubyOnRails? a couple of times. I was attracted to TWiki for the plug-ins, which seem to promise much easier editing and extensionality, but simply cannot get it up and running on a web-hosted platform.

On reading the wiki it is unclear whether Dakar is even supported on hosted platforms. If it isn't, it should be stated up front - on the download page if not the main page - so people can hold off or work with earlier versions. If it is supported, then there should be at least some effort to provide release documentation about it and at least one successful test install documented on the wiki.

All the existing web-host documentation relates to earlier releases, which is extremely confusing because it doesn't say so; probably worse than having none. I would suggest starting off a clean set of docs, which relate only to and are accurate about the current release, and clear guidance as to what is and is not supported at this time. Perhaps a red banner across any page relating to an earlier release would be helpful as well.

If the recommendation is to install the legacy versions, for which there does seem to be some community documentation, until some unknown point in the future then so be it.

-- PaulHenryDavis - 10 Jun 2006

"Explicit instructions for doing this are beyond the scope of this document, though there is a lot of advice on TWiki.org covering different configurations of webserver." + albeit this advice relates to earlier versions of TWiki and so will not be useful.

-- PaulHenryDavis - 10 Jun 2006

Paul, thank you for the feedback. We are listening. Yes, the installation instructions for hosted sites are outdated, and the TWiki 4 installation instructions are written for experienced administrators. TWiki 4 is installed on many hosted sites though (I have done two myself.) Until we have updated and specific documents, please feel free to ask questions in the Support web, or drop by in #twiki IRC on freenode.net. There are helpful people.

-- PeterThoeny - 10 Jun 2006

Thanks Peter. I spent more time on it over the weekend, and DID get it up and running, almost by accident. In retrospect, the instructions at the END of the INSTALL.html file in the distribution itself probably covered the issues I had to resolve. Unfortunately, until the distribution was already running I could not access that file with Apache, just getting 404 and 403 permission errors. It was THIS twiki.org document, and all the obsolete documentation on this site related to web-hosting, which sent me on a wild goose chase.

I don't feel confident enough to edit the docs, but for you gurus out there, please put the contents of the INSTALL.html distribution file online, and refer to it right at the top of the TWikiInstallationGuide topic in yellow background boldface with search keywords "web-hosting" and "non-root access". REMOVE the pointers to TWiki:TWiki.InstallingTWiki and TWiki:TWiki.InstallingTWiki#WebHostingSites from both the online TWikiInstallationGuide and the INSTALL.html doc as they are less than helpful until they are updated.

For those of you looking for help on "TWiki 4 Dakar on web-hosting" your first task once you have downloaded and unpacked the distribution (detailed newbie instructions?) is to put the INSTALL.html file somewhere (your local machine?) where your browser can actually see it. Then, go directly to the final appendix " Notes on Installing TWiki on Non-Root Account" and follow those instructions. Until you can run the configure script you are screwed. Once you can run that script (and the screen doesn't look like a dog's breakfast) you are home free, although there is still a lot of non-obvious work to be done getting basic logins and security into place... Good Luck.

In the medium term, perhaps it would be better to set the defaults for newbies on hosting sites and let the experts worry about optimising the configuration.

By the way, it runs like a dream on my hosting service now that it runs.

-- PaulHenryDavis - 11 Jun 2006

About TWiki All I will say is WOW - thanks - it has made a significant change for me and what I want my students to learn and how ... I do have a question about the LatexModePlugin the install worked just fine - but I get an error Latex rendering error!! DVI file was not created (latex, dvips, dvipng, gs - all exist and run just fine - a similar installation on a solaris/apache system works fine) - rest of twiki works just fine - in addition to what the plugin installation says, is there anything I need to do to get latex/etc to work as a plugin? I wish I could recall what I may have done in the past to have that error go away (I know I fixed it somehow!!) ... anyone recall this problem?

-- KrishnanChittur - 14 Sep 2006

Krishnan, please ask support questions in the Support web or, if it is a plugin, in the plugin's dev topic (LatexModePluginDev). This feedback section is about the documentation of above topic.

-- PeterThoeny - 14 Sep 2006

TWikiUpgradeGuide or something similar should be mentioned, perhaps in next steps, or as an alternate to "Basic Installation". I imagine many admins of older TWiki installs might need a pointer to an upgrade path.

-- DavidForrest - 07 Nov 2006

Sorry about blank comment, however IS THE FOLLOWING STATEMENT TRUE? (found this in indigoPerlCookbook) To make the "Sandbox/DoIWork" checkpoint work, I had to get rid of all references to "C:" in the "General Path Settings" section of configure. Failing to do this would cause TWiki to build bad path names and break RCSLite. TWiki puts a front slash ('/') in front of all paths (see line 147 in lib/TWiki/Sandbox.pm) resulting in paths like "/C:/twiki/pub." "/C:" is not a valid path in Windows so any attempt to save a new topic fails.

-- ChrisRadlinski - 02 Nov 2006

Well this very problem is keeping me from registering anybody. and How do I fix it. And why isn't in this topic. smile

-- BreckAuten - 24 Nov 2006

I have fought quite a bit with the "twiki_httpd_conf.txt" that comes with the TWiki distribution and put together a somewhat different one. It uses "Location" instead of "Directory" and instead of opening things up first, the disallowing access to subdirectories, it does the inverse. I have only tried "Apache Login" as authentication method though, so that is what is in the file.

Comments indicate what's going on: twiki4-setup.review.conf.txt

(Fixed on the 06 Dec 2006: An erroneous comment about the contents of the 'data' subdirectory; also added instructions on how to set permissions on the TWiki subdirectory structure)

-- DavidTonhofer - 29 Nov 2006

Thanks David, hopefully a developer will look at it and pick it up.

-- PeterThoeny - 29 Nov 2006

Hi: I finally got it installed, but with a certain amount of difficulty relating to permissions.

The problem was simple -- the permissions on bin/LocalLib.cfg were wrong. This was because the permissions on LocalLib.cfg.txt were set in the package to be -rw-rwx---, and (as instructed in the documentation), I used LocalLib.cfg.txt to create LocalLib.cfg. I think the permissions of LocalLib.cfg.txt should be -rwxr-x---.

I used version 4.0.5

-- JeremyGoodridge - 05 Jan 2007

You do not need the execution flag, but others need to be able to read the file, hence 664 or 644. The permissions are fixed in the upcoming TWikiRelease04x01x00.

-- PeterThoeny - 05 Jan 2007

I need to access data from Ms-Access database. Do I have to write my own Twiki plugin to access data from a MSAccess database , or someone has already written a generic plugin for this ?

-- TWikiGuest - 18 Jan 2007

Please ask support questions in the Support web.

-- PeterThoeny - 18 Jan 2007

Would be nice to include some instructions so that once you've completed configuration the root of the TWiki site is the MainPage and not the index.html file with links to Installation Guide and Configure TWiki etc - I've followed all the instructions here, and TWiki is working - but really, I can't be telling people to go to www.whatever.com/twiki/bin/view/Main/

I'd add to the general comments made above. The documentation here seems more an aide memoir to people already familiar with it, or the people who wrote TWiki than for people who might consider using it. I'd be happy to contribute, but I can't really see a stepping on point for learning about TWiki here which would put me onto a path where I'd ever be confident I understood it.

A cynical point of view might say that if there was decent documentation here and TWiki was actually easy to install and configure, there would be less work for consultants. Surely that isn't the case?

-- TWikiGuest - 04 Mar 2007

Thanks for the kind feedback and for the offer to get involved! Could you please register with your real first name and last name, we prefer to know each other by the real name. To get started with TWiki contributions, please ReadmeFirst, it has the essentials. At this point we are maintaining the docs in svn, wich makes it kind of time consuming to roll back changes. In any case, please feel free to work directly on the docs here, one of the developer will take this into svn.

-- PeterThoeny - 05 Mar 2007

I believe that the very first thing in the install doc should be a notice that if you are installing on a shared host, that shared host must offer shell support. I think most of the installs would be to a shared server and it would eliminate much frustration if it were made extremely clear that shell support is an absolute necessity.

-- SteveSoskin - 09 Mar 2007

Various updates above for readability etc. Also added a note about shell access for web hosts and links to some relevant pages - in fact the majority of installs are to intranet servers but we do want to support web host installs.

-- RichardDonkin - 21 Mar 2007

Richard, please make sure to carry those changes over to the the svn MAIN and Patch04x01 branches.

-- PeterThoeny - 24 Mar 2007

Let's be perfectly clear : it is very very difficult for someone like me to install twiki. I am almost ready to go back to mediawiki. I know how to setup apache whith PHP, Mysql using a variety of distribs, but all this perl stuff is semi illegible for me. And the docs are impossible to follow since they assume much that is not known to me ( or to anybody without a solid perl culture ). I think you should focus on writing a good step by step installation guide. The VMWare image has shown me that twiki could be very good for what I want to do, but lack of a good beginners doc has stopped me.

-- EricHHESCUDIER - 23 Apr 2007

Thank you for your feedback. Could you give us some specific details? That is the only way we can improve the docs.

-- PeterThoeny - 23 Apr 2007

Things that would help me ( and others I am sure ) :

  • You should at the very least point us to a good basic, step by step, apache+perl+CPAN setup guide or better write one specificly for a twiki setup.
  • twiki needs several CPAN modules, but you never say how to install them and for a perl newbie like me CPAN is not very friendly
  • point 4 of the basic installation guide "If you do this, make sure you set the ScriptSuffix option in configure (Step 6)" is quite confusing because when you get to step 6 there is no mention of this option, and if it is something that has to be set in the code, I can't see where to set it because there is not a commented line in the source saying "set ScriptSuffix option here like this : "
Since I have not managed to get my Twiki setup up and running I don't know if there are more problems, but these where enough to stop me

-- EricHHESCUDIER - 24 Apr 2007

Thanks Eric; tracked in Bugs:Item3947.

-- PeterThoeny - 24 Apr 2007

I'm getting an error when I try to view the /bin/configure file. The error is as follows:

Software error:

Could not load TWiki::Configure::Checker. Please ensure this module is installed and available on the perl @INC path before continuing. If the module is already installed, but can't be found, you may need to adjust your perl path, for example by setting PERL5LIB.

The error seen was: TWiki/Configure/Checker.pm did not return a true value at (eval 9) line 2. BEGIN failed--compilation aborted at (eval 9) line 2.

I'm on the MediaTemple Grid Server platform.

This is strange because I tried to install before and got to the configuration form page but was having some trouble with some of the path settings. I then decided to try to start-over and re-installed Twiki and am now receiving the error above.

Thanks in advance!

-Brett

-- BrettDeWoody - 04 May 2007

WHY IS THIS SO DIFFICULT TO INSTALL?

I've been trying to install Twiki for the past half-day and have made little progress, I'm just about ready to move on... I have two issues at this point that I would greatly appreciate help on.

1. My server (MediaTemple Grid Server) doesn't have CGI Session installed and I can't figure how to get it installed. Probably a permission thing. This is causing an error in the configuration setup that I would like to correct before moving on. This is the only error its showing in the configuration.

2. When I try to view the main page I get a 500 Internal Server Error. I have played around with the permissions as mentioned above but made no progress.

Twiki seems to be so promising but it's nearly impossible to install. I had MediaWiki up and running in just a few minutes....

-- BrettDeWoody - 05 May 2007

This section is about the documentation of this topic. Please ask support questions in the Support web, thanks.

-- PeterThoeny - 08 May 2007

Following the instructions here, and trying to take the most automated route, the first stone in the path is between step 6 and step 7. If you install the TWiki:TWiki.ApacheConfigGenerator script's output, then you end up with an Apache login box to get to "configure" for step 7. Yet you can't log in there yet.

My guess is step 6 should suggest a simpler Apache twiki.conf file that will allow configure to be run for step 7. Then there should be a new step 8 inserted that replaces that temporary twiki.conf file with one per the current step 6.

-- WhitBlauvelt - 22 Jun 2007

I have also been attempting to install for several days.

There should be a section that says "if this goes wrong..then do this"

For instance, I haven't been able to see a "General Settings" section in the configure, and I've been completely baffled why.

And like TWikiGuest? , I'd like to see how to have URLs rewrite, instead of going to mysite.com/bin/view/Main, mysite.com/Main. I've been looking for how to do that, and haven't found that information at all either.

There's also not enough explanation of what exactly the .htaccess files do and what they are for, only that they are to "lock down". It would be nice if its a little more verbose on what you're actually doing, so if a problem does occur, it's a little easier to diagnose.

-- NabeelShahzad - 13 Aug 2007

Also a small "Install FAQ", as I'm sure there's alot of questions that are commonly asked. This would make it a little easier on the Support web as well. Along with what I said above, having a mini-diagnosis section, as you commonly see in alot of hardware manuals (well, the ones I've seen).

"If you see this happen...this is how you correct it" Would save alot of time and headache.

I know there is an FAQ, but it doesn't seem to really have a focus, and personally, was rather useless.

-- NabeelShahzad - 13 Aug 2007

Thanks Nebeel for the candid feedback. TWiki's original installation instructions have been verbose and tailored to people not familiar with webserver administration. Later, the pendulum changed over to a language for experienced sys-admins. I think we need to find a good middle ground. Please help improve the documentation, this is a wiki after all. smile

-- PeterThoeny - 23 Aug 2007

This should really point people first to TWikiOn, and particularly TWikiOnDebian, TWikiOnUbuntu, TWikiInstaller, and so on. These are very simple and well supported ways of installing TWiki - while this page is the main reference, it's important to point people early on to alternative and easier ways of installing TWiki.

-- RichardDonkin - 06 Dec 2007

Since the WYSWIG plugin is now the default editor in 4.2, the Required Perl Modules section should be updated to require HTML::Parser, otherwise you get a strange error on Save to with "can't find object method 'xml_mode'"

-- JoeThompson - 29 Jan 2008

For anyone loading Twiki on AIX (5.3.7.2) using GCC I'd suggest installing and compiling perl 5.10. Configuring Twiki with GCC around the IBM shipped perl is painful. I was able to compiled and install perl 5.10 with required and option perl modules, and load Twiki in about 2 hours.

-- AllanCano - 12 Mar 2008

 
Topic revision: r268 - 10 Aug 2008 - 20:36:08 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback