Domanda

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..

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top