Can't Access Live Website After Vagrant Up

I set up a basic local site with trellis and vagrant for the first time this morning. After running vagrant up I’m able to access the local site on my browser when i type in my live url, but after stopping the virtual machine I’m no longer able to access the live site on the web. I just get a hanging site on all browsers.

Any help would be so greatly appreciated

What’s the URL of your local site, and what’s the URL of your remote site?

I haven’t yet pushed anything from my local setup to the web, but my local url is sixthboroughdesign.com, and so is the live site.

You’ll probably be able to access sixthboroughdesign.com and see a placeholder site, which I used to see too and it’s hosted on godaddy. But after setting up trellis this morning I can no longer access sixthboroughdesign.com on my laptop.

With vagrant up running, i can access sixthboroughdesign.com in chrome and see the local site. I’m sure I’ve done something wrong, but now that I’m in this state I can’t find any way to stop getting the local site and load the live site again.

If you’re using the same url for local and production, your hosts file has probably been modified to point to your local site, which is why you can’t access the remote one. You should use different urls for development and production. Here are some instructions for manually changing your hosts file, if you need to: https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

edit: alwaysblank beat me to it…

What do you have in trellis/group_vars/development/wordpress_sites.yml? Mine usually look like

wordpress_sites:
  site.co.uk:
    site_hosts:
    - canonical: site.test
      redirects:
      - www.site.test

If you’ve got site.co.uk in the - canonical: bit then Trellis will have added that domain in your .hosts file for the IP address in trellis/vagrant.default.yml (probably 192.168.50.5).

You’ll need to delete that entry from your hosts file and change the - canonical: url, then run vagrant provision.

1 Like

Thank you @ng3 and @alwaysblank! I will confirm this shortly, share the results, and close this issue if it’s resolved. I predict you’ve solved it, I think I set up my canonical url with .com instead of .test.

Confirmed everything is working after changing the canonical URL. Thank you both again very much!

This topic was automatically closed after 42 days. New replies are no longer allowed.