An open API service indexing awesome lists of open source software.

https://github.com/generoi/multisitecreate


https://github.com/generoi/multisitecreate

Last synced: 28 days ago
JSON representation

Awesome Lists containing this project

README

          

Multisite Create
================

_Deprecated in favour of [Multisite](https://github.com/generoi/multisite)_

INSTALLATION
------------
1. Either symlink the multisitecreate_profile installation profile to profiles/
or include the files in your own profile and use the functions provided for
creating a shared user after installation.

2. Create a shared settings.php file eg. `sites/default/settings.shared.php`
and have it include the main database configurations for connecting.

- If you want to have separate databases for multisite instances the
database user requires all access so it can create and use newly created
databases.
- If you want to use shared tables (eg. users) you should set this up as
well.

3. Create a multisite default settings.php file eg.
`sites/default/settings.multisite.php` that includes the shared settings
file as well as other possible multisite configurations.

This file will be read and appended with per multisite configurations
while an instance is created. This is done by adding to the array, eg.
$databases['default']['default']['prefix']['default'] = 'subdomain.';
So for shared tables to work the prefixes should be set up correctly.

4. Reuse the shared settings file in your main `settings.php` file as well.

5. Configure variables in your `settings.php`

```php
// Shared users table variable required in multisitecreate_profile.
$conf['multisitecreate_user_table'] = 'shared.users';
// Role for the admin user created in a new multisite instance.
$conf['multisitecreate_admin_role'] = 'blogger';
// The email for the registered temporary admin user.
$conf['multisitecreate_temp_email'] = 'admin@example.org';
```

5. Enable the module

6. Configure how multisites are created at admin/people/multisitecreate/settings

7. Visit admin/people/multisitecreate and create a new multisite

EXAMPLE SETTINGS CONFIGURATIONS
-------------------------------

This is an example settings file setup for creating multisite instances with
separate databases and shared user tables.

### sites/default/settings.php

```php
check_plain(request_uri())));
exit;
}
```

### sites/default/settings.shared.php

```php

# .... the contents of default.settings.php..

// Shared users table variable required in multisitecreate_profile.
$conf['multisitecreate_user_table'] = 'shared.users';
// Role for the admin user created in a new multisite instance.
$conf['multisitecreate_admin_role'] = 'blogger';
// The email for the registered temporary admin user.
$conf['multisitecreate_temp_email'] = 'admin@example.org';

if (file_exists(__DIR__ .'/settings.local.php')) {
include __DIR__ . '/settings.local.php';
}

```

### sites/default/settings.local.php

```php
'...',
'username' => '...',
'password' => '...',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => array(
'default' => 'main.',
'users' => 'shared.',
'sessions' => 'shared.',
'authmap' => 'shared.',
// table is used to memorie the user which initialized the site
// create process. This table must exist in a database!
'cache_multisitecreate' => 'shared.',
),
);

$cookie_domain = '.example.org';
```

### sites/default/settings.multisite.php

```php