Installing dokuwiki on CentOS 6

This writeup is a modification from Installing dokuwiki on CentOS


Step 1: Get the latest dokuwiki  from

# wget
# tar -xzvf dokuwiki-stable.tgz

Step 2: Move dokuwiki files to apache directory

# mv dokuwiki-stable /var/www/html/docuwiki

Step 3a: Set Ownership and Permission for dokuwiki

# chown -R apache:root /var/www/html/dokuwiki
# chmod -R 664 /var/www/html/dokuwiki/
# find /var/www/html/dokuwiki/ -type d -exec chmod 775 {} \;

Step 3b: Remember to modify your mod_security or disable your selinux

# setenforce 0

Step 4: Continue the installation

Ignore the security warning, we can only move the data directory after installing.
fill out form and click save

Step 5: Delete install.php for security

# rm /var/www/html/dokuwiki/install.php

Step 6: Create and move data, bin (CLI) and cond directories out of apache directories for security

Assuming apache does not access /var/www, only /var/www/html and /var/cgi-bin secure dokuwiki (or use different directory):

# mkdir /var/www/dokudata
# mv /var/www/html/dokuwiki/data/ /var/www/dokudata/
# mv /var/www/html/dokuwiki/conf/ /var/www/dokudata/
# mv /var/www/html/dokuwiki/bin/ /var/www/dokudata/

 Step 7: Update dokuwiki where the conf directory

# vim /var/www/html/dokuwiki/inc/preload.php
// DO NOT use a closing php tag. This causes a problem with the feeds,
// among other things. For more information on this issue, please see:


* Note the comments why there is no closing php

Step 8: Update dokuwiki where the data directory is

# vim /var/www/dokudata/conf/local.php
$conf['savedir'] = '/var/www/dokudata/data/';

Step 9: Set permission for dokuwiki again for the new directory with same permissions

# chown -R apache:root /var/www/html/dokuwiki
# chmod -R 664 /var/www/html/dokuwiki/
# find /var/www/html/dokuwiki/ -type d -exec chmod 775 {} \;

# chown -R apache:root /var/www/dokudata
# chmod -R 664 /var/www/dokudata/
# find /var/www/dokudata/ -type d -exec chmod 775 {} \;


Step 10: Go to wiki


One thought on “Installing dokuwiki on CentOS 6

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.