ProxyPass 可以工作。我有一些网站使用 ProxyPass,其他网站使用 RewriteRule。 Zope VirtualHostMonster 下的文档是另一个好地方。
重写就这么简单:
<VirtualHost *:80>
ServerName webdav.example.ca
ServerAlias somethingelse
ServerAdmin email@example.ca
所以,我假设您将为 DAV 服务器拥有一个特定的主机名 - 在本例中为 webdav.example.ca。
RewriteLogLevel 0
RewriteEngine On
在你打开它之前你不能使用 Rewrite :-)
RewriteRule ^(.*) http://localhost:1980/VirtualHostBase/http/webdav.example.ca:80/Plone/Members/VirtualHostRoot$1 [L,P]
VirtuaLHostBase 之前的部分是您的 DAV 服务器所在的实际主机/端口。下一部分 http/webdav.example.ca:80 描述了您希望用户使用的 protocol//:server:port。 Plone 将是您的 Plone 站点名称。 $1 匹配正则表达式 (.*)。
</VirtualHost>
测试它就像使用 DAV 服务器上的 cadaver 一样简单。首先确保您可以访问:
http://localhost:1980/Plone/Members/username
然后:
http://localhost:1980/VirtualHostBase/http/webdav.example.ca:80/Plone/Members/VirtualHostRoot/username
最后:
http://webdav.example.ca:80/username
现在,这不会阻止用户尝试附加到其他人的文件夹,但 Zope 安全性可以。有一点鸡和蛋的情况,服务器不知道用户名,直到你已经使用了这个。