Vagrant 我能';无法从url访问流浪者

Vagrant 我能';无法从url访问流浪者,vagrant,ip,virtualbox,Vagrant,Ip,Virtualbox,我是流浪汉和虚拟机的新手,对此我很抱歉 我的流浪汉档案: Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64" config.vm.network "private_network", ip: "192.168.33.10" config.vm.synced_folder "/home/user/test/public", "/var/www/" end vagrant up和vagrant ssh正常,

我是流浪汉和虚拟机的新手,对此我很抱歉

我的流浪汉档案:

Vagrant.configure("2") do |config|
 config.vm.box = "ubuntu/trusty64"
 config.vm.network "private_network", ip: "192.168.33.10"
 config.vm.synced_folder "/home/user/test/public", "/var/www/"
end
vagrant up和vagrant ssh正常,但192.168.33.10在我的浏览器中未打开

我能做什么?

curl localhost

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at localhost Port 80</address>
</body></html>

404找不到
找不到
在此服务器上找不到请求的URL/


本地主机端口80上的Apache/2.4.7(Ubuntu)服务器
看起来像是防火墙问题

do
sudo iptables-S | grep 80

您应该在行尾看到
ACCEPT
,其中包含
80

如果没有看到任何包含
80
的输出,请尝试以下解决方案


sudoiptables-A INPUT-ptcp-m多端口--dports 80443-m conntrack--ctstate新建,已建立-j ACCEPT
sudo iptables-A输出-p tcp-m多端口-dports 80443-m conntrack-ctstate已建立-j接受

通过
而且

您的虚拟机上是否有运行的web服务器(nginx,apache)?是的,我安装了Apache2您是否有另一台运行的流浪机器?你们检查了流浪者机器中的apache日志了吗?当您执行
telnet 192.168.33.10 80时会发生什么情况?
?其他流浪者机器已关机。telnet:无法连接到远程主机:连接被拒绝防火墙是否已打开?检查是否允许端口80?您可以在vm内部执行
curl localhost
吗?是否从vm运行
curl localhost
?如果是这样,则表示您的web服务器没有任何可显示的内容