Hello,
I’ve wracked my brain looking through all of the forums and not really finding a definitive answer to my needs. First off, I’m not a programmer, so if there’s an answer it should possibly be in layman’s terms.
So far, I’ve setup my Moodle site as https://mysite/myschool and works fine.
I’ve setup the categories as separate companies and assigned managers to control their particular category. This particular setup is not ideal and I would like to try something new.
I know Moodle isn’t set up for multi-tenancy and I’m not interested in Iomad as it really doesn’t do what I want anyway.
I would like to set up Moodle so I can use multiple subdomains. For example:
mymoodle1.mysite.com its own database moodle1database
mymoodle2.mysite.com database moodle2database
Each subdomain needs to connect to Moodle and to its particular database.
I would like to use only one Moodle install, but a separate database for each subdomain.
The problem I’m having is that I don’t understand how to configure this.
This is my single moodle config file.
<?php // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'myschool;
$CFG->dbuser = '_name';
$CFG->dbpass = 'password';
$CFG->prefix = 'mdlmg_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => '',
'dbsocket' => '',
'dbcollation' => 'utf8_general_ci',
);
$CFG->wwwroot = 'https://mysite.com/myschool';
$CFG->dataroot = '/home/xxxxxxxx/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
require_once(__DIR__ . '/lib/setup.php');
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
I have setup the moodledata folder for my Moodle site and it has its own database as shown above.
I have setup another moodledata1 folder and have assigned it to its own database.
Is there way to call the moodledata1 instance in the config file above along with the moodledata instance with a separate domain name?
For example: mysite.com/moodle calls my main moodle
And maybe something like: moodle1.mysite.com that calls its moodle
And later add another moodledata1 folder and have moodle2.mysite.com
Can I just add something in the config file to direct each subdomain to the moodle and dedicated database?
I understand I could have a moodle install for each domain, but that seems like a lot more updating and stuff. Plus I would like to sinc each subdomain to the multi wordpress and need those as seperate domains. Not sure if that would work though.
If none of this makes sense, I can sure understand that.
Thanks for any clarification.
Rod