I've setup Vagrant in a DO droplet installed a basic LAMP configuration. I'm able to ping the Vagrant IP, so it seems to be running fine, but of course, when accessing the droplet public IP it doesn't serve me the Apache message.

I guess I have to setup some sort of routing so that it points to the guest host, but I have no clue how..

有帮助吗?

解决方案

You can use port forwarding inside your Vagrantfile and map port 80 from your host to 80 from your guest:

config.vm.network "forwarded_port", guest: 80, host: 80

If your apache in your vm doesn't run on port 80, you need of course change the guest port.

BTW: Running vagrant on DigitalOcean doesn't make much sense. Not sure why you need it, but vagrant is designed as a development environment running on local machines.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top