Setup:Installation Guide/Advanced/Server configuration for CollabPads: Difference between revisions

(Created page with " {{BSVersion|bsvFrom=4.5|bsvFeature=CollabPads}} Simultaneous editing of pages by multiple users requires some server preparation. For this, MongoDB must be installed. ==Install MongoDB== Install MongoDB [https://www.mongodb.com/docs/manual/administration/install-on-linux/ according to the documentation your Linux distribution.] sudo systemctl start mongod sudo systemctl enable mongod ==Install php-mongodb== Check the path of your PHP version before you run: sudo apt...")
Tag: 2017 source edit
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
{{BSVersion|bsvFrom=4.5|bsvFeature=CollabPads}}
{{BSVersion|bsvFrom=4.5|bsvFeature=CollabPads}}


Simultaneous editing of pages by multiple users requires some server preparation. For this, MongoDB must be installed.
Simultaneous editing of pages by multiple users requires some server preparation. For this, MongoDB and the CollabPadsBackendService must be installed.
==Install MongoDB==
==Install MongoDB==
Install MongoDB [https://www.mongodb.com/docs/manual/administration/install-on-linux/ according to the documentation your Linux distribution.]
Please install MongoDB [https://www.mongodb.com/docs/manual/administration/install-on-linux/ 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 start mongod
  sudo systemctl enable mongod
  sudo systemctl enable mongod
==Install php-mongodb==
==Install php-mongodb extension==
Check the path of your PHP version before you run:
The CollabPadsBackend service required a special PHP extension in order to be able to communicate with the MongoDB server. This extension is available through [https://pecl.php.net/ PECL]. If you don't have PECL installed already, you can do this for example using:
  sudo apt install php-devel
  sudo apt install php-devel
  sudo pecl install mongodb
  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
  echo "extension=mongodb.so" >> /etc/php/8.2/cli/php.ini
==Install CollabPadsBackendService==
==Install CollabPadsBackendService==
The CollabPadsBackendService is a pre-built PHP application that can be downloaded from [https://buildservice.bluespice.com/webservices/4.5.x/CollabPadsBackend.tar.gz buildservice.bluespice.com]. You can download it like this:
  cd /opt
  cd /opt
  wget <nowiki>https://buildservice.bluespice.com/webservices/4.5.x/CollabPadsBackend.tar.gz</nowiki>
  wget <nowiki>https://buildservice.bluespice.com/webservices/4.5.x/CollabPadsBackend.tar.gz</nowiki>
  tar xzf CollabPadsBackend.tar.gz
  tar xzf CollabPadsBackend.tar.gz
To configure the service one must first create a <code>config.php</code> file. An example file is included:
  cd CollabPadsBackend
  cd CollabPadsBackend
  cp config.example.php config.php
  cp config.example.php config.php
  vim config.php
  vim config.php
''config.php'' an:
Modify <code>config.php</code> to match your environment. Example:
  <?php
  <?php
   
   
Line 39: Line 41:
  'http-client-options' => []
  'http-client-options' => []
  ];
  ];
 
Next you should create a proper servicedescriptor for running the application:
  sudo vim /etc/systemd/system/collabpad.service
  sudo vim /etc/systemd/system/collabpad.service
collabpad.service:
Example of <code>collabpad.service</code>:
  [Unit]
  [Unit]
  Description = BlueSpice-CollabpadsBackend
  Description = BlueSpice-CollabpadsBackend
Line 51: Line 53:
  [Install]
  [Install]
  WantedBy = default.target
  WantedBy = default.target
 
Start and configure the service for auto start like this:
  sudo systemctl enable collabpad.service
  sudo systemctl enable collabpad.service
  sudo systemctl start collabpad.service
  sudo systemctl start collabpad.service
==Configure Apache==
==Configure Apache==
Add the following lines to your ''rewrite'' rules:
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 <code>/_collabpads</code> subpath relative to the wiki application base URL (<code>$wgServer</code> ).
 
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 %{REQUEST_URI}  ^/_collabpads          [NC]
  RewriteCond %{QUERY_STRING} transport=websocket    [NC]
  RewriteCond %{QUERY_STRING} transport=websocket    [NC]
  RewriteRule /(.*)          ws://127.0.0.1:8099/$1 [P,L]
  RewriteRule /(.*)          ws://127.0.0.1:8099/$1 [P,L]
Restart ''apache2'':
The webserver needs to be restarted to load the changes:
  systemctl restart apache2
  systemctl restart apache2
You should now be able to choose the editing mode ''Edit together''.
You should now be able to use the editing mode ''Edit together''.
[[File:CP edit together.png|alt=Dropdown menu for the edit button with menu item 'Edit together'|center|thumb|206x206px|Edit together]]
[[File:CP edit together.png|alt=Dropdown menu for the edit button with menu item 'Edit together'|center|thumb|206x206px|Edit together]]


[[de:Setup:Installationsanleitung/Kompendium/Servereinrichtung_für_CollabPads]]
[[de:Setup:Installationsanleitung/Kompendium/Servereinrichtung_für_CollabPads]]

Latest revision as of 12:40, 10 July 2024

CollabPads is available from BlueSpice 4.5.


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.

Dropdown menu for the edit button with menu item 'Edit together'
Edit together



To submit feedback about this documentation, visit our community forum.

No categories assignedEdit

Discussions