Virtualhost, Rewrite, host and webdav

Author Message

Hugo Sandoval

Wednesday 07 April 2010 12:56:40 pm

Hello.

I am having troubles with my virtualhost configuration and rewrite, because the webdav isn't working.

The siteaccess is by host name.

This is my apache configuration:

<VirtualHost ip.ip.ip.ip:80>
SuexecUserGroup "#id" "#id"
ServerName domain.com
ServerAlias www.domain.com
ServerAlias administrador.domain.com

DocumentRoot /home/user/public_html
ErrorLog /var/log/virtualmin/domain.com_error_log
CustomLog /var/log/virtualmin/domain.com_access_log combined
ScriptAlias /cgi-bin/ /home/user/cgi-bin/
ScriptAlias /awstats /home/user/cgi-bin
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/user/public_html>
Options -Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory /home/user/cgi-bin>
allow from all
</Directory>
RewriteEngine on
UseCanonicalName off
<IfModule mod_php5.c>
php_admin_flag safe_mode Off
php_admin_value register_globals 0
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
php_value allow_call_time_pass_reference 0
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule content/treemenu/? /index_treemenu.php [L]
Rewriterule ^/var/storage/.* - [L]
Rewriterule ^/var/[^/]+/storage/.* - [L]
RewriteRule ^/var/cache/texttoimage/.* - [L]
RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
Rewriterule ^/share/icons/.* - [L]
Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
Rewriterule ^/extension/[^/]+/design/[^/]+/(flash|stylesheets|images|javascripts?)/.* - [L]
RewriteRule ^/extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/.* - [L]
Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
RewriteRule ^/favicon\.ico - [L]
RewriteRule ^/robots\.txt - [L]
RewriteRule ^/var/[^/]+/cache/public/.* - [L]

# Uncomment the following lines when using popup style debug.
# RewriteRule ^/var/cache/debug\.html.* - [L]
# RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]
RewriteRule .* /index.php
</IfModule>

<Files awstats.pl>
AuthName "domain.com statistics"
AuthType Basic
AuthUserFile /home/user/.awstats-htpasswd
require valid-user
</Files>
Alias /dav /home/user/public_html
Alias /pipermail /var/lib/mailman/archives/public
<Location /dav>
DAV On
AuthType Basic
AuthName domain.com
AuthUserFile /home/user/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RewriteEngine off
</Location>
</VirtualHost>

I configured webdav.ini.append.php in override with:

[GeneralSettings]
EnableWebDAV=true
Logging=enabled

When use konqueror to access webdav with another domain without ezpublish installed and no apache rewrite configured:

webdav://www.anotherdomain.com/dav/

It work very well.

But with ezpublish apache rewrite configuration:

Operation cannot be completed (sorry, translated from spanish)

The folder doesn't exists...

What else I need to config?

.·. .·. .·. .·. .·. .·. .·.
http://www.softwarelibre.com.ve/

Hugo Sandoval

Wednesday 07 April 2010 2:05:01 pm

New behaviour:

Modifiying dns and using konqueror:

webdav://dav.domain.com/dav/

Ask for user and password but show index.php file opened by kwrite (embedded in konqueror), even can edit it online!

.·. .·. .·. .·. .·. .·. .·.
http://www.softwarelibre.com.ve/

Hugo Sandoval

Friday 09 April 2010 9:24:18 am

[Solved]

Create another file in apache with name (optional):

webdav.domain.com.conf

(I repeat: that name is optional)

The content is something like:

************************ <cut here>

<VirtualHost xxx.xxx.xxx.xxx:80>
SuexecUserGroup "#id" "#id"
ServerName webdav.domain.com
DocumentRoot /home/user/public_html
ErrorLog /var/log/virtualmin/webdav.domain.com_error_log
CustomLog /var/log/virtualmin/webdav.domain.com_access_log combined
ScriptAlias /cgi-bin/ /home/user/cgi-bin/
ScriptAlias /awstats /home/user/cgi-bin
DirectoryIndex webdav.php index.php
<Directory /home/user/public_html>
Options Indexes FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory /home/user/cgi-bin>
allow from all
</Directory>
RewriteEngine on
RewriteRule . /webdav.php
<Files awstats.pl>
AuthName "domain.com statistics"
AuthType Basic
AuthUserFile /home/user/.awstats-htpasswd
require valid-user
</Files>
Alias /dav /home/user/public_html
<Location /dav>
DAV On
AuthType Basic
AuthName domain.com
AuthUserFile /home/user/etc/dav.digest.passwd
Require valid-user
Satisfy All
RewriteEngine off
</Location>
</VirtualHost>

*********************<cut here>

The interesting part is:

RewriteRule . /webdav.php

webdav.domain.com must be reachable, so, must be defined in DNS.

Then, in konqueror:

webdav://webdav.domain.com ask for username and password and show the siteaccess folder of my ezpublish site.

.·. .·. .·. .·. .·. .·. .·.
http://www.softwarelibre.com.ve/

Nicolas Pastorino

Monday 12 April 2010 1:51:44 am

Thanks for sharing Hugo!

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

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 18 2025 02:51:13
Script start
Timing: Jan 18 2025 02:51:13
Module start 'layout'
Timing: Jan 18 2025 02:51:13
Module start 'content'
Timing: Jan 18 2025 02:51:15
Module end 'content'
Timing: Jan 18 2025 02:51:15
Script end

Main resources:

Total runtime1.1626 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.0164 588.0391152.6406
Module start 'layout' 0.01640.0030 740.679739.4766
Module start 'content' 0.01941.1417 780.1563584.7422
Module end 'content' 1.16120.0014 1,364.898416.1406
Script end 1.1625  1,381.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3029160.0002
Check MTime0.00150.1260160.0001
Mysql Total
Database connection0.01160.996210.0116
Mysqli_queries1.064491.5573600.0177
Looping result0.00060.0525580.0000
Template Total1.124096.720.5620
Template load0.00220.190220.0011
Template processing1.121896.490220.5609
Template load and register function0.00010.006610.0001
states
state_id_array0.00080.067810.0008
state_identifier_array0.00150.125220.0007
Override
Cache load0.00220.18591500.0000
Sytem overhead
Fetch class attribute can translate value0.00070.057820.0003
Fetch class attribute name0.00180.156560.0003
XML
Image XML parsing0.00100.084620.0005
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00090.0734220.0000
String conversion0.00000.000840.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs