2

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 78.47.122.114:80> 

    ServerAdmin webmaster@dental-atelier.ch 
    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://78.47.122.114/webdav/dental-atelier.ch
WARNING: Untrusted server certificate presented for `ip1.corti.li':
Certificate was issued to hostname `ip1.corti.li' rather than `78.47.122.114'
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 `78.47.122.114':
Username: user
Password: 
Could not access /webdav/dental-atelier.ch/ (not WebDAV-enabled?):
405 Method Not Allowed
Connection to `78.47.122.114' 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):

ssl_access_log:

129.132.179.107 - - [19/Feb/2015:15:40:29 +0100] "OPTIONS /webdav/dental-atelier.ch/ HTTP/1.1" 401 381
129.132.179.107 - user [19/Feb/2015:15:40:34 +0100] "OPTIONS /webdav/dental-atelier.ch/ HTTP/1.1" 200 -
129.132.179.107 - user [19/Feb/2015:15:40:34 +0100] "PROPFIND /webdav/dental-atelier.ch/ HTTP/1.1" 405 261

ssl_error_log:

[Thu Feb 19 15:40:34.556872 2015] [include:warn] [pid 29499] [client 129.132.179.107: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 129.132.179.107:65259] AH01374: mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed: /webdav/dental-atelier.ch/index.html

Edit

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.

  • Show the entire Virtualhost sections. – wurtel Feb 19 '15 at 12:55
  • @wurtel I updated the question – Matteo Feb 19 '15 at 13:14
  • The Includes error is because you don't have the Includes option set for that directory, you only have Options Indexes FollowSymLinks (did you mean to use + on those options, which would add them to the list of options enabled instead of replacing them?). What happens if you add index.html to the url? (Sorry, I don't have much knowledge about the DAV part specifically.) – wurtel Feb 19 '15 at 14:59
  • @wurtel Accessing the directory via WebDAV should not open index.html (and should not see the includes in the file). – Matteo Feb 19 '15 at 15:01
  • I first notice you don't have any DocumentRoot for your HTTPS section. However I'm not quite sure that's the reason. On the other hand you're using your system shadow file for permission. While I would strongly discourage this, make sure your apache account can (and only) read that file. – user86969 Feb 19 '15 at 15:10
2

Actually the problem was something different: the directory contains an index.html file and Apache httpd was automatically delivering it.

Setting

DirectoryIndex disabled 

solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.