小编see*_*ion的帖子

启用httpd-vhosts.conf后WAMP服务器未运行

我尝试在我的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服务器将无法运行.是什么导致了这个问题?

谢谢,

wamp wampserver httpd.conf

12
推荐指数
2
解决办法
2万
查看次数

无法使用领事模板读取服务元

我有一个在 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 或集群吗?

consul consul-template

5
推荐指数
1
解决办法
1123
查看次数

标签 统计

consul ×1

consul-template ×1

httpd.conf ×1

wamp ×1

wampserver ×1