配置 apache mod-vhost-alias
我想知道是否可以在 VirtualDocumentRoot 指令中使用通配符。我的意思是是否可以使用 VirtualDocumentRoot 扫描多个目录,例如多个主目录来查找站点?
I was wondering if you could use a wildcard in the VirtualDocumentRoot directive. I mean is it possible to scan multiple directories with the VirtualDocumentRoot, like multiple home directories to look for sites?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Apache 2.2.3 时无法在
VirtualDocumentRoot
指令中使用通配符。HTTP 请求的正确 VirtualHost 条目如下所示:
这将从目录
/var/www/vhosts/shared/subdir.mydomain.com< 向
subdir.mydomain.com
提供请求/code>要也提供 HTTPS 请求,请复制此内容并将
*:80
替换为*:81
Use of wildcards in the
VirtualDocumentRoot
directive is not possible using Apache 2.2.3.A correct VirtualHost entry for HTTP requests looks like this:
This will serve a request to
subdir.mydomain.com
from the directory/var/www/vhosts/shared/subdir.mydomain.com
To serve HTTPS requests too, duplicate this and replace
*:80
with*:81