How to create subdomain on digital ocean correctly?

I’ll let someone else comment on multisite potential because I haven’t implemented multisite yet. I’ll grant you that having the top level folder be the site name example.com makes it seem that “each project (site) would have its own ansible and bedrock,” as you said.

However, I think it’s just an example and in the case of this example there’s a bit of flexibility. Here’s an alternative example that might demonstrate having multiple sites.

Imagine you have several website clients whose sites you’ve found a good reason to put on the same DO droplet. Perhaps they are all hair salons. Instead of naming the project root example.com, you could name it salons or whatever works for you. Then you’d have separate bedrock projects/folders (WP + theme) per site, but one ansible folder.

salons/
├── ansible/
├── allclips/
├── beautiesalon/
└── cutswell/

Your wordpress_sites might then look like this:

wordpress_sites:
  allclips:
    site_hosts:
      - allclips.com
    local_path: ../allclips # path targeting local Bedrock site directory (relative to Ansible root)
    repo: git@github.com:username/salons.git
    branch: master
    subtree_path: allclips # relative path to your Bedrock/WP directory in your repo (above) if its not the root (like the roots-example-project structure)
    ⋮
    env:
      wp_home: http://allclips.com
      wp_siteurl: http://allclips.com/wp
      ⋮
  beautiesalon:
    site_hosts:
      - beautiesalon.com
    local_path: ../beautiesalon # path targeting local Bedrock site directory (relative to Ansible root)
    repo: git@github.com:username/salons.git
    branch: master
    subtree_path: beautiesalon # relative path to your Bedrock/WP directory in your repo (above) if its not the root (like the roots-example-project structure)
    ⋮
    env:
      wp_home: http://beautiesalon.com
      wp_siteurl: http://beautiesalon.com/wp
      ⋮
  cutswell:
    site_hosts:
      - cutswell.com
    local_path: ../cutswell # path targeting local Bedrock site directory (relative to Ansible root)
    repo: git@github.com:username/salons.git
    branch: master
    subtree_path: cutswell # relative path to your Bedrock/WP directory in your repo (above) if its not the root (like the roots-example-project structure)
    ⋮
    env:
      wp_home: http://cutswell.com
      wp_siteurl: http://cutswell.com/wp
      ⋮

When you ssh into the server you’d find the separate bedrock installs at
srv/www/allclips/current/
srv/www/beautiesalon/current/
srv/www/cutswell/current/

7 Likes