Hello John

If you need a simple (1 site) Vagrant project for WordPress I did this:

https://github.com/kikitux/wp-vagrant

For more complex, you can check here:
http://salferrarello.com/vagrant-vvv-setup-wordpress/

They talk about site_url, sadly I am not familiar with that.

So here some more info from the Vagrant side:


Not sure what are you using for Virtualization or cloud, so I will
assume virtualbox.

If that's the case, the best will be give a private_network to each
VM, so you can have a known fixed ip, and then you can use

http://<fixedip>:80 directly

If you require other computers in the network would require access to
this VM, you can use public_network that will bridge to the network
you are using. there you can just let dhcp to give one, or ask for a
fixed IP for the VM.

For the first scenario, you can check here:
https://docs.vagrantup.com/v2/networking/private_network.html

You can add this to the Vagranfile

config.vm.network "private_network", ip: "192.168.50.4"

And that IP (or any other) will be assigned to the VM.

Hope this helps
Alvaro.

On Thu, Nov 5, 2015 at 5:20 AM, John Schank <[email protected]> wrote:
> Hello,
> I would like to be able to detect the port redirection that gets used (i.e.
> after collisions are resolved) within my vagrant file so that I can pass the
> port information into a provisioning step.
> Is such a thing possible.
>
> Let me explain why I want to do this:
> I am spinning up a VM for Wordpress development, and the wordpress instance
> needs to know the port, so that the site_url can include it. (for example:
> localhost:8888)
> Since the port could collide and vagrant will choose another port, I would
> like to be able to retrieve this port, and then pass it to a provisioning
> step, so that the wordpress
> instance in the guest os can be updated to "know" the new port.
>
> Does anyone have some advice on this topic? All ideas welcome.
>
> Thanks,
> John Schank
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/ef66ae69-f665-4d57-b1c9-0ba532fca7a4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ez82UqyFEEr1Wsf14NKFSzhhGNQJgFXVKrEqRgYJYXhvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to