Twiki Installation and Setup Overview

I am not necessarily a fan of this software as I find it a bit less than intuitive to use but I set it up on one of our CentOS servers for someone else and thought I would jot a few notes about the process.

Install dependencies:

yum --disablerepo=rpmforge --enablerepo=epel install httpd gdal-perl perl-CGI perl-CGI-Session perl-HTML-Tree perl-Error perl-FreezeThaw gd perl-Apache-Htpasswd

Get the software tarball (version 5.1.4 at time of writing):


Set up vhost in Apache httpd.conf file, as per online twiki documentation e.g.

<VirtualHost *:80>
DocumentRoot /var/www/vhosts/
ScriptAlias /bin “/var/www/vhosts/”
Alias /pub “/var/www/”
Alias / “/var/www/vhosts/”
<Location “/”>
Options -Indexes +ExecCGI

SetEnvIf Request_URI “pub/.*\.[hH][tT][mM]?$” blockAccess
SetEnvIf Request_URI “pub/TWiki/.*\.[hH][tT][mM]?$” !blockAccess
BrowserMatchNoCase ^$ blockAccess
<Directory “/var/www/vhosts/”>
AllowOverride None
Order Allow,Deny
Allow from all
Deny from env=blockAccess

Options ExecCGI FollowSymLinks
SetHandler cgi-script

<FilesMatch “^configure.*”>
SetHandler cgi-script
Order Deny,Allow
Deny from all
Allow from 123.111.
<Directory “/var/www/vhosts/”>
Options None
AllowOverride Limit
Allow from all
AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi

Configure Directories
Several directories needed to be writable so I set httpd as the group and g+w chmod

[root@server twiki]# chgrp -R httpd ./pub
[root@server twiki]# chgrp -R httpd ./data
[root@server twiki]# chmod -R g+w ./pub
[root@server twiki]# chmod -R g+w ./data
[root@server twiki]# chgrp httpd ./lib
[root@server twiki]# chmod g+w ./lib
[root@server twiki]# chgrp -R httpd ./working
[root@server twiki]# chmod -R g+w ./working

Configure Twiki

Restart Apache and then visit the configuration script (see the Allow from IP address line in apache configuration above):

You will be prompted to set the administrator password:

Twiki ConfigurationNext you need to confirm the guessed paths are correct:

Twiki PathsClick ‘Next’ then ‘Save’ and visit the homepage of your twiki. You should see something similar to the screenshot below – if not fix any errors.

Twiki Installation

The main configuration file for your Twiki website is at ./lib/LocalSite.cfg if you want to customise further. For example, I wanted to set SMTP details:

$TWiki::cfg{WebMasterEmail} = '';
$TWiki::cfg{WebMasterName} = 'TWiki Administrator';
$TWiki::cfg{MailProgram} = '/usr/sbin/sendmail -t -oi -oeq';
$TWiki::cfg{SMTP}{MAILHOST} = '';
$TWiki::cfg{SMTP}{SENDERHOST} = '';
$TWiki::cfg{SMTP}{Username} = 'someuser';
$TWiki::cfg{SMTP}{Password} = 'somepass';

You may also need to add the following line to ensure email verification upon registration works. I had been scratching my head wondering why email activation for registration was not working for me until I tried testing this property using the web interface but it did not work for me (bug?). The solution for me was to set it manually in the LocalSite.cfg file:

$TWiki::cfg{Register}{NeedVerification} = 1;

Create a New Group for Privileged Users

Visit: http://…./bin/view/Main/TWikiGroups

Twiki New User Group

Create a New Web

Visit: http://…./bin/view/TWiki/ManagingWebs

Twiki Create a New Web

Restrict Access to the Web

  • Visit your new Web and click on ‘WebPreferences’
Twiki Restrict Access to Web
  • Scroll down to ‘Access Control and Security and enter the names of the Groups to be allowed or denied access (see below)Twiki Restrict Access to Web
  • Scroll back up and click on ‘Save new settings’
  • Twiki Restrict Access to WebAfter saving you can test access to the Web in an alternative browser

New User Registration

If you try accessing your new protected Web you will be asked to Login or Register. Fill in the registration form and you should receive email confirmation.

Selection_266Selection_270 Selection_271

The TWikiAdminUser can then visit the TwikiGroups page and click on the name of the group to which the new user should be assigned (allowing them access to the protected web) see below.



Things I don’t like about Twiki:

  • Buggy in places
  • The rigmarole involved in deleting a user


Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>