Installing dokuwiki on CentOS 6


This writeup is a modification from Installing dokuwiki on CentOS

 

Step 1: Get the latest dokuwiki  from http://download.dokuwiki.org/

# wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
# 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 http://192.168.1.1/docuwiki/install.php

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
<?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:
// http://www.dokuwiki.org/devel:coding_style#php_closing_tags

define('DOKU_CONF','/var/www/dokudata/conf/');

* 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 http://192.168.1.1/docuwiki/install.php

Advertisements

One thought on “Installing dokuwiki on CentOS 6

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s