我一直在努力尝试使用 Vagrant 连接到 centos 6.4 vm。我正在使用 salt 作为配置代理,并且我已经成功安装了 apache、php、mysql 包。当我 ssh 进入盒子时,apache 运行良好。我在 /var/www 中添加了一个 index.html 文件,当我 curl localhost:80 时我得到了内容
Vagrant.configure("2") do |config|
## Chose your base box
config.vm.box = "centos63"
config.vm.box_url = ""
## For masterless, mount your salt file root
config.vm.synced_folder "salt/roots/", "/srv/"
## Use all the defaults:
config.vm.provision :salt do |salt|
salt.verbose = true
salt.run_highstate = true
salt.minion_config = "salt/minion"
end
end
Vagrant::Config.run do |config|
config.vm.forward_port 80, 8080
config.vm.share_folder "mypath", "/var/www/leo", "."
end
我在本地机器上运行 sudo lsof -i :8080 并没有给我任何结果。我还使用 iptables -F 清除了客户机中的 iptable 配置。当我卷曲客人机器时
curl -v 'localhost:8080'
* About to connect() to localhost port 8080 (#0)
* Trying ::1...
* Connection refused
* Trying 127.0.0.1...
* Connection refused
* Trying fe80::1...
* Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
我需要安装来宾添加吗?我四处寻找如何安装它,但我不确定它是否必须安装在主机或来宾上。不知道还有什么可以尝试的。