Adding additional sites to Trellis

I’m very new to Trellis and have been experimenting with it but having an issue when adding an additional site to Trellis. I downloaded the example project from Git and was able to get my first site working fine. When I go in and add a second site to the wordpress_sites.yml file and the vault.yml file I can’t get the second site to work locally. I get a “Site can’t be reached” error. I ran vagrant reload and vagrant provision after updating the .yml files but nothing.

Am I missing a step? Here is what my wordpress_sites.yml file looks like:

# Documentation: https://roots.io/trellis/docs/local-development-setup/
# `wordpress_sites` options: https://roots.io/trellis/docs/wordpress-sites
# Define accompanying passwords/secrets in group_vars/development/vault.yml

wordpress_sites:
  demosite1.com:
    site_hosts:
      - demosite1.dev
    local_path: ../demosite1 # path targeting local Bedrock site directory (relative to Ansible root)
    admin_email: admin@demosite1.com
    multisite:
      enabled: false
    ssl:
      enabled: false
      provider: self-signed
    cache:
      enabled: false
  demosite2.com:
    site_hosts:
      - demosite2.dev
    local_path: ../demosite2 # path targeting local Bedrock site directory (relative to Ansible root)
    admin_email: admin@demosite2.com
    multisite:
      enabled: false
    ssl:
      enabled: false
      provider: self-signed
    cache:
      enabled: false

Any help is appreciated. I read this post: Adding sites to existing Trellis server but I don’t get an error, the site simply won’t load.

I tried this quite a while back and made it work but with an older Trellis setup, but I believe the recommendation was (and still is) one VM for one site. After switching to that setup it’s been smooth sailing. May need someone else to chime in here though.

Your setup looks correct. Can you ping demosite2.dev? Is it pointed to the Vagrant box in your hosts file?

Hi Ben, I did finally get it to work by running vagrant halt and then re upping the machine. Is that the standard process?

It’s possible that after your re-provision that Nginx needed to be restarted

That makes sense. Thanks. Do you know of any articles that show how to change the version of PHP. We have a host that does not support PHP 7 yet. Just wondered. Didn’t see anything in my initial searches.

It should just be a search/replace of 7.0 for 5.6 (or whatever). The PHP package we use also supports 5.5 and 5.6: https://launchpad.net/~ondrej/+archive/ubuntu/php