[dokuwiki] Re: Dokuwiki farm question

  • From: Karl Loncarek <dh2mll@xxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 23 Oct 2009 10:38:58 +0200

Christopher Smith schrieb:
As I looked at the string $url in the send_redirect function I saw it's a filename with an absolute path. In order to work also in farms it should look like e.g. "http://127.0.0.1/dokuwiki/doku.php";, right?

Just for fun I hardcoded the above sampel URL and then it worked without flawlessly.

Is this a bug? What do you think?

Insufficient information. After a successful login, dokuwiki redirects you to the start page (or maybe the same page you were on when you pressed the login button). It should generate the url for that page in the same way it normally generates internal urls - excepting that this url should always be an absolute url. If that url is being generated incorrectly, it could be a bug or it could be that your configuration isn't set correctly.


Tomorrow I'll search whether I can found out where this absolute path comes from.

You were right it was a wrong configuration, not a bug. I defined DOKU_URL in a wrong way. I changed my preload.php accordingly and now it works (here I show my complete preload.php where default settings are always taken from the farmer.

<?php
/**
* This overwrites the DOKU_CONF. Each farm gets its own configuration and data directory. * Animal is not a subdirectory with the farmer, but at same level directroy level.
* Acces farmer like this: http://domain.org/farmer
* Access animal like this: http://domain.org/animal
* Farmer on server e.g. /var/www/farmer
* Animal on server e.g. /var/www/animal
*/

// the domain  for the master instance
$farmdir = DOKU_INC.'../';

// 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/');
   }
// correct paths according to animal and make nice looking in HTML source
   if(!defined('DOKU_REL')) define('DOKU_REL','/'.$_REQUEST['animal'].'/');
if(!defined('DOKU_URL')) define('DOKU_URL',preg_replace('/(.+)\/([^\/]+)\//','$1/'.$_REQUEST['animal'].'/',getBaseURL(true)));
} else {
   // don't do anything on the farmer instance
   return;
}

   $config_cascade = array(
     'main' => array(
       'default'   => array(DOKU_INC.'conf/dokuwiki.php'),
       'local'     => array(DOKU_CONF.'local.php'),
       'protected' => array(DOKU_CONF.'local.protected.php'),
     ),
     'acronyms'  => array(
       'default'   => array(DOKU_INC.'conf/acronyms.conf'),
       'local'     => array(DOKU_CONF.'acronyms.local.conf'),
     ),
     'entities'  => array(
       'default'   => array(DOKU_INC.'conf/entities.conf'),
       'local'     => array(DOKU_CONF.'entities.local.conf'),
     ),
     'interwiki' => array(
       'default'   => array(DOKU_INC.'conf/interwiki.conf'),
       'local'     => array(DOKU_CONF.'interwiki.local.conf'),
     ),
     'license' => array(
       'default'   => array(DOKU_INC.'conf/license.php'),
       'local'     => array(DOKU_CONF.'license.local.php'),
     ),
     'mediameta' => array(
       'default'   => array(DOKU_INC.'conf/mediameta.php'),
       'local'     => array(DOKU_CONF.'mediameta.local.php'),
     ),
     'mime'      => array(
       'default'   => array(DOKU_INC.'conf/mime.conf'),
       'local'     => array(DOKU_CONF.'mime.local.conf'),
     ),
     'scheme'    => array(
       'default'   => array(DOKU_INC.'conf/scheme.conf'),
       'local'     => array(DOKU_CONF.'scheme.local.conf'),
     ),
     'smileys'   => array(
       'default'   => array(DOKU_INC.'conf/smileys.conf'),
       'local'     => array(DOKU_CONF.'smileys.local.conf'),
     ),
     'wordblock' => array(
       'default'   => array(DOKU_INC.'conf/wordblock.conf'),
       'local'     => array(DOKU_CONF.'wordblock.local.conf'),
     ),
   );

I hope this information helps others too.
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: