No edit summary |
No edit summary |
||
Line 22: | Line 22: | ||
cp config.example.php config.php | cp config.example.php config.php | ||
vim config.php | vim config.php | ||
Modify <code>config.php | Modify <code>config.php</code> to match your environment. Example: | ||
<?php | <?php | ||
Latest revision as of 11:40, 10 July 2024
Simultaneous editing of pages by multiple users requires some server preparation. For this, MongoDB and the CollabPadsBackendService must be installed.
Install MongoDB
Please install MongoDB according to the documentation your Linux distribution. It can then be started and configured for auto-start like this:
sudo systemctl start mongod sudo systemctl enable mongod
Install php-mongodb extension
The CollabPadsBackend service required a special PHP extension in order to be able to communicate with the MongoDB server. This extension is available through PECL. If you don't have PECL installed already, you can do this for example using:
sudo apt install php-devel sudo pecl install mongodb
Check the path of your PHP version to find the proper INI file. The extension can then be enabled e.g. via:
echo "extension=mongodb.so" >> /etc/php/8.2/cli/php.ini
Install CollabPadsBackendService
The CollabPadsBackendService is a pre-built PHP application that can be downloaded from buildservice.bluespice.com. You can download it like this:
cd /opt wget https://buildservice.bluespice.com/webservices/4.5.x/CollabPadsBackend.tar.gz tar xzf CollabPadsBackend.tar.gz
To configure the service one must first create a config.php
file. An example file is included:
cd CollabPadsBackend cp config.example.php config.php vim config.php
Modify config.php
to match your environment. Example:
<?php return [ 'server-id' => 'mediawiki-collabpads-backend', 'ping-interval' => 25000, 'ping-timeout' => 5000, 'port' => 8099, //The port you wish to use 'request-ip' => '127.0.0.1', //The ip you want to open your service 'baseurl' => 'https://yourwikiurl.com', 'db-type' => 'mongo', 'db-host' => '127.0.0.1', // your MongoDB-Host 'db-port' => 27017, // your MongoDB-Port 'db-name' => 'collabpads', // your MongoDB-DB-Name 'db-user' => '', // MongoDB-Username 'db-password' => '', // MongoDB-Password 'log-level' => 'INFO', 'http-client-options' => [] ];
Next you should create a proper servicedescriptor for running the application:
sudo vim /etc/systemd/system/collabpad.service
Example of collabpad.service
:
[Unit] Description = BlueSpice-CollabpadsBackend [Service] Type = simple User = www-data ExecStart =/usr/bin/php /opt/CollabpadsBackend/bin/server.php StandardOutput = file:/var/log/apache2/collabpad.log [Install] WantedBy = default.target
Start and configure the service for auto start like this:
sudo systemctl enable collabpad.service sudo systemctl start collabpad.service
Configure Apache
The new service must be reachable by the client. By default the wiki application will try to connect to it using the WebSocket protocol on the /_collabpads
subpath relative to the wiki application base URL ($wgServer
).
In order to achieve this, you must add a proper URL rewrite rule. For the Apache Webserver it looks like this:
RewriteCond %{REQUEST_URI} ^/_collabpads [NC] RewriteCond %{QUERY_STRING} transport=websocket [NC] RewriteRule /(.*) ws://127.0.0.1:8099/$1 [P,L]
The webserver needs to be restarted to load the changes:
systemctl restart apache2
You should now be able to use the editing mode Edit together.