 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.
 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.
 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 work 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
 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 work 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) privileges (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) or TWiki 4.x you will need the information found at TWikiUpgradeGuide.
One of the more difficult tasks is installation of additional CPAN libraries. See TWiki:TWiki.HowToInstallCpanModules
.
If you are installing TWiki without Unix/Linux root (administrator) privileges (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) or TWiki 4.x you will need the information found at TWikiUpgradeGuide.
One of the more difficult tasks is installation of additional 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.WebHome
 for detailed information on how to install CPAN libraries.
If you need help, ask a question in the TWiki:Support.WebHome web or on TWiki:Codev.TWikiIRC
 web or on TWiki:Codev.TWikiIRC (irc.freenode.net, channel #twiki).
 (irc.freenode.net, channel #twiki).
 . (Example - download
. (Example - download TWiki-6.1.0.tgz for Linux)
/var/www). Unpack the distribution in it (Example: tar xvfz TWiki-6.1.0.tgz). The unpack will create a directory called twiki which contains the TWiki package. In the rest of this document we assume this directory is called twiki. chmod -R 770 twiki. The access rules have different meaning for files and directories. This is the most common mistake installers make.
chown -R user:group /path/to/twiki. The webserver username varies from Distributions. Examples for some major distributions: chown -R apache:apache /path/to/twiki
chown -R www-data:www-data /path/to/twiki
chown -R wwwrun:www /path/to/twiki
 to set the access rights of the entire TWiki tree back to the defaults in the distribution.
 to set the access rights of the entire TWiki tree back to the defaults in the distribution. 
/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.
 .
.
.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).
twiki/bin/LocalLib.cfg 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
twiki/bin/LocalLib.cfg must contain a setting for $twikiLibPath, which must point to the absolute directory path of your twiki/lib e.g. /var/www/twiki/lib.
 modules, but can't update the main Perl installation files on the server, you can set
 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.
 install. Don't forget that the webserver user has to be able to read those files as well.
twiki.conf). Performance is much better with a config file, and makes setting up a correct and safe installation easier. 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 httpd.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.
a2enmod cgi. If the system may suggest cgid instead of cgi, either one is fine.  which contains a tool that can generate a safe and working config file for TWiki on Apache.
 which contains a tool that can generate a safe and working config file for TWiki on Apache.
misc/twiki_httpd_conf.txt (nevertheless, it is better to use the generator).
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.
misc directory 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 privileges.
 for links to information about various server setups.
 for links to information about various server setups.
configure script from your browser (enter http://yourdomain/do/configure into your browser address bar) admin user password once TWiki is running. $TWiki::cfg{Password} from LocalSite.cfg file from {TWIKI_ROOT}/lib directory.
configure for the first time, you can only edit the General Path Settings section. Save these settings, and then return to configure to continue configuration.
{PermittedRedirectHostUrls}
{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}.
http://yourdomain.com/do/view and start TWiki-ing away!
pub directory. TWiki has some built-in protection which renames files with dangerous file names by appending .txt to the file name. 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.bin directory should be script enabled, and the pub directory should be HTML document enabled.     misc/subdir-htaccess.txt file can be copied as .htaccess to the data, lib, locale, templates, tools and working directories.
 as well as the example
 as well as the example misc/twiki_httpd_conf.txt and example misc/htaccess.txt files include the needed settings that protect against all 3 security elements.
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-6.1 Release .
.
 .
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.
.
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.
 Security Settings pane of configure : TWiki::LoginManager::TemplateLogin for {LoginManager}.
TWiki::Users::HtPasswdUser for {PasswordManager}.
configure settings.
 Check that the password manager recognizes the new user. Check that a new line with the username and encrypted password is added to the
 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.
Edit link at beginning or end of topic) to check if authentication works.
 , and TWiki:TWiki.SecuringTWikiSite
