Forums / Install & configuration / Setting up WebDAV... the weird way

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

eZ debug

Timing: Jan 19 2025 01:00:56
Script start
Timing: Jan 19 2025 01:00:56
Module start 'content'
Timing: Jan 19 2025 01:00:57
Module end 'content'
Timing: Jan 19 2025 01:00:57
Script end

Main resources:

Total runtime0.8219 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0703180.8281
Module start 'content' 0.00640.6789 769.8984561.0313
Module end 'content' 0.68530.1365 1,330.9297336.7500
Script end 0.8218  1,667.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.5243210.0002
Check MTime0.00150.1794210.0001
Mysql Total
Database connection0.00090.112310.0009
Mysqli_queries0.734189.32191970.0037
Looping result0.00210.25411950.0000
Template Total0.794596.720.3972
Template load0.00190.233320.0010
Template processing0.792596.430820.3963
Template load and register function0.00020.028810.0002
states
state_id_array0.00070.090410.0007
state_identifier_array0.00090.115220.0005
Override
Cache load0.00160.1989310.0001
Sytem overhead
Fetch class attribute can translate value0.00150.179230.0005
Fetch class attribute name0.00180.220350.0004
XML
Image XML parsing0.00090.115130.0003
class_abstraction
Instantiating content class attribute0.00000.002460.0000
General
dbfile0.01051.2809270.0004
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs