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.
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)
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
/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 file path of your twiki/lib
e.g. /var/www/twiki/lib
.$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.
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.
twiki_httpd_conf.txt
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.
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.
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.
configure
script from your browser (enter http://yourdomain/twiki/bin/configure
into your browser address bar) 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.
{PermittedRedirectHostUrls}
{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}
.
http://yourdomain.com/twiki/bin/view
and start TWiki-ing away!
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.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.subdir-htaccess.txt
file can be copied as .htaccess
to the data, lib, locale, templates, tools and working directories.
twiki_httpd_conf.txt
and example 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 Release 4.2
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.
Security Settings
pane of configure
: TWiki::Client::TemplateLogin
for {LoginManager}
.
TWiki::Users::HtPasswdUser
for {PasswordManager}
.
configure
settings.
TWiki.TWikiRegistration
topic.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.
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.
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.
Main.TWikiAdminGroup
topic
Main.TWikiAdminGroup
of how to become an admin
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.
tools/mailnotify
script as described in the TWiki.MailerContrib
topic.
TWiki.TWikiSiteTools
topic.
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.
Localisation
section of configure
. For more information about these features, see TWiki:TWiki.InternationalizationSupplement.
TWiki.NewUserTemplate
topic (and its TWiki.UserForm
). It contains additional resources you can use to: TWiki.UserForm
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
.
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.
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.
TWiki.ChangePassword
TWiki.ResetPassword
TWiki.ChangeEmailAddress
TWiki.TWikiPreferences
to Main.TWikiPreferences
and alter the copied text to your need.
WebPreferences
in each web. E.g. adding a confidencial classification to a very restricted web.
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.
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: 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. |
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 |
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 |
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"'
TWiki/TWikiSkinBrowser
and more at TWiki:Plugins.SkinPackage.
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/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
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 root level of the distribution entitled 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}
.