How to access local development wordpress site


#1

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?


#2

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?


#3

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


#4

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

Can you ping the VM by name?


#5

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?


#6

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?


#7

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.


#8

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.


#9

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.


#10

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


#11

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


#12

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?


#13

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


#14

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?