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

wget http://downloads.sourceforge.net/project/twiki/TWiki%20for%20all%20Platforms/TWiki-5.1.4/TWiki-5.1.4.tgz

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

<VirtualHost *:80>
ServerName twiki.domain.uk
ServerAlias www.twiki.domain.uk
DocumentRoot /var/www/vhosts/twiki.domain.uk/twiki/pub
ScriptAlias /bin “/var/www/vhosts/twiki.domain.uk/twiki/bin”
Alias /pub “/var/www/vhoststwiki.domain.uk/twiki/pub”
Alias / “/var/www/vhosts/twiki.domain.uk/twiki/bin/view/”
<Location “/”>
Options -Indexes +ExecCGI
</Location>

SetEnvIf Request_URI “pub/.*\.[hH][tT][mM]?$” blockAccess
SetEnvIf Request_URI “pub/TWiki/.*\.[hH][tT][mM]?$” !blockAccess
BrowserMatchNoCase ^$ blockAccess
<Directory “/var/www/vhosts/twiki.domain.uk/twiki/bin”>
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.
</FilesMatch>
</Directory>
<Directory “/var/www/vhosts/twiki.domain.uk/twiki/bin”>
Options None
AllowOverride Limit
Allow from all
AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
</Directory>
</VirtualHost>

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):
http://twiki.domain.uk/bin/configure

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} = 'j.bloggs@twiki.domain.uk';
$TWiki::cfg{WebMasterName} = 'TWiki Administrator';
$TWiki::cfg{MailProgram} = '/usr/sbin/sendmail -t -oi -oeq';
$TWiki::cfg{SMTP}{MAILHOST} = 'smtp.domain.uk';
$TWiki::cfg{SMTP}{SENDERHOST} = 'twiki.domain.uk';
$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.

Selection_268

 

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>