Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
Error 403 + 404 after farm setup via farmer plugin
Avatar
rwshaun #1
Member for 2 weeks · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Error 403 + 404 after farm setup via farmer plugin
I am using dokuwiki since a while and am quite happy with it. Now I wanted to put pages for a special subject aside in a separate wiki. I installed the farmer plugin and set up farming with default settings (htaccess it was, I think).

But how do I access the wiki for the animal?

The farmer host name is (simplified): mywiki.foo.com
The base domain for subdomain animals is myfarm.foo.com

The info page of the farmer plugin shows me the newly set up animal: 'dog'. The link is shown as dog.myfarm.foo.com. This link, however, delivers a 404.

When I try to access the animal via the url: myfarm.foo.com/dog/ I get a 403.

I checked the directory for a .htaccess file. the (sub)directories for myfarm.foo.com do not contain any. The dokuwiki directory of mywiki.foo.com does contain one, modified by the farmer plugin. I tried to copy this to the animal directory, but that didn't help.

What am I missing out?

Regards
Rudi
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4374 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
It looks to me like you have set up your farm for .htaccess but are trying to access your animals using the virtual host type urls. In the .htaccess method you will have your farmer and the animals in two separate directories on the same level:
  farmer/
  barn/
     barn/animal_1
     barn/animal_1

And your url to access animal_1 should be http:/mydomain/barn/animal_1
 
 
In the virutal host style, you have to set up your virtual hosts in your apache configuration and there is no farmer as such.  Instead there is a directory which holds a complete dokuwiki, which is in effect the farmer, and inside that dokuwiki directory you have your animals.  So if your farm domain is vfarm.com:
     myfarm/ 
           cow.vrfarm.com/
           rooster.vfarm.com
So check your farm setup to see which has been installed on your server. 

I'm not familiar with the farmer plugin and so don't know how it sets up the farm.

See: https://www.dokuwiki.org/farms
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
rwshaun #3
Member for 2 weeks · 3 posts
Group memberships: Members
Show profile · Link to this post
The directory setup is as you describe it for .htaccess method.

It looks to me as if I lack a .htaccess file somewhere because if I use an url like myfarm.foo.com/dog/ I get a 403. Note: myfarm.foo.com already points to the barn directory. I can as well access it with mydomain.foo.com/barn/dog/ - same: 403. As soon as I make a spelling error like myfarm.foo.com/doggy/ I get a 404.
Avatar
turnermm (Moderator) #4
Member since Oct 2009 · 4374 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
In the barn you need the following .htaccess:

RewriteEngine On

RewriteRule ^/?([^/]+)/(.*)  /farmer/$2?animal=$1 [QSA]
RewriteRule ^/?([^/]+)$      /farmer/?animal=$1 [QSA]
Options +FollowSymLinks

In farmer/inc you need a special preload.php, which you can download here:
  https://www.dokuwiki.org/tips:redirect_farm#step_4let_the_…
You can also download the above .htaccess from that page.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
andi (Administrator) #5
User title: splitbrain
Member since May 2006 · 3357 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #3
Quote by rwshaun on 2018-11-06, 17:13:
It looks to me as if I lack a .htaccess file somewhere because if I use an url like myfarm.foo.com/dog/ I get a 403.

No htaccess files should be in the animal dirs. Your animal should not be accessible through a subdirectory on the farmer.

Quote by rwshaun on 2018-11-06, 17:13:
Note: myfarm.foo.com already points to the barn directory.

That's wrong. All your virtual hosts should point to the farmer directory. The farmer plugin uses the HTTP host header to figure out what data to load.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
rwshaun #6
Member for 2 weeks · 3 posts
Group memberships: Members
Show profile · Link to this post
Thanks for all your answers and efforts.

The .htaccess file with the mentioned content (with an extra rewrite flag of [QSA,DPI] is present in the directory
   /farmer/

The directory
   /barn/
does not contain a .htaccess file. Neither do the subdirectories of /barn/.

The setup using the farmer plugin has been done in the htaccess style, not the virtual host style.

The farmer/inc contains a preload.php. The content is different, though, as it has been added by the farmer plugin. My preload.php actually only includes another php file: /../lib/plugins/farmer/DokuWikiFarmCore.php

Everything is there, is present as described by you, it seems. What could be still wrong? The farmer plugin offers for configuration a 'Farmer Host Name' - I set mywiki.foo.com and a 'Base Domain for subdomain Animals' - I set myfarm.foo.com (pointing to the /barn/). Maybe there's something wrong with that setting?

It still puzzles me that I'm getting a 403, not a 404.
Avatar
andi (Administrator) #7
User title: splitbrain
Member since May 2006 · 3357 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
where do your virtual hosts for the animals point to? can you figure out who creates the 403? Apache or DokuWiki? I have a feeling it's Apache. Apache is probably complaining about some ownership/permission thing somewhere. Check your Webserver logs.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-11-16, 21:54:11 (UTC +01:00)