Closed philipnorton42 closed 9 years ago
Right. Now that I have internet at home I can work on this properly :)
I've created a simple setup that allows multiple mysql databases to be setup under the same 'vlad' user. I've had to update the dbname setting to be like this:
dbname: ['vladdb']
This means that it acts as a list, rather than a static variable. I need to check to see if this setup is backwards breaking (I have a feeling it might) in which case we need to update the news site.
I'll also need to generate some documentation on how to setup multiple databases, but essentially the variable will change like this:
dbname: ['vladdb', 'another', 'and another']
This will create three databases.
One other thing that we should explain. The first database in the list is assumed to be the default database. This is used as the destination of the import/export scripts as well the the database to be used for the Drupal installation scripts.
This seems like the best way of doing things. Assume a default setup with a single database, allow for other databases to be created next door to it.
:+1:
I've added some documentation on this. I'm going to close this issue now as I haven't found any more problems with this change.
Wait, I'll need to add a notice to the Vlad notices site first!
So this is a big step to getting Vlad to support Drupal multisite but am I right in thinking that it's not the last?
I guess we still need to add a facility to define further hostname aliases so that Vlad can point requests to those aliases to the same codebase so that multisite can do its thing? Based on what I'm skimming here we'd need to add additional entries per required subdomain to the host system's etc/hosts file as well as add additional entries to the guest's Apache vhosts file. Am I right? I'm not overly familiar with Drupal multisite so I could be way off the mark :)
If I am right here, then perhaps we could list these entries in Vlad's settings via another array (much like you're now doing with the database names). Maybe even webserver_hostname_alias
should become an array?
In case you hadn't guessed, I have some multisite work coming up so I'm pretty keen to get this working ;)
Looking at local_up.yml, perhaps making webserver_hostname_alias
an array isn't the right way to go here but it would certainly make sense to have an array of some kind. I also wonder if it would be worth storing Vlad's own reserved lists of subdomains in an array too (['adminer', 'xhprof', 'logs']
)? Might this make iterating over both Vlad reserved subdomains as well as multisite subdomains easier to manage?
This starts to overlap with https://github.com/hashbangcode/vlad/pull/177 but maybe that's a good thing?
Hi Dan,
I was thinking along the same lines this afternoon, after the #177 PR last night. Adding more hosts to VLAD (other than the stock adminer, etc.) should be easy considering #177. Right now I have them hardcoded in my /etc/hosts, and it really doesn't make much sense. It is pretty straightforward to just add them using the same hostsupdater plugin, using a settings variable.
Then the Ansible roles need to create the vHosts (or a single vHost with its aliases) with those hostnames.
I went ahead and added "custom aliases" to #177. Drupal Multisite (and multiple projects) configs in VLAD will be closer with this PR.
Right, I believe this is also complete. I've been testing this over the past few days and this works correctly. Barring any further changes I'll be closing this now.
Allow multiple database schemas to be created within the Vlad MySQL server. This will allow multisite setups to be run on Vlad.
Use list style syntax in the settings area and “with_items” in the database schema and user setups.