-
Notifications
You must be signed in to change notification settings - Fork 48
Using account switching in development
Michael J. Giarlo edited this page Jun 16, 2017
·
2 revisions
- Flip the
multitenancy.enabled
setting in config/settings.yml totrue
(but don't commit this later)multitenancy: enabled: true
- To support a multitenant setup locally, you'll need to ensure your localhost can respond to multiple subdomains (as each tenant is a subdomain). There's a few options for doing so:
- Option 1: Use the
lvh.me
registered domain (which just points at 127.0.0.1) as your configuredmultitenancy.admin_host
in config/settings.yml. This will mean that your main application will be available at http://lvh.me:3000 and a tenant named "test" would be at http://test.lvh.me:3000multitenancy: ... admin_host: lvh.me
- Option 2: Use dnsmasq per http://evans.io/legacy/posts/wildcard-subdomains-of-localhost/. (Tested successfully on Ubuntu.)
- Option 3: Set up some localhost IPs (one per tenant) in
/etc/hosts
(or similar), e.g.:127.0.2.1 foo 127.0.3.1 bar
- On OSX 10.11.6, it was also necessary to turn off
System Preferences > Security & Privacy > Firewall
and/or disable low level packet filtering to allow connections to the additional local IPs, as documented here:sudo pfctl -d
- On OSX 10.11.6, it was also necessary to turn off
- Option 1: Use the
- When starting Hyku, be sure to bind the rails server to 0.0.0.0 so that all of your tenants respond to HTTP requests:
rails s -b 0.0.0.0
- To manage your tenants, you'll want to have at least one superadmin user.