我有一个目录 ( /var/www/dental-atelier.ch/
),我想以两种不同的方式访问该目录。
作为一个普通的网页
<VirtualHost 78.47.122.114:80>
ServerAdmin [email protected]
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>
一次使用 WebDav(但这次使用 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>
这对于 httpd 2.2 来说没有任何问题。
升级到 2.4 后,httpd 不允许对同一目录进行这两种设置。第一个单独工作(与第一个虚拟主机一起工作),第二个单独与第二个虚拟主机一起工作。如果我配置两者,我会得到
$ 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:!>
关于如何使 HTTP 共享目录也可以通过 WebDAV 使用(用于编辑)有什么想法吗?
SSL 虚拟主机日志显示有关Includes
在非 SSL 虚拟主机(端口 80)中指定的指令的错误:
ssl_访问日志:
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_错误_日志:
[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
编辑
该问题实际上与在两个不同的虚拟主机中以不同的方式使用相同的目录有关。如果我将相同的目录复制到/var/www/webdav/test
并使用该test
目录配置 SSL 虚拟主机,一切都会变得非常顺利。
如果我删除同一目录的 HTTP 虚拟主机,同样适用。
如果我在两者中都有相同的数据,那么 Apache httpd 会以某种方式检测到它。 2.2 中可不是这样的。
答案1
实际上问题是不同的:目录包含一个index.html
文件,Apache httpd 会自动传送它。
环境
DirectoryIndex disabled
解决了问题。