Roots Discourse

Trouble setting up Multisite on localhost

Hi, I haven’t had to spool up a multisite in a while and I’m having trouble getting it setup.

I’ve followed the documentation outlined here:

Before provisioning I’ve added the Multisite configuration to application.php, then I provisioned.

After provisioning I used ‘vagrant ssh’ and ran

$ wp core multisite-install --title="site title" --admin_user="username" --admin_password="password" --admin_email="you@example.com"

from here:

vagrant@trellis:/srv/www/project.com/current

Then I receive the following message:

Single site database tables already present.
The network already exists.

When I attempt to login to the admin, I’m unable to.

wp user list returns the correct user login and role as administrator.

When I run wp super-admin list it states:

Error: This is not a multisite installation.

I’ve attempted to destroy the instance and retry this setup twice with no luck.

Additionally, the self-assigned SSL isn’t being setup properly and the site is not secure.

Here’s my dev group_var file:

wordpress_sites:
  project.com:
    site_hosts:
      - canonical: trellis.project.build
    local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
    admin_email: info@project.com
    multisite:
      enabled: true
      subdomains: false
    ssl:
      enabled: true
      provider: self-signed
    cache:
      enabled: false

Here’s what I put in my application.php file:

/* Multisite */
Config::define('WP_ALLOW_MULTISITE', true);
Config::define('MULTISITE', true);
Config::define('SUBDOMAIN_INSTALL', false); // Set to true if using subdomains
Config::define('DOMAIN_CURRENT_SITE', env('DOMAIN_CURRENT_SITE'));
Config::define('PATH_CURRENT_SITE', env('PATH_CURRENT_SITE') ?: '/');
Config::define('SITE_ID_CURRENT_SITE', env('SITE_ID_CURRENT_SITE') ?: 1);
Config::define('BLOG_ID_CURRENT_SITE', env('BLOG_ID_CURRENT_SITE') ?: 1);