1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
Setting up multiple boards on one server
----------------------------------------
The phpbb2 package allows for easily setting up different boards on the same
host. The advantage is that the boards share the code base and upgrades of the
package are instantly available to all boards. This feature is quite easy to
implement. This file assumes you're using the Apache web server.
To add a second (or third, ...) board to your install, you need to take the
following steps:
1. Create a new avatars dir under /var/lib/phpbb2, with the same permissions
as the existing /var/lib/phpbb2 (e.g.: /var/lib/phpbb2/board2_avatars).
2. Create a new database with the same table structure as your first board.
3. Copy /etc/phpbb2/config.php to a new file in the same directory
(e.g.: /etc/phpbb2/board2_config.php) and put the the new database
credentials there.
4. Edit /etc/phpbb2/apache2.conf and add:
Alias /board2/images/avatars /var/lib/phpbb2/board2_avatars
Alias /board2 /usr/share/phpbb2/site
<Location /board2>
php_value auto_prepend_file /etc/phpbb2/board2_config.php
</Location>
5. Restart Apache.
Your second board is now reachable at http://yourhostname.example.org/board2
If you do not want to create a separate database for each board but rather
want to concentrate them all in one, you only need to give each board a
distinct $table_prefix in config.php; they can easily share a single database.
Multiple boards across virtual hosts is also possible; if you're familiar
with configuring Apache for virtual hosts this shouldn't have to be a
problem.
We've had reports that this doesn't work reliably in some situations. The
forums will then just sometimes have the wrong settings. We believe that
this is not phpBB at fault (esp. because of the "sometimes"), but we did
receive this workaround from Rob Bos:
I've worked around this bug as follows, at Ian Pushee's advice, and
having a single config.php file that is called from all the forum
virtualhost blocks:
$dbhost = 'localhost';
$dbname = 'example';
$dbuser = 'example';
$dbpasswd = '3x@mpl3';
if ($_SERVER["HTTP_HOST"] == "forum.example.com") {
$table_prefix = 'excom_';
} else if ($_SERVER["HTTP_HOST"] == "forum.example.net") {
$table_prefix = 'exnet_';
} else if ($_SERVER["HTTP_HOST"] == "forum.example.org") {
$table_prefix = 'exorg_';
} else {
$table_prefix = 'ERR_NOT_EXIST_';
}
|