我尝试在我的WAMP安装上启用虚拟主机,但如果启用http-vhosts.conf,则WAMP服务器将无法运行,并且图标仍为橙色.
这是我的主机文件:
127.0.0.1 localhost
127.0.0.1 test.localhost
Run Code Online (Sandbox Code Playgroud)
我的httpd.conf:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Run Code Online (Sandbox Code Playgroud)
和我的httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/test"
ServerName test.localhost
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
如果我将VirtualHosts添加到我的httpd.conf中,它可以正常工作,但我注意到如果我注释掉"Include conf/extra/httpd-vhosts.conf",Apache服务器将无法运行.是什么导致了这个问题?
谢谢,
我有一个在 Consul 注册的测试服务,其服务定义如下:
{
"name": "web",
"tags": ["web1"],
"address": "example.com",
"meta": {
"meta": "cluster",
"acl": "host_test",
"cluster": "test_cluster"
},
"port": 8000
}
Run Code Online (Sandbox Code Playgroud)
我想使用 consul-template 将该信息加载到 HAProxy 配置中。我可以按照文档中的说明获取地址和端口:
{{ range service "web" }}{{if in .Tags "web1"}}
server {{.Node}} {{ .Address }}:{{.Port}} cookie A check
{{ end }}{{end}}
Run Code Online (Sandbox Code Playgroud)
但我似乎无法获得元信息。我想我可以在服务范围内使用这样的东西来访问它:
{{range .Meta}}
{{.}}{{end}}
Run Code Online (Sandbox Code Playgroud)
知道如何从元中获取 acl 或集群吗?