Multi-site capability (General)

by Yohei, Thursday, December 07, 2017, 07:43 (9 days ago)

Can you please let me know if my little forum can host multiple sites (=multiple forums) out of one single installation? If yes, does it require several MySQL databases, or just one single database?

Thank you so much.

Avatar

Multi-site capability

by Milo ⌂, Thursday, December 07, 2017, 08:02 (9 days ago) @ Yohei

Hi Yohei,

Can you please let me know if my little forum can host multiple sites (=multiple forums) out of one single installation?

Yes, it works with more than one installation. You have to specify some kind of unique prefixes for cookie-handling etc. but it will works.

If yes, does it require several MySQL databases, or just one single database?

No, you can define a unique table prefix per installation.

/Micha

--
Surveyor-Software: Geodetic Network Adjustment & Deformation-Analysis and Transformation

Avatar

Multi-site capability

by Auge ⌂ @, Thursday, December 07, 2017, 08:58 (9 days ago) @ Milo

Hello

If yes, does it require several MySQL databases, or just one single database?


No, you can define a unique table prefix per installation.

As an amendment: If you prefer a common user database, you can specify the preferred user-data-table in config/db_settings.php after an additional installation.

db_settings.php of the first installation:

<?php
// Database host, mostly 'localhost':
$db_settings['host'] = 'localhost';
// Database name:
$db_settings['database'] = 'database123';
// Database user name:
$db_settings['user'] = 'user123';
// Database password:
$db_settings['password'] = 'password123';
// Database tables (normally not necessary to edit): 
$db_settings['settings_table'] =       'mlf2_settings';
$db_settings['forum_table'] =          'mlf2_entries';
$db_settings['category_table'] =       'mlf2_categories';
$db_settings['userdata_table'] =       'mlf2_userdata';
$db_settings['smilies_table'] =        'mlf2_smilies';
$db_settings['pages_table'] =          'mlf2_pages';
$db_settings['banlists_table'] =       'mlf2_banlists';
$db_settings['useronline_table'] =     'mlf2_useronline';
$db_settings['login_control_table'] =  'mlf2_logincontrol';
$db_settings['entry_cache_table'] =    'mlf2_entries_cache';
$db_settings['userdata_cache_table'] = 'mlf2_userdata_cache';
$db_settings['bookmark_table'] =       'mlf2_bookmarks';
$db_settings['read_status_table'] =    'mlf2_read_entries';
$db_settings['temp_infos_table'] =     'mlf2_temp_infos';
?>

db_settings.php of the second installation:

<?php
// Database host, mostly 'localhost':
$db_settings['host'] = 'localhost';
// Database name:
$db_settings['database'] = 'database123';
// Database user name:
$db_settings['user'] = 'user123';
// Database password:
$db_settings['password'] = 'password123';
// Database tables (normally not necessary to edit): 
$db_settings['settings_table'] =       'mlf21_settings';
$db_settings['forum_table'] =          'mlf21_entries';
$db_settings['category_table'] =       'mlf21_categories';
$db_settings['userdata_table'] =       'mlf2_userdata'; // common user data
$db_settings['smilies_table'] =        'mlf21_smilies';
$db_settings['pages_table'] =          'mlf21_pages';
$db_settings['banlists_table'] =       'mlf2_banlists'; // common banlists
$db_settings['useronline_table'] =     'mlf21_useronline';
$db_settings['login_control_table'] =  'mlf21_logincontrol';
$db_settings['entry_cache_table'] =    'mlf21_entries_cache';
$db_settings['userdata_cache_table'] = 'mlf2_userdata_cache'; // common user data cache
$db_settings['bookmark_table'] =       'mlf21_bookmarks';
$db_settings['read_status_table'] =    'mlf21_read_entries';
$db_settings['temp_infos_table'] =     'mlf21_temp_infos';
?>

With that settings the second installation will use the user- and the banlists of the first installation. You'll need different cookie prefixes, as Milo said.

Tschö, Auge

--
further development of mlf1

Avatar

Multi-site capability

by Milo ⌂, Thursday, December 07, 2017, 09:24 (9 days ago) @ Auge

Hi Auge,

db_settings.php of the second installation:

 
$db_settings['category_table'] =       'mlf21_categories';
$db_settings['userdata_table'] =       'mlf2_userdata'; // common user data

Afaik, this modification is not supported by the update routine, i.e. db_settings.php file will be overwritten in an unwanted way.

/Micha

--
Surveyor-Software: Geodetic Network Adjustment & Deformation-Analysis and Transformation

Avatar

Multi-site capability

by Auge ⌂ @, Thursday, December 07, 2017, 11:41 (9 days ago) @ Milo

Hello Milo

db_settings.php of the second installation:

 
$db_settings['category_table'] =       'mlf21_categories';
$db_settings['userdata_table'] =       'mlf2_userdata'; // common user data


Afaik, this modification is not supported by the update routine, i.e. db_settings.php file will be overwritten in an unwanted way.

