How to access local development wordpress site

Hi,

I am developing my first roots powered site and I am having issues accessing the local vagrant site. I am using mac and vagrant seems to be working. When I go to .dev, there’s nothing there. How do I access the local site?

Are you working in Trellis? If so, can we see a copy of your wordpress_sites.yml file in the trellis > group_vars > development directory?

here’s what’s in my group_vars/dev/wordpress_sites file"

wordpress_sites:
carre.ninja:
site_hosts:
- canonical: carre.dev
redirects:
- www.carre.dev
local_path: …/site # path targeting local Bedrock site directory (relative to Ansible root)
admin_email: admin@carre.dev
multisite:
enabled: false
ssl:
enabled: false
provider: self-signed
cache:
enabled: false

If you open up the Virtualbox GUI, does it show the VM running?

Can you ping the VM by name?

I see it in virtualbox and can ping it. The site doesn’t seem to be running. Is there anything I need to do to start it?

Did you get any errors when you did your vagrant up ?

Does vault.yml have the same “site key” (carre.ninja) in place?

Might be worth trying a vagrant destroy && vagrant up for good measure?

You are using a .dev TLD? Is your hosts file correct for resolving this custom URL to the Vagrant box? You can also do this without hosts file by using a browser extension to send an appropriate Host header and the IP to the Vagrant box.

My actual site is using the .ninja tld. The development/wordpress_sites file looks like this:

wordpress_sites:
carre.ninja:
site_hosts:
- canonical: carre.dev
redirects:
- www.carre.dev
local_path: …/site # path targeting local Bedrock site directory (relative to Ansible root)
admin_email: admin@carre.dev
multisite:
enabled: false
ssl:
enabled: false
provider: self-signed
cache:
enabled: false

Also note: the development/vault is encrypted with ansible-vault if that might be the problem.

Actually @strarsis makes a good point --do you have vagrant-hostmanager installed (as noted here in the Trellis docs)? Not having it installed would cause what you’re seeing.

1 Like

I did not. I just installed it but I am still have a blank webpage when I visit carre.dev

Destroy and re-up the VM and you should be all set.

I’m having the same issue as @android2121.
Tried it 3 times already, with no errors in the setup process, but when I get to actually check the .dev website I get nothing.
Vagrant is up, dependencies are installed, hosts file in “/etc/hosts” it looks modified and correct and I don’t know where I’m going wrong.
Any insights?

Have you checked the PHP logs for that site in /srv/www/<the-domain.tld>/logs/ in the VM?

Came across this thread trying to troubleshoot a similar issue I am having. Noticing that vagrant-hostmanager is no longer listed on the Installing Trellis page. Is it no longer a requirement/dependency?

@MWDelaney I did not have to manually install it, but i ran vagrant hostmanager and it added some rules in my /etc/hosts file and I was able to access my website then. I didn’t know what the URL I had to use was so I did cat /etc/hosts and last 2 lines vagrant-hostmanager added was the information I was looking for.