Wikipedia has been an outstanding success and I cannot imagine not having this great encyclopedia. I remember when Wikipedia was officially launched in 2001, it was a big buzz! A free encyclopedia written by the community without a central authority to control the editing!
At the beginning a lot of people were even against it. (Don’t trust what is written on Wikipedia, etc…) and true, everything was not perfect but along the years Wikipedia gained exposure and contributors providing high quality content with very often even more information and history than popular encyclopedias (Such as Encarta and others).
There is a lot of people with real passion about what they are writing about and I really thanks them for bringing this up on Wikipedia.
But now, you may want to build your own Wiki to let several users/community write and maintain information on your project, hobby, business, etc…
Long story short, Dokuwiki is usually better for small/medium size wiki, while MediaWiki will perform much better for large/extra large wiki.
This first article will focus on Dokuwiki.
On top of good SEO, DokuWiki does not need a database (Easier to install, maintain and backup) and has an easy to use administration panel and pictures upload.
Under GPL v2, Dokuwiki has also a large set of plugins (Captcha, upgrade plugin, Translation, Video share, Gallery plugins and many more).
Interested to give it a try? Here is how to install it.
Dokuwiki is actually available in several distributions’ repo but as I wish to install the latest stable version, I will explain how to do the manual install (Still easy).
PS: I assume you have a Apache and PHP already installed.
1) Download the latest stable version on a dedicated /var/www folder.
In root (or with sudo), run:
cd /var/www mkdir dokuwiki cd dokuwiki wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz tar xvf dokuwiki-stable.tgz --strip 1 rm dokuwiki-stable.tgz
Note that the option –strip 1 while extracting dokuwiki will skip the first directory (it avoids you to do additional steps like moving all the contents of the directory extracted and deleting this directory)
2) Change owner of your dokuwiki folder by the web server user
You will need to run below command (still in root) to make sure the folder and config files are accessible or writable.
chown -R www-data:www-data /var/www/dokuwiki
3) Access the web installer
With your web browser, simply go to http://yourIP/installer.php
You will need to set the wiki name, an admin account with real name, email and password. You will be able to configure the ACL policy (Open for all in read/write, or Public with only read, but write only for registered users, or closed with only registered users having access to it). You will also be able to select the license you want to put your content under (Like Public Domain, GNU Free Document License, etc…)
When done, if not error, it will ask you to delete the install.php file to secure your installation. And you will be ready to go to the admin page.
4) Secure your data directory
If like me, you have a red popup message informing your data directory is not secured, it’s due to the lack of .htaccess or virtualhost managing the permission of the directory. You will basically need to set
order allow,deny deny from all
for the folder data, conf, bin and inc.
As I like to use Virtualhost to set a specific domain name and to force SSL connection, let’s create a dedicated vhost and set the directory permissions inside.
Let’s assume you want to access to your newly installed dokuwiki through the URL wiki.domain.tld
What you will need:
1) Create a A redirection in your DNS server/registrar with wiki.domain.tld to your IP
2) Have SSL certificate ready. If not you can read this tutorial. (Optional)
3) Create your virtualhost as following:
In /etc/apache2/sites-enabled/, create a file called dokuwiki (In root):
and paste the following content:
<VirtualHost *:80> ServerAdmin email@example.com ServerName wiki.domain.tld Redirect / https://wiki.domain.tld </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/certs/myblog.pem SSLCertificateKeyFile /etc/ssl/private/myblog.key ServerAdmin firstname.lastname@example.org ServerName wiki.domain.tld DocumentRoot /var/www/dokuwiki <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/dokuwiki> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> <Directory /var/www/dokuwiki/data> Order allow,deny deny from all </Directory> <Directory /var/www/dokuwiki/conf> Order allow,deny deny from all </Directory> <Directory /var/www/dokuwiki/bin> Order allow,deny deny from all </Directory> <Directory /var/www/dokuwiki/inc> Order allow,deny deny from all </Directory> </VirtualHost> </IfModule>
Adapt the content (Servername, webmaster email, SSL certificate and directory).
When done, save the file (CTRL+X then Yes) and reload apache: (In root)
You should now be able to access to your dokuwiki instance using HTTPS connection and you should not see anymore the red popup message on data directory security issue.
Obviously, you can do a lot with dokuwiki and I can only recommend you to check their great…wiki!