, and TWiki:TWiki.SecuringTWikiSite for further information about managing users and security of your TWiki site.
Note: The other
 for further information about managing users and security of your TWiki site.
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
<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
 includes this section when you choose ApacheLogin. In the example misc/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.
   
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 the top of TWiki.TWikiPreferences for more information.
tools/mailnotify script as described in the MailerContrib topic.
{WebMasterEmail} email account. Obtain these as you would for any other S/MIME e-mail user.
To enable TWiki to sign administrative e-mails: /etc/pki/tls/certs
configure script, change the following settings under Mail and Proxies:  {MailProgram} to enable an external mail program such as sendmail. Net::SMTP is not supported.
{SmimeCertificateFile} configuration variable
{SmimeKeyFile} configuration variable
configure script an resolve any errors that it identifies
configure for {Sessions}{ExpireAfter} (turn on expert mode to see it), and install a cronjob to run the tools/tick_twiki.pl script. Read The topic TWikiScripts#tick_twiki_pl for details how to do this.
Localization section of configure. For more information about these features, see TWiki:TWiki.InternationalizationSupplement .
.
/ to /cgi-bin/view/Intranet/WebHome. Here is an example index.html containing an HTML meta redirect you can use: Customize it and put it in your HTML document root on your TWiki sever:
<html> <head> <meta http-equiv="refresh" content="0;/do/view/Intranet/WebHome" /> </head> <body> Redirecting to <a href="/do/view/Intranet/WebHome">Intranet home</a>... </body> </html>2. Set the wiki logo URL When a user clicks on the logo in the upper left or on the "Home" link in the top-bar she expects to navigate to the new homepage. You can do that by defining and customizing the following setting in Main.TWikiPreferences as described in the Set TWiki Preferences section:
   * URL of the logo:
      * Set WIKILOGOURL = %SCRIPTURLPATH{view}%/Intranet/WebHome
my-logo-100x50.png:
   * Logo of this TWiki installation:
      * Set WIKILOGOIMG = %PUBURLPATH%/%USERSWEB%/TWikiPreferences/my-logo-100x50.png
 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.
 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.
 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 InstalledPlugins.
You activate installed plugin in the Plugins section of
 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 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 documentation on TWiki plugins can be found at TWiki:TWiki.TWikiPluginsSupplement .
Some plugins require that you define their settings in
.
Some plugins require that you define their settings in configure. You fill find these under the Extensions section of configure.
configure script and make sure you have resolved all errors, and are satisfied that you understand any warnings.
If, by any chance, you forget the "admin" password, the same used in "configure" script, then please login to the server. Delete $TWiki::cfg{Password}= ' ...';. Set the new password using "configure" script.
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:
 on TWiki.org, the supplemental documentation that help you install TWiki on different platforms, environments and web hosting sites. For example:  and TWiki:Codev.TWikiOnLinux
 and TWiki:Codev.TWikiOnLinux .
.
 .
. 
 .
.
 .
