Setting up WebDAV... the weird way

Author Message

Sebastian Picklum

Thursday 26 January 2006 9:11:39 am

Hi!

I tried to set up WebDAV on my new hosting plan. Unfortunately, every subdomain points to a directory under my ez-publish root (~/public_html). So webdav.mydomain -> ~/public_html/webdav.
The only possibility to configure the RewriteRules is via .htaccess.
So I placed a .htaccess with

RewriteEngine on
RewriteRule !^index\.php.* - [C]
RewriteRule .* /index.php?/$1

in the webdav dir and wrote an index.php containing

chdir ("..");
include("webdav.php");

That way I can now access the root-dir of my server via webdav. But changing into an siteaccess gives me an error:

dav:/> ls
Listing collection `/': succeeded.
Coll:   plain_user                             0  Jan 26 10:08
dav:/> cd plain_user 
Could not access /plain_user/ (not WebDAV-enabled?):
Did not find a collection resource.

sp@php.net

Michael Zeidler

Thursday 26 January 2006 3:47:05 pm

I would say placing the question mark before the slash ( RewriteRule .* /index.php?/$1 ) could make problems, because usually GET-Parameters are placed after it.
Also it would be interessting what pieces of information are shown in the log file placed in ./var/log/webdav.log. Please look what values were assigned to $site and $path as mentioned here http://ez.no/community/forum/install_configuration/setting_up_webdav_on_3_7_4_stable_svn . Maybe there is a relationship between our problems.

-------------------------------------------------------------------------------------------
join #ezpublish on irc.freenode.org

Sebastian Picklum

Friday 27 January 2006 2:47:24 am

The RewriteRule is completely right as the installation operates in CGI-mode where pages are accessed like this: www.somedomain.net/index.php?/content/view/full/2

The fact that I wasn't aware that the installation was running in CGI-Mode was my whole problem.
So I think our problems aren't that related :-)

I did a few tweaks and now it runs smoothly.
I can even authenticate via http-auth in webdav using the following solution:
Added the following to the WebDAV-RewriteRule:

RewriteRule (.*) /webdav.php/$1?CGI_AUTH_DATA=%{HTTP:Authorization}

Added the following at the top of webdav.php

if((empty($_SERVER['PHP_AUTH_USER']) or empty($_SERVER['PHP_AUTH_PW'])) and isset($_REQUEST['CGI_AUTH_DATA']) and preg_match('/Basic\s+(.*)$/i', $_REQUEST['CGI_AUTH_DATA'], $matc))
       list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode($matc[1]));

Voilá, WebDAV in CGI-Mode works!

sp@php.net

Michael Zeidler

Friday 27 January 2006 6:41:56 am

So basically it was an authentication issue. Unfortunately the webdav-code hasn`t caught the missed information in $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']. Also its right that my problem wasn`t related to yours as my authentication data weren´t lost.
Anyway, congrats ;)

-------------------------------------------------------------------------------------------
join #ezpublish on irc.freenode.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 00:58:38
Script start
Timing: Jan 19 2025 00:58:38
Module start 'layout'
Timing: Jan 19 2025 00:58:38
Module start 'content'
Timing: Jan 19 2025 00:58:38
Module end 'content'
Timing: Jan 19 2025 00:58:38
Script end

Main resources:

Total runtime0.5825 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.2734152.6406
Module start 'layout' 0.00620.0033 741.914139.4766
Module start 'content' 0.00950.5714 781.3906555.9375
Module end 'content' 0.58090.0016 1,337.328112.1406
Script end 0.5825  1,349.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.6041160.0002
Check MTime0.00140.2364160.0001
Mysql Total
Database connection0.00080.137210.0008
Mysqli_queries0.524590.0491600.0087
Looping result0.00060.0984580.0000
Template Total0.551894.720.2759
Template load0.00230.395920.0012
Template processing0.549594.326320.2747
Template load and register function0.00020.034310.0002
states
state_id_array0.00060.108010.0006
state_identifier_array0.00070.118120.0003
Override
Cache load0.00190.3288310.0001
Sytem overhead
Fetch class attribute can translate value0.00100.166720.0005
Fetch class attribute name0.00120.200550.0002
XML
Image XML parsing0.00200.341620.0010
class_abstraction
Instantiating content class attribute0.00000.002960.0000
General
dbfile0.00320.5433160.0002
String conversion0.00000.001740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs