I'm trying to setup a farm using:
http://www.dokuwiki.org/tips:farm2 and dokuwiki-2009-02-14.tgz
The problem I'm having is that mod_rewrite is entering a redirect loop and ends up throwing a 500 error after it reaches the max recursion of 10. I've configured everything as per the documentation for a subdirectory farm, however I am not able to get past this redirect problem.
My farmer instance is installed at /var/www/wiki.farmer
My farm directory is /var/www/wiki
My apache config is:
<Directory "/var/www/wiki">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/wiki.farmer">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost 10.10.10.10:80>
DocumentRoot /var/www/wiki
ServerName wiki.ecu.edu
LogLevel debug
</VirtualHost>
My .htaccess file in /var/www/wiki is:
RewriteEngine On
RewriteRule ^/?([^/]+)/(.*) /var/www/wiki.ecu.edu.farmer/$2?animal=$1 [QSA]
RewriteRule ^/?([^/]+)$ /var/www/wiki.ecu.edu.farmer/?animal=$1 [QSA]
And my /var/www/wiki.farmer/inc/preload.php is:
<?php
/**
* This overwrites the DOKU_CONF. Each farm gets its own configuration and data directory.
*/
// the domain for the master instance
$farmdir = '/var/www/wiki.ecu.edu/';
// don't do anything if the animal doesn't exist
if(isset($_REQUEST['animal'])) {
if(!is_dir($farmdir . '/' . $_REQUEST['animal'])) {
nice_die("Sorry! This Wiki doesn't exist!");
}
if(!defined('DOKU_CONF')) {
define('DOKU_CONF', $farmdir . '/' . $_REQUEST['animal'] . '/conf/');
}
} else {
// don't do anything on the farmer instance
if(!isset($_REQUEST['animal'])) return;
}
?>