It might be possible to break the db_settings.php. If, it has to be corrected manually. On the other hand the update script seems to take the value from the settings array. In that case it uses the correct table names.

Tschö, Auge

--
further development of mlf1

Avatar

Multi-site capability

by Milo ⌂, Thursday, December 07, 2017, 11:54 (9 days ago) @ Auge

Hej,

okay! Thanks for looking up.

/Micha

--
Surveyor-Software: Geodetic Network Adjustment & Deformation-Analysis and Transformation

Multi-site capability

by Yohei, Thursday, December 07, 2017, 09:00 (9 days ago) @ Milo

Dear Micha,

Thank you very much for your kind reply. That sounds really exciting.

I can imagine how to change the prefix for database tables during installation.

But could you please tell me about some overview as to how to actually make it happen? After installing the 1st forum, I can no longer access the install folder, so I cannot figure out how to install the 2nd forum.

I am sorry for many questions, and thank you once again for your kind help.

Avatar

Multi-site capability

by Milo ⌂, Thursday, December 07, 2017, 09:18 (9 days ago) @ Yohei

Hi Yohei,

After installing the 1st forum, I can no longer access the install folder, so I cannot figure out how to install the 2nd forum.

If you already have installed the forum software in one directory, you must specify new directories for the other ones, e.g. example.org/forum_1/, example.org/forum_2/, ... example.org/forum_n/


/Micha

--
Surveyor-Software: Geodetic Network Adjustment & Deformation-Analysis and Transformation

Multi-site capability

by Yohei, Thursday, December 07, 2017, 15:15 (9 days ago) @ Milo

Dear Micha & Auge,

Thank you very much for all your kind help. I tremendously appreciate it. Thank you 1000 times.

Is my understanding below correct?:

1. For the 1st forum, I do the installation in a normal way.
(e.g. www.mydomain.com/1st-forum/)

2. Then, I copy the whole directory, and re-name for the 2nd forum.
(e.g. www.mydomain.com/2nd-forum/)

3. I "manually" modify the db_settings.php file as explained by Auge for 2nd-forum.

4. I "manually" copy tables from 1st forum, and with another table prefix, past the tables in the same database for the 2nd forum.

Do I understand correctly?

Even if my understanding is correct, both directories 1st-forum and 2nd-forum contain the whole script, so it is not multi-site, but just sharing the same database...?

Do I understand wrong?

Sorry for lack of my understanding, but I am not really a technical guy... Can you please help?

Avatar

Multi-site capability

by Auge ⌂ @, Thursday, December 07, 2017, 15:47 (9 days ago) @ Yohei

Hello

Is my understanding below correct?:

No.

1. For the 1st forum, I do the installation in a normal way.
(e.g. www.mydomain.com/1st-forum/)

Yes.

2. Then, I copy the whole directory, and re-name for the 2nd forum.
(e.g. www.mydomain.com/2nd-forum/)

No, do not copy the installation. Install a second forum independent from the first one in the other directory (in directory 2nd-forum) with different table and cookie prefixes.

3. I "manually" modify the db_settings.php file as explained by Auge for 2nd-forum.

Yes. Do this after isntalling the second forum with its config/db_settings.php.

4. I "manually" copy tables from 1st forum, and with another table prefix, past the tables in the same database for the 2nd forum.

No. the install script of the second forum created the tables automatically. You'll have two sets of tables for each of the installations in your database. No neede for copying any tables.

If you change any table name in the db_settings.php to a table name of the first installation, the second forum will use the data from the specified table inst4ead it's own.

Even if my understanding is correct, both directories 1st-forum and 2nd-forum contain the whole script, so it is not multi-site, but just sharing the same database...?

Both forums will share the database tables you specified to share in the db_settings.php. Sharing all tables is pointless, because this would be one forum (under different URLs).

Tschö, Auge

--
further development of mlf1

Multi-site capability

by Yohei, Thursday, December 07, 2017, 15:56 (9 days ago) @ Auge

Dear Auge,

Thanks to your kind help, I am starting to see the light. I am starting to understand how to do multi-site.

But I still do not understand this point below:

No, do not copy the installation. Install a second forum independent from the first one in the other directory (in directory 2nd-forum) with different table and cookie prefixes.

After installing the 1st forum, I can no longer access the /install folder through my web browser. So, how can I "Install a second forum" as you said? How can I run the install again?

Thank you so much once again.

Avatar

Multi-site capability

by Milo ⌂, Monday, December 11, 2017, 08:57 (5 days ago) @ Yohei

Hi,

After installing the 1st forum, I can no longer access the /install folder through my web browser. So, how can I "Install a second forum" as you said? How can I run the install again?

Just copy the extracted zip files to a new directory and run install. Your server root may looks like this:

- htdocs
|-- forum1
|-- forum2
|-- ...

Copy the extracted zip files to the directories forum1 and forum2. Start the installation process, i.e.

example.org/forum1/install

and

example.org/forum2/install

/Micha

--
Surveyor-Software: Geodetic Network Adjustment & Deformation-Analysis and Transformation

RSS Feed of thread
powered by my little forum