I’m following the Roots Example Project steps (https://github.com/roots/roots-example-project.com) on Github. My current goal is just getting a local development environment setup. Everything works fine—no errors when I run “vagrant up”—but when I visit roots-example-project.dev in my browser (Chrome, Safari, and Firefox), I get a “this site can’t be reached” error.
I’m running this on Mac OS X Yosemite.
Version for everything else is the newest available because I just downloaded them.
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
98.172.xx.xxx admin.azsba.org
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
## vagrant-hostmanager-start id: 376c3ff3-3840-4e1b-b423-01e08f9bc173
192.168.50.5 roots-example-project.dev
192.168.50.5 www.roots-example-project.dev
## vagrant-hostmanager-end
When I ping roots-example-project.dev, I get this:
PING roots-example-project.dev (192.168.50.5): 56 data bytes
64 bytes from 192.168.50.5: icmp_seq=0 ttl=64 time=1.424 ms
64 bytes from 192.168.50.5: icmp_seq=1 ttl=64 time=0.601 ms
64 bytes from 192.168.50.5: icmp_seq=2 ttl=64 time=0.548 ms
64 bytes from 192.168.50.5: icmp_seq=3 ttl=64 time=0.469 ms
64 bytes from 192.168.50.5: icmp_seq=4 ttl=64 time=0.468 ms
64 bytes from 192.168.50.5: icmp_seq=5 ttl=64 time=0.783 ms
64 bytes from 192.168.50.5: icmp_seq=6 ttl=64 time=0.376 ms
64 bytes from 192.168.50.5: icmp_seq=7 ttl=64 time=0.503 ms
^C
--- roots-example-project.dev ping statistics ---
8 packets transmitted, 8 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.376/0.647/1.424/0.315 ms
This should mean the website is running, right? I am able to run “vagrant ssh” and access the web files as well—I just can’t seem to access the website on my browser.
I’m not sure how to further troubleshoot. I would appreciate any guidance you can provide! Feel free to ask if you would like more information regarding my setup, etc.
What you’ve done means the server is running and DNS/hosts file is working at least.
Here’s the next steps you can take:
vagrant ssh
sudo service nginx status
Hopefully that says it’s not running since that’s easier to debug.
If it’s not running, you can run sudo nginx -t to see if there’s any configuration issues. And might as well try to run sudo service nginx start or sudo service nginx restart and see if that gets it running.
I ran sudo service nginx status and it IS running…
vagrant@roots-example-project:~$ sudo service nginx status
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2017-01-11 22:01:49 UTC; 12min ago
Docs: man:nginx(8)
Process: 1385 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/S
Process: 1250 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, s
Main PID: 1389 (nginx)
Tasks: 3
Memory: 7.8M
CPU: 35ms
CGroup: /system.slice/nginx.service
├─1389 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
├─1390 nginx: worker process
└─1391 nginx: cache manager process
Jan 11 22:01:46 roots-example-project systemd[1]: Starting A high performance web server and a reve
Jan 11 22:01:49 roots-example-project systemd[1]: nginx.service: Failed to read PID from file /run/
Jan 11 22:01:49 roots-example-project systemd[1]: Started A high performance web server and a rever
Also ran sudo service nginx restart for good measure, but nothing happened Any other ideas?
Ok I found it, it was because of Ansible version wasn’t updated (1.9.4), after I updated to the 2.5.2 it worked ok after installed Nginx. If it can help someone else.
What worked for me was after I initially ran vagrant up was ssh’ing into the virtual machine vagrant ssh and restarting nginx sudo service nginx restart.
I am also using Ansible 2.5.2 and saw a warning about compatibility.
I’m guessing nginx started before configuration was complete? Not sure, but would be nice to fix that so others don’t run into it on their first use of Trellis locally.
This is the current commit of Trellis I cloned from:
6ac097c <Nathaniel> - (HEAD -> master, origin/master, origin/HEAD) Merge pull request #985 from roots/xdebug-autostart (5 days ago)
And I see the fix you mentioned:
ee8c437 <Nathaniel> - Enable nginx to start on boot (#980) (7 days ago)
So Nginx was running when I logged into the box, but the site was failing to load on my host. I just logged into my laptop today and it seems that the site isn’t loading again:
ping: sendto: Host is down
I’m not sure what’s going on here because it was running fine yesterday?
I checked the nginx logs for my site and saw this:
Hi all. I’m new to using Roots and I have experienced this local development provisioning issue. After cloning the roots-example-project.com, I am able to see the Wordpress install after running vagrant up within the trellis directory. However, when I go to edit the .yml files within the development directory, to customize the url’s for the project, the site won’t show/load after a vagrant reload --provision. I have deleted the Virtual Box that was installed which then allowed me to see the site, but if I pause or stop the Box, the site won’t load again. Please forgive the verbose explanation and thank you.