Share » Forums » Setup & design » WebDAV works on one site but not the...

WebDAV works on one site but not the other

WebDAV works on one site but not the other

Tuesday 02 May 2006 8:18:46 am - 5 replies

Author Message

Kristof Coomans

Tuesday 02 May 2006 9:49:54 am

Did you also take a look in the site-specific webdav.log?

Log messages of a WebDAV request always start in var/log/webdav.log but as soon as you enter a site ( like "/home" in your case ) the log continues in var/[yoursitesvardir]/log/webdav.log.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Linh Vu

Tuesday 02 May 2006 4:55:39 pm

Hi Kristof,

Thanks for the suggestion. It only went as far as var/log/webdav.log and didn't create var/<siteaccess_dir>/log/webdav.log (which sort of makes sense since it can't find the siteaccess and returns a 404).

The error in var/log/webdav.log says:

2006-05-03 09:39:58 : PROPFIND was issued from client. [processClientRequest]
2006-05-03 09:39:58 : Depth: 1. [processClientRequest]
2006-05-03 09:39:58 : Root: Fethcing site list [CS:getCollectionContent]
2006-05-03 09:39:58 : Client requesed 7 properties. [outputCollectionContent]
2006-05-03 09:39:58 : XML was parsed [outputCollectionContent]
2006-05-03 09:39:58 : handle function was called with status: 11 [handle]
2006-05-03 09:40:00 : ========================================
2006-05-03 09:40:00 : Requested URI is: /home/ [webdav.php]
2006-05-03 09:40:00 : start path: /home/ [CS:currentSitePath]
2006-05-03 09:40:00 : indexdir: home/ [CS:currentSitePath]
2006-05-03 09:40:00 : no valid site was found.. [CS:currentSitePath]

This siteaccess home works fine with the normal HTTP index.php access. Here's my override/site.ini.append.php:

[SiteSettings]
DefaultAccess=home
SiteList[]=home
IndexPage=/content/view/full/2/
DefaultPage=/content/view/full/2

....

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]=home
AvailableSiteAccessList[]=admin
MatchOrder=uri
HostMatchMapItems[]

Just standard stuff, and the other site which has a very similar setup works fine.

If I had more time, I would write less code.

Kristof Coomans

Tuesday 02 May 2006 11:44:11 pm

I compared your log with a WebDAV log of mine and this line in yours:

indexdir: home/ [CS:currentSitePath]

is in my log:

indexdir: /home/[CS:currentSitePath]

I guess it has something to do with the leading slash that's missing.

The problem is somewhere in kernel/classes/webdav/ezwebdavcontentserver.php in the method currentSiteFromPath.

After

$indexDir = eZSys::indexDir();

place this code:

$this->appendLogEntry( 'eZSys::indexDir: ' .  $indexDir, 'CS:currentSitePath');

And what do you get in the webdav log now?

I got:

eZSys::indexDir:  [CS:currentSitePath]

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Linh Vu

Wednesday 03 May 2006 6:01:11 am

That's a great spot, Kristof, thanks! I just checked my sites and the working one has the leading slash, while the problematic one doesn't. This has something to do with the preg_match on REQUEST_URI in that method you pointed out, which essentially means that ezPublish thinks that the problematic site isn't in virtual host mode (it is). I'll do some tests now. Will post here when I get the results.

Edit: I got "/" for indexdir.

2006-05-03 23:36:15 : start path: /home/ [CS:currentSitePath]
2006-05-03 23:36:15 : eZSys::indexDir: / [CS:currentSitePath]
2006-05-03 23:36:15 : indexdir: home/ [CS:currentSitePath]

And I got it to work by commenting this part out in that method:

// Remove indexDir if used in non-virtualhost mode.
        //if ( preg_match( "#^" . preg_quote( $indexDir ) . "(.+)$#", $path, $matches ) )
        //{
         //   $path = $matches[1];
        //}

Somehow my REQUEST_URI matches that pattern on this server, and it strips the leading slash off indexdir. It might have something to do with me running a replace script to change 'ezurl' to 'ezroot' on the templates of this site, but I can't find any template that this webdav server uses yet. Will look closer.

Thanks again for the suggestion. :)

If I had more time, I would write less code.

Kristof Coomans

Thursday 04 May 2006 11:55:11 pm

Maybe we can trace the problem by inspecting eZSys a little bit more.

In lib/ezutils/classes/ezsys.php, look for the function indexDir.
Change it's last two lines to this:

eZDebug::writeDebug( 'eZSys::wwwDir(): ' . $instance->wwwDir() );
eZDebug::writeDebug( 'eZSys::indexFile: ' . $instance->indexFile( $withAccessList ) );
$indexDir = $instance->wwwDir() . $instance->indexFile( $withAccessList );
return $indexDir;

Now try to access the site with WebDAV again and tell me what you get in the debug log file.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu