I have a directory (
/var/www/dental-atelier.ch/) that I would like to make accessible in two different ways.
As a normal web page
<VirtualHost 188.8.131.52:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/dental-atelier.ch <Location /> Options +Includes </Location> ServerName dental-atelier.ch ServerAlias dental-atelier.ch www.dental-atelier.ch ErrorLog logs/dental-atelier.ch-error_log CustomLog logs/dental-atelier.ch-access_log combined </VirtualHost>
and once with WebDav (but this time with SSL)
<VirtualHost _default_:443> DocumentRoot "/var/www/html" # Use separate log files for the SSL virtual host; note that LogLevel # is not inherited from httpd.conf. ErrorLog logs/ssl_error_log TransferLog logs/ssl_access_log LogLevel warn <Directory /var/www/html> Options +Includes </Directory> Alias /webdav /var/www/webdav <Directory /var/www/webdav/dental-atelier.ch/> AuthType Basic AuthName "Password Required" AuthUserFile /etc/shadow Require user user DAV On Options Indexes FollowSymLinks </Directory> </VirtualHost>
This was working without any problem with httpd 2.2.
After upgrading to 2.4 httpd is not allowing both settings for the same directory. The first one works alone (with the the first vhost) and the second one alone with the second one. If I configure both, I get
$ cadaver https://184.108.40.206/webdav/dental-atelier.ch WARNING: Untrusted server certificate presented for `ip1.corti.li': Certificate was issued to hostname `ip1.corti.li' rather than `220.127.116.11' This connection could have been intercepted. Issued to: ip1.corti.li Issued by: http://www.CAcert.org, CAcert Inc. Certificate is valid from Thu, 10 Apr 2014 10:43:34 GMT to Sat, 09 Apr 2016 10:43:34 GMT Do you wish to accept the certificate? (y/n) y Authentication required for Password Required on server `18.104.22.168': Username: user Password: Could not access /webdav/dental-atelier.ch/ (not WebDAV-enabled?): 405 Method Not Allowed Connection to `22.214.171.124' closed. dav:!>
Any Idea on how to make an HTTP-shared directory also available via WebDAV (for editing)?
The SSL virtual host logs show errors about the
Includes directive which is specified in the non-SSL virtual host (port 80):
126.96.36.199 - - [19/Feb/2015:15:40:29 +0100] "OPTIONS /webdav/dental-atelier.ch/ HTTP/1.1" 401 381 188.8.131.52 - user [19/Feb/2015:15:40:34 +0100] "OPTIONS /webdav/dental-atelier.ch/ HTTP/1.1" 200 - 184.108.40.206 - user [19/Feb/2015:15:40:34 +0100] "PROPFIND /webdav/dental-atelier.ch/ HTTP/1.1" 405 261
[Thu Feb 19 15:40:34.556872 2015] [include:warn] [pid 29499] [client 220.127.116.11:65259] AH01374: mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed: /webdav/dental-atelier.ch/index.html [Thu Feb 19 15:40:34.557949 2015] [include:warn] [pid 29499] [client 18.104.22.168:65259] AH01374: mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed: /webdav/dental-atelier.ch/index.html
The issue is really related to having the same directory used differently in two different virtual hosts. If I copy the very same directory to
/var/www/webdav/test and configure the SSL virtual host with the
test directory everything works like a charm.
The same apply if I remove the HTTP virtual host for the same directory.
If I have the same data in both then somehow Apache httpd detects it. It was not like that in 2.2.