Forums / Install & configuration / Virtualhost, Rewrite, host and webdav

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

eZ debug

Timing: Jan 17 2025 23:55:01
Script start
Timing: Jan 17 2025 23:55:01
Module start 'content'
Timing: Jan 17 2025 23:55:02
Module end 'content'
Timing: Jan 17 2025 23:55:02
Script end

Main resources:

Total runtime0.9842 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.0066 588.9531180.8203
Module start 'content' 0.00660.7895 769.7734589.8359
Module end 'content' 0.79620.1879 1,359.6094340.7500
Script end 0.9841  1,700.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00490.4979210.0002
Check MTime0.00230.2298210.0001
Mysql Total
Database connection0.00070.068610.0007
Mysqli_queries0.820083.31421970.0042
Looping result0.00200.20471950.0000
Template Total0.961497.720.4807
Template load0.00170.174520.0009
Template processing0.959797.509920.4798
Template load and register function0.00030.030010.0003
states
state_id_array0.00070.070910.0007
state_identifier_array0.00050.054620.0003
Override
Cache load0.00180.18321500.0000
Sytem overhead
Fetch class attribute can translate value0.01621.649430.0054
Fetch class attribute name0.00150.150560.0002
XML
Image XML parsing0.00310.310530.0010
class_abstraction
Instantiating content class attribute0.00000.001980.0000
General
dbfile0.03513.5649330.0011
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/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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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