{"id":34638756,"url":"https://github.com/generoi/multisitecreate","last_synced_at":"2026-05-22T23:31:17.467Z","repository":{"id":14899533,"uuid":"17623387","full_name":"generoi/multisitecreate","owner":"generoi","description":null,"archived":false,"fork":false,"pushed_at":"2014-04-04T03:55:13.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-12-26T06:16:19.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generoi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-11T08:34:42.000Z","updated_at":"2014-04-04T03:55:14.000Z","dependencies_parsed_at":"2022-09-11T21:23:26.977Z","dependency_job_id":null,"html_url":"https://github.com/generoi/multisitecreate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/generoi/multisitecreate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fmultisitecreate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fmultisitecreate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fmultisitecreate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fmultisitecreate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generoi","download_url":"https://codeload.github.com/generoi/multisitecreate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fmultisitecreate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33376046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-22T21:56:13.512Z","status":"ssl_error","status_checked_at":"2026-05-22T21:56:10.769Z","response_time":265,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T17:13:05.580Z","updated_at":"2026-05-22T23:31:17.461Z","avatar_url":"https://github.com/generoi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Multisite Create\n================\n\n_Deprecated in favour of [Multisite](https://github.com/generoi/multisite)_\n\nINSTALLATION\n------------\n1. Either symlink the multisitecreate_profile installation profile to profiles/\n   or include the files in your own profile and use the functions provided for\n   creating a shared user after installation.\n\n2. Create a shared settings.php file eg. `sites/default/settings.shared.php`\n   and have it include the main database configurations for connecting.\n\n   - If you want to have separate databases for multisite instances the\n     database user requires all access so it can create and use newly created\n     databases.\n   - If you want to use shared tables (eg. users) you should set this up as\n     well.\n\n3. Create a multisite default settings.php file eg.\n   `sites/default/settings.multisite.php` that includes the shared settings\n   file as well as other possible multisite configurations.\n\n   This file will be read and appended with per multisite configurations\n   while an instance is created. This is done by adding to the array, eg.\n   $databases['default']['default']['prefix']['default'] = 'subdomain.';\n   So for shared tables to work the prefixes should be set up correctly.\n\n4. Reuse the shared settings file in your main `settings.php` file as well.\n\n5. Configure variables in your `settings.php`\n\n   ```php\n   // Shared users table variable required in multisitecreate_profile.\n   $conf['multisitecreate_user_table'] = 'shared.users';\n   // Role for the admin user created in a new multisite instance.\n   $conf['multisitecreate_admin_role'] = 'blogger';\n   // The email for the registered temporary admin user.\n   $conf['multisitecreate_temp_email'] = 'admin@example.org';\n   ```\n\n5. Enable the module\n\n6. Configure how multisites are created at admin/people/multisitecreate/settings\n\n7. Visit admin/people/multisitecreate and create a new multisite\n\nEXAMPLE SETTINGS CONFIGURATIONS\n-------------------------------\n\nThis is an example settings file setup for creating multisite instances with\nseparate databases and shared user tables.\n\n### sites/default/settings.php\n\n```php\n\u003c?php\n\n/**\n * @file\n * Configurations for the main site.\n */\n\ninclude __DIR__ . '/settings.shared.php';\n\n$drupal_hash_salt = '...';\n$conf['devel_xhprof_url'] = 'https://localhost:4545/xhprof';\n\n$_whitelist = array(\n  'example.org',\n  'www.example.org',\n  'dev.example.org',\n);\n// If the domain doesnt have a subdomain directory and isnt whitelisted return a 404.\n// This applies to randomly inputing subdomains when using wildcard vhosts.\nif (php_sapi_name() != 'cli' \u0026\u0026 !in_array($_SERVER['HTTP_HOST'], $_whitelist) \u0026\u0026 conf_path() == 'sites/default') {\n  drupal_add_http_header('Status', '404 Not Found');\n  $fast_404_html = variable_get('404_fast_html');\n  print strtr($fast_404_html, array('@path' =\u003e check_plain(request_uri())));\n  exit;\n}\n```\n\n### sites/default/settings.shared.php\n\n```php\n\n# .... the contents of default.settings.php..\n\n// Shared users table variable required in multisitecreate_profile.\n$conf['multisitecreate_user_table'] = 'shared.users';\n// Role for the admin user created in a new multisite instance.\n$conf['multisitecreate_admin_role'] = 'blogger';\n// The email for the registered temporary admin user.\n$conf['multisitecreate_temp_email'] = 'admin@example.org';\n\nif (file_exists(__DIR__ .'/settings.local.php')) {\n  include __DIR__ . '/settings.local.php';\n}\n\n```\n\n### sites/default/settings.local.php\n\n```php\n\u003c?php\n\n/**\n * @file\n * Host specific configurations, this file is not tracked in git but unique per\n * environment.\n */\n\n$databases['default']['default'] = array(\n  'database' =\u003e '...',\n  'username' =\u003e '...',\n  'password' =\u003e '...',\n  'host' =\u003e 'localhost',\n  'port' =\u003e '',\n  'driver' =\u003e 'mysql',\n  'prefix' =\u003e array(\n    'default' =\u003e 'main.',\n    'users' =\u003e 'shared.',\n    'sessions' =\u003e 'shared.',\n    'authmap' =\u003e 'shared.',\n    // table is used to memorie the user which initialized the site\n    // create process. This table must exist in a database!\n    'cache_multisitecreate' =\u003e 'shared.',\n  ),\n);\n\n$cookie_domain = '.example.org';\n```\n\n### sites/default/settings.multisite.php\n\n```php\n\u003c?php\n\n/**\n * @file\n * Boilerplate for multisite instances, this loads the default settings such as\n * database configurations but then overrides with multisite specific\n * configurations.\n */\n\ninclude DRUPAL_ROOT . '/sites/default/shared.settings.php';\n```\n\n### Example scaffolded settings: /sites/foobar.example.org/settings.php\n\n```php\n\u003c?php\n\n/**\n * @file\n * Boilerplate for multisite instances, this loads the default settings such as\n * database configurations but then overrides with multisite specific\n * configurations.\n */\n\ninclude DRUPAL_ROOT . '/sites/default/shared.settings.php';\n// On installation and update runs separate tables are required.\nif (preg_match('@^/(install|update)\\.php@', request_uri(), $matches) \u0026\u0026 !isset($install_done)) {\n  $databases['default']['default']['prefix'] = 'foobar_example_com.';\n}\n// Once installed, use the shared tables.\nelse {\n  $databases['default']['default']['prefix']['default'] = 'foobar_example_com.';\n}\n \n$databases['default']['default']['database'] = 'foobar_example_com';\n \n$drupal_hash_salt = '.................';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fmultisitecreate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneroi%2Fmultisitecreate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fmultisitecreate/lists"}