Wagrant Port Forwarding Does Not Work on Mavericks

I use the Geodjango roaming block , and port forwarding does not work for me.

In the field, I ran:

python manage.py runserver 0.0.0.0:8000

But http://localhost:8000, and http://localhost:4567the two do not find anything on the host machine.

The Vagrant field curl -v 'http://localhost:8000/'displays the usual:

<h2>Congratulations on your first Django-powered page.</h2>

which says that Django is working fine. But on the main machine, when you try curl -v 'http://localhost:8000/', the following output is displayed:

curl: (7) Failed connect to localhost:8000; Connection refused

My Vagrantfile has the following port forwarding settings:

config.vm.forward_port 8000, 4567

Disabling the Mac firewall does not help and stops Apache. I tried running lsof -i :8000on the host machine and there is no way out, so I believe that nothing is using the port.

Can anyone suggest something?

+4
2

, .

2 , V2 Vagrantfile, , , , ( v1 , ).

config.vm.forward_port 8000, 4567 8000 4567, .

V2 ,

Vagrant.configure("2") do |config|
  config.vm.network "forwarded_port", guest: 80, host: 8080
end
+4

, . :

sudo service iptables stop
+8

All Articles