Install TWiki on a CentOS 7 VPS

T-logo-169x130-tIn this article we will install TWiki on a CentOS 7 VPS with Apache web server. TWiki is simple to use, flexible, secure and very powerful web-based collaboration platform based on Perl. Using TWiki you can run a project development space, a document management system, a knowledge base or any other groupware tool. TWiki is used by millions of users in more than 130 countries in the world and it comes with many features such as:

  • Easy Table editing
  • Skinnable user interface
  • Rich Text Editor
  • Over 400 extensions and 200 plugins
  • Fine-grained access control
  • Revision controln
  • Dynamic content generation
  • Forms and reporting

And many more…

Log in to your CentOS 7 machine via SSH as user root

ssh root@IP

and update all services to your server

yum -y update

Install some prerequisites needed to install TWiki .

yum install wget perl unzip rcs gcc make gd gd-devel php

Execute the following command to install Apache web server.

yum install httpd

Start the Apache web server and add it to automatically start on the system start-up

systemctl start httpd
systemctl enable httpd

We also need to install several Perl modules

yum install perl-CPAN perl-ExtUtils-CBuilder perl-YAML perl-Module-CoreList  perl-CGI perl-Module-Build perl-IPC-Cmd

We will install the rest of the Perl modules from CPAN. Start CPAN’s shell by executing the following

perl -MCPAN -e shell

and install the following modules one by one

install Term::ReadKey
install Bundle::CPAN
reload cpan
install CGI::Carp
install Cwd
install LWP
install Encode
install HTML::Parser
install Error
install Time::Local
install Text::Diff
install Authen::SASL
install CGI::Session
install Digest::SHA1
install URI
install Locale::Maketext::Lexicon
install FreezeThaw
install GD
install HTML::Tree
install Time::Timezone

Now, go to TWiki’s official website and download the latest stable release. At the moment of writing this article it is version 6.0.1


Create a new directory in the document root and unpack the TWiki archive to that directory

mkdir  /var/www/html/twiki
unzip -d /var/www/html/twiki

Change the ownership of the directory

chown -R apache:apache /var/www/html/twiki

Now we need to configure TWiki. Rename the ‘LocalLib.cfg.txt’ file/

cd /var/www/html/twiki
mv bin/LocalLib.cfg.txt bin/LocalLib.cfg

Open the configuration file and set the path of the lib directory in TWiki’s installation

vim bin/LocalLib.cfg

$twikiLibPath = "/var/www/html/twiki/lib";

Copy the Apache configuration file provided by TWiki

cp misc/twiki_httpd_conf.txt /etc/httpd/conf.d/twiki.conf

Open the configuration and change all instances of ‘/home/httpd/’ to ‘/var/www/html’. If you are using vi text editor you can use the following command


Also insert ‘root’ as username at the ‘AuthName’ file in the same file.

Protect the data directory to be accessible with username and password

cd data/
htpasswd -c .htpasswd root
New password:
Re-type new password:
Adding password for user root

Restart the Apache web server

systemctl restart httpd

Now, open a web browser and navigate to http://yourIPaddress/twiki/bin/configure and follow the instructions to continue with the web based installation

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install TWiki for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

How to install CubeCart on Ubuntu 14.04
Install Elasticsearch on Ubuntu 14.04
How to secure your SSH using two-step authentication on CentOS 6
There are currently no comments.