In order to use the multi user editing, the plug-in FrontEndMessageBus must be enabled in translate5 config and the socket server started and properly configured.
One Socket Server can be used by multiple translate5 installations on the same server.
Please follow the following steps to install and configure.
Configuration of the Socket Server (SSL enabled)
SSL: translate5 and the socket server must either run with SSL or both not. A mixture is not possible.
Timezone: if the messagebus runs on a different environment: The translate5 instances and the messagebus must run in the same timezone!
Apache proxy configuration
If you have an existing Apache Config for translate5, you have only to add the
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so
LoadModule proxy_http2_module /usr/lib/apache2/modules/mod_proxy_http2.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
ProxyPass /wss ws://example.translate5.net:9056/
to your HTTPS Vhost entry.
IMPORTANT: the domain in the ProxyPass command MUST match the configured domain in the Socket Server configuration in config.php (see below)
TESTING: The above setup can NOT be tested by calling "AH01144: No protocol handler was valid for the URL /wss (scheme 'ws'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
The correct function can only tested via translate5. If the FrontendMessageBus Plugin is enabled in translate5, there should be no error in the GUI. Then everything is setup correctly.
Conclusion when using multiple Translate5 installations on one socket server
When using multiple translate5 installations on one server, they all can share one socket server. This is perfeclty possible due instance isolation in the socket server.
A separate virtualHost (for exmaple socketserver.translate5.net) may be configured then with the above proxy pass. All translate5 installations must be configured then to use socketserver.translate5.net as socket server.
Socket Server configuration in config.php
In application/modules/editor/Plugins/FrontEndMessageBus resides the file "config.php.example". Copy that file to config.php, and open it for editing.
In the translate5 the following configurations should be set with translate5 CLI:
Enable the frontend-messagebus plugin:
- Possible problems: using HTTPS but no wss schema: must be defined as error in MessageBus.js!
- Browser Error: WebSocket connection to 'wss://example.translate5.net/wss/translate5?serverId=xxx&sessionId=xxx' failed: Error during WebSocket handshake: Unexpected response code: 503
- Either the socket server is down, or the proxy is configured wrong. Apache can not route the request to the socket server.
- Browser Error: WebSocket connection to 'wss://example.translate5.net/wss/translate5?serverId=xxx&sessionId=xxx' failed: Error during WebSocket handshake: Unexpected response code: 404
- The 404 is coming from the socket server. This means the basic proxy config is correct, but one of the 3 configurable hostnames (config.php / ProxyPass / installation.ini) does not match.
Configuration of the Socket Server (without SSL, for development only!)
Since no SSL is used in this configuration, no Apache WSS Proxy is needed, the configuration is easy then. Mostly the default values can be used.
Starting the socket server
Basic usage and testing
For basic usage and testing the socket server can be run directly via commandline by calling the server.php in the FrontendMessageBus directory:
Productive usage - start the socket server via supervisord
For productive usage the server.php should be run as daemon, for example with supervisord as recommended in the documentation of the used ratchet library.
Under Ubuntu a "apt install supervisor" should do the job.
For integration of supervisord in boot up, either a start script was provided by your linux distribution or follow the instructions in: https://serverfault.com/questions/96499/how-to-automatically-start-supervisord-on-linux-ubuntu
If installed via apt under Ubuntu, just call "systemctl enable --now supervisor"
Follow the supervisor installation instructions to create proper config templates, or if installed with apt just create the following file in /etc/supervisor/conf.d/
Create a program section for translate5 messagebus:
Important: restart supervisord after creating the above configuration file.
After the restart the messagebus server should have been started automatically. To verify this do:
Important supervisord commands
First start the supervisorctl console:
This offers you the supervisor prompt showing you the status of all cofigured programs.
The following commands can be helpful:
|help [command]||prints all available commands|
|status||prints all configured commands and their status information|
|start||starts a single configured program, tab can be used to complete programs|
|restart [all | progname]||restarts all or a single program|
|update [all]||Reload program ini config and add/remove as necessary, and will restart affected programs|
|reload||reloads the whole supervisord, if the main config changed for example.|
|tail||shows the logged output of the program|