If you need help, ask a question in the TWiki:Support
.
If you need help, ask a question in the TWiki:Support web or on TWiki:Codev/TWikiIRC
 web or on TWiki:Codev/TWikiIRC (irc.freenode.net, channel #twiki)
 (irc.freenode.net, channel #twiki)
 and contrib modules
 and contrib modules exist which enhance and expand TWiki's capabilities; they may have additional requirements.
 exist which enhance and expand TWiki's capabilities; they may have additional requirements.
 , 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.
, 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.10.1 or higher | 
| 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 diff2.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 | 
| GNU df | Used by the site statistics to record disk usage statistics, optional. The df command is pre-installed on Linux and OS-X. On Windows install the CoreUtils for Windows  . | 
| GNU patch | For upgrades only: GNU patchis required when using the TWiki:Codev.UpgradeTWiki script | 
| GNU fgrep,egrep | Modify command line parameters in configure if you use non-GNU grep programs | 
| zip | Zip archive command line utility. Used by the BackupRestorePlugin to create and restore from backups. | 
| Cron/scheduler | • Unix: cron• Windows: cronequivalents | 
| Web server | Apache is well supported; see TWiki:TWiki.InstallingTWiki#OtherWebServers  for other servers | 
 for detailed information on how to install CPAN libraries
The following Perl CPAN
 for detailed information on how to install CPAN libraries
The following Perl CPAN modules are used by TWiki:
 modules are used by TWiki:
| Module | Preferred version | Comment | 
|---|---|---|
| Algorithm::Diff | Included in TWiki distribution | |
| CGI | >=3.18 & <=4.03 | A suitable version ships with TWiki since TWiki-6.0.2 using CgiContrib, e.g. it is no longer necessary to install or downgrade this module. Versions 2.89 and 3.37, as well as version > 4.13 must be avoided. | 
| CGI::Carp | >=1.26 | |
| Config | >=0 | |
| Cwd | >=3.05 | |
| Data::Dumper | >=2.121 | |
| Encode | >=2.1 | |
| Error | Included in TWiki distribution | |
| File::Copy | >=2.06 | |
| File::Find | >=1.05 | |
| File::Spec | >=3.05 | |
| File::Temp | >=0.18 | This version included in Perl 5.9.5. File::Temp needs to be updated on RedHat 5 and CentOS 5. | 
| FileHandle | >=2.01 | |
| HTML::Parser | >=3.28 | Needed by the WysiwygPlugin for WYSIWYG editing | 
| HTML::Entities | >=1.25 | Needed by the WysiwygPlugin for WYSIWYG editing; part of the HTML::Parserpackage. | 
| IO::File | >=1.10 | |
| LWP | Needed to install extensions in TWiki configure | |
| Net::SMTP | >=2.29 | Used for sending mail | 
| Text::Diff | Included in TWiki distribution | |
| Time::Local | >=1.11 | 
 for detailed information on how to install CPAN libraries
 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 | |
| Authen::SASL | Used for SMTP Authentication | |
| CGI::Cookie | >=1.24 | Used for session support | 
| CGI::Session | >=3.95 | Used for session support | 
| Crypt::SMIME | >=0.09 | Required if S/MIME-signed administrative e-mail is enabled. | 
| Digest::base | ||
| Digest::SHA1 | ||
| JSON | >=2.0 | Required if TWikiSheetPlugin is used, or if JSON objects are stored and retrieved in SetGetPlugin | 
| Locale::Maketext::Lexicon | >=0 | Used for I18N support | 
| Net::SMTP | >=2.29 | Used for sending mail | 
| URI | Used for configure | 
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"'
 .
.
pub directory.)
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/LocalLib.cfg file (done in Step 2).                  | TWiki dir: | What it is: | Where to copy: | Example: | 
|---|---|---|---|
| twiki/ | TWiki package | TWiki root directory, should be secure from public access | /home/smith/twiki/ | 
| twiki/bin/ | CGI bin | move to script-enabled dirctory | /home/smith/cgi/twiki/ | 
| twiki/lib/ | library files | leave in TWiki root | /home/smith/twiki/lib/ | 
| twiki/locale/ | language files | leave in TWiki root | /home/smith/twiki/locale/ | 
| twiki/pub/ | public files | move to HTML document enabled directory | /home/smith/html/twiki-pub/ | 
| twiki/data/ | topic data | leave in TWiki root | /home/smith/twiki/data/ | 
| twiki/templates/ | web templates | leave in TWiki root | /home/smith/twiki/templates/ | 
| twiki/tools/ | TWiki utlilities | leave in TWiki root | /home/smith/twiki/tools/ | 
| twiki/working/ | Temporary and internal files | leave in TWiki root | /home/smith/twiki/working/ | 
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`
.htaccess file in the pub directory, using the template included in the distribution entitled misc/pub-htaccess.txt.
 .
.
.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.
 
lib/TWiki.spec to lib/LocalSite.cfg
$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.
$TWiki::cfg{LoginManager}, $TWiki::cfg{WebMasterEmail}, $TWiki::cfg{SMTP}{MAILHOST}, $TWiki::cfg{SMTP}{SENDERHOST}. 
 , TWikiUpgradeGuide
Contributors: TWiki:Main.PeterThoeny
, TWikiUpgradeGuide
Contributors: TWiki:Main.PeterThoeny , TWiki:Main.MikeMannix
, TWiki:Main.MikeMannix , TWiki:Main.RichardDonkin
, TWiki:Main.RichardDonkin , TWiki:Main.KennethLavrsen
, TWiki:Main.KennethLavrsen , TWiki:Main.CrawfordCurrie
, TWiki:Main.CrawfordCurrie , TWiki:Main.MartinGregory
, TWiki:Main.MartinGregory 
  
  Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.