0169.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Roll Your Own Google Docs with Collabora On ownCloud</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Linux,ownCloud,PHP,Apache,Self-Hosted,Cloud Solution,HowTo,Tutorial,i12bretro,Web Based Tools,Collabora,Google Docs,Alternative">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Roll Your Own Google Docs with Collabora On ownCloud">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  12. <script type="text/javascript">
  13. $(function(){
  14. $('textarea').each(function(i,e){
  15. theTextarea = $(this);
  16. theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
  17. });
  18. $('li').each(function(i,e){
  19. if(!$(this).hasClass('noCheckbox')){
  20. var uuid = 'li_' + Math.floor(Math.random() * Math.floor(1000000)).toString() + '_' + i.toString();
  21. $(this).contents().wrap('<span id="'+ uuid +'"><label for="cb_'+ uuid +'"></label></span>');
  22. $(this).prepend('<input type="checkbox" class="completeBox" id="cb_' + uuid +'" rel="'+ uuid +'" />')
  23. }
  24. });
  25. $('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
  26. theElement = $(this);
  27. var lines = theElement.html().split("\n");
  28. theElement.empty();
  29. for(l=0;l<lines.length;l++){
  30. if($.trim(lines[l]) != '' && $.trim(lines[l]).substr(0,1) != '#' && $.trim(lines[l]).indexOf(' #') == -1 && lines[l].substr(0, 4).toUpperCase() != 'REM '){
  31. theElement.append('<input type="image" src="images/clipboard.png" value="" class="copy-text" rel="copy_'+ i +'_'+ l +'" data-clipboard-text="'+ $.trim(lines[l].replace(/"/g, '&quot;')) +'" /><span id="copy_'+ i +'_'+ l +'">'+ lines[l] +'</span>');
  32. } else {
  33. theElement.append(lines[l]);
  34. }
  35. }
  36. });
  37. $(document).on('click','input.copy-text',function(){
  38. theButton = $(this);
  39. $('input.copy-text').attr('src','images/clipboard.png');
  40. $('span.copy-animation,span.copy-animation-ps').removeClass('copy-animation copy-animation-ps');
  41. try {
  42. if($('#'+ theButton.attr('rel')).parent('div').hasClass('PS')){
  43. $('#'+ theButton.attr('rel')).addClass('copy-animation-ps');
  44. } else if($('#'+ theButton.attr('rel')).parent('div').hasClass('CMD')){
  45. $('#'+ theButton.attr('rel')).addClass('copy-animation-cmd');
  46. } else {
  47. $('#'+ theButton.attr('rel')).addClass('copy-animation');
  48. }
  49. navigator.clipboard.writeText(theButton.data('clipboard-text').replace(/<[^>]*>?/gm, ''));
  50. theButton.attr('src','images/clipboard_active.png');
  51. } catch(err) {
  52. }
  53. return false;
  54. });
  55. $(document).on('click','input.completeBox',function(){
  56. theBox = $(this);
  57. $('#'+ theBox.attr('rel')).addClass('strikethrough');
  58. theBox.prop('disabled',true);
  59. theBox.parent('li').prevAll().each(function(i,e){
  60. theLI = $(this);
  61. if(theLI.find('input[type=checkbox]').not(':checked')){
  62. $('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
  63. theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
  64. }
  65. });
  66. });
  67. if(window.self !== window.top){
  68. window.parent.$('iframe.stepsFrame').height((this['scrollingElement']['scrollHeight']+20) +'px');
  69. }
  70. });
  71. </script>
  72. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  73. </head>
  74. <body>
  75. <div id="gridContainer">
  76. <div class="topMargin"></div>
  77. <div id="listName" class="topMargin">
  78. <h1>Roll Your Own Google Docs with Collabora On ownCloud</h1>
  79. </div>
  80. <div></div>
  81. <div id="content">
  82. <h2>Installing Collabora Office</h2>
  83. <ol>
  84. <li>Log into the Linux device</li>
  85. <li>Run the following commands in a terminal:
  86. <div class="codeBlock"># install signing key<br />
  87. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D<br />
  88. # add software repository<br />
  89. sudo echo &#39;deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10 ./&#39; &gt;&gt; sudo /etc/apt/sources.list<br />
  90. # update software repositories<br />
  91. sudo apt update<br />
  92. # install loolwsd and code-brand<br />
  93. sudo apt install loolwsd code-brand<br />
  94. # enable required Apache modules<br />
  95. sudo a2enmod proxy proxy_wstunnel proxy_http ssl</div>
  96. </li>
  97. </ol>
  98. <h2>Creating SSL Certificates</h2>
  99. <ol>
  100. <li>Launch XCA</li>
  101. <li>Open the PKI database if it is not already (File &gt; Open DataBase), enter password</li>
  102. <li>Click on the Certificates tab, right click on your Intermediate CA certificate</li>
  103. <li>Select New</li>
  104. <li>On the Source tab, make sure Use this Certificate for signing is selected</li>
  105. <li>Verify your Intermediate CA certificate is selected from the drop down</li>
  106. <li>Click the Subject tab</li>
  107. <li>Complete the Distinguished Name section
  108. <p>internalName: nettools.i12bretro.local<br />
  109. countryName: US<br />
  110. stateOrProvinceName: Virginia<br />
  111. localityName: Northern<br />
  112. organizationName: i12bretro<br />
  113. organizationUnitName: i12bretro Certificate Authority<br />
  114. commonName: nettools.i12bretro.local</p>
  115. </li>
  116. <li>Click the Generate a New Key button</li>
  117. <li>Enter a name and set the key size to at least 2048</li>
  118. <li>Click Create</li>
  119. <li>Click on the Extensions tab</li>
  120. <li>Select End Entity from the type list</li>
  121. <li>Click Edit next to Subject Alternative Name</li>
  122. <li>Add any DNS or IP addresses that the certificate will identify</li>
  123. <li>Update the validity dates to fit your needs</li>
  124. <li>Click the Key Usage tab</li>
  125. <li>Under Key Usage select Digital Signature, Key Enchiperment</li>
  126. <li>Under Extended Key Usage select Web Server and Web Client Authentication</li>
  127. <li>Click the Netscape tab</li>
  128. <li>Select SSL Server</li>
  129. <li>Click OK to create the certificate</li>
  130. </ol>
  131. <h2>Exporting Required Files</h2>
  132. <ol>
  133. <li>In XCA, click on the Certificates tab</li>
  134. <li>Right click the Intermediate CA certificate &gt; Export &gt; File</li>
  135. <li>Set the file name CA.pem and verify the export format is PEM chain (*.pem)</li>
  136. <li>Click OK</li>
  137. <li>Right click the SSL certificate &gt; Export &gt; File</li>
  138. <li>Set the file name with a .crt extension and verify the export format is PEM (*.crt)</li>
  139. <li>Click OK</li>
  140. <li>Click the Private Keys tab</li>
  141. <li>Right click the private key generated for the SSL certificate &gt; Export &gt; File</li>
  142. <li>Set the file name with a .key extension and verify the export format is PEM private (*.pem)</li>
  143. <li>Click OK</li>
  144. </ol>
  145. <h2>Applying the Certificates</h2>
  146. <ol>
  147. <li>Download WinSCP <a href="https://winscp.net/eng/downloads.php" target="_blank">Download</a></li>
  148. <li>Extract WinSCP and run the executable</li>
  149. <li>Connect to the Collabora Online server via WinSCP</li>
  150. <li>Copy the created .crt, .key and .pem files to ~/</li>
  151. <li>On the Collabora Online server, run the following command in a terminal
  152. <div class="codeBlock">sudo cp ~/nettools.i12bretro.local.crt /etc/ssl/certs/<br />
  153. sudo cp ~/nettools.i12bretro.local.key /etc/ssl/certs/<br />
  154. sudo cp ~/CA.pem /etc/ssl/certs/<br />
  155. # edit the configuration file<br />
  156. sudo nano /etc/loolwsd/loolwsd.xml</div>
  157. </li>
  158. <li>Edit the loolwsd.xml file, find the SSL block and update the cert_file_path, key_file_path and ca_file_path values
  159. <p>&lt;cert_file_path desc=&quot;Path to the cert file&quot; relative=&quot;false&quot;&gt;/etc/ssl/certs/nettools.i12bretro.local.crt&lt;/cert_file_path&gt;<br />
  160. &lt;key_file_path desc=&quot;Path to the key file&quot; relative=&quot;false&quot;&gt;/etc/ssl/certs/nettools.i12bretro.local.key&lt;/key_file_path&gt;<br />
  161. &lt;ca_file_path desc=&quot;Path to the ca file&quot; relative=&quot;false&quot;&gt;/etc/ssl/certs/CA.pem&lt;/ca_file_path&gt;</p>
  162. </li>
  163. <li>Press CTRL+W and search for &lt;wopi</li>
  164. <li>Add a new host for the DNS name of the ownCloud server<br />
  165. <host allow="true">nettools.i12bretro.local</host></li>
  166. <li>Press CTRL+O, Enter, CTRL+X</li>
  167. <li>Continue the configuration by running the following commands in terminal:
  168. <div class="codeBlock"># create CODE proxy configuration file<br />
  169. sudo nano /etc/apache2/conf-available/code.conf</div>
  170. </li>
  171. <li>Paste the following into code.conf
  172. <p> Options -Indexes</p>
  173. <p> #Encoded slashes need to be allowed<br />
  174. AllowEncodedSlashes NoDecode</p>
  175. <p> # Container uses a unique non-signed certificate<br />
  176. SSLProxyEngine On<br />
  177. SSLProxyVerify None<br />
  178. SSLProxyCheckPeerCN Off<br />
  179. SSLProxyCheckPeerName Off</p>
  180. <p> # keep the host<br />
  181. ProxyPreserveHost On</p>
  182. <p> # static html, js, images, etc. served from loolwsd<br />
  183. # loleaflet is the client part of Collabora Online<br />
  184. ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0<br />
  185. ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet</p>
  186. <p> # WOPI discovery URL<br />
  187. ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0<br />
  188. ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery</p>
  189. <p> # Capabilities<br />
  190. ProxyPass /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities retry=0<br />
  191. ProxyPassReverse /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities</p>
  192. <p> # Main websocket<br />
  193. ProxyPassMatch &quot;/lool/(.*)/ws$&quot; wss://127.0.0.1:9980/lool/$1/ws nocanon</p>
  194. <p> # Admin Console websocket<br />
  195. ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws</p>
  196. <p> # Download as, Fullscreen presentation and Image upload operations<br />
  197. ProxyPass /lool https://127.0.0.1:9980/lool<br />
  198. ProxyPassReverse /lool https://127.0.0.1:9980/lool</p>
  199. </li>
  200. <li>Press CTRL+O, Enter, CTRL+X</li>
  201. <li>Continue the configuration by running the following commands in terminal:
  202. <div class="codeBlock"># edit default SSL configuration file<br />
  203. sudo nano /etc/apache2/sites-available/default-ssl.conf</div>
  204. </li>
  205. <li>Add the following line just above the /VirtualHost tag
  206. <p>Include /etc/apache2/conf-available/code.conf</p>
  207. </li>
  208. <li>Press CTRL+O, Enter, CTRL+X</li>
  209. <li>Continue the configuration by running the following commands in terminal:
  210. <div class="codeBlock"># edit ownCloud configuration file<br />
  211. sudo nano /var/www/owncloud/config/config.php</div>
  212. </li>
  213. <li>Find the trusted_domains array and add the DNS used for the SSL certificate</li>
  214. <li>Press CTRL+O, Enter, CTRL+X</li>
  215. <li>Continue with the following commands to restart loolwsd and apache2 to apply the changes:
  216. <div class="codeBlock">sudo systemctl restart loolwsd apache2</div>
  217. </li>
  218. <li>Open a web browser and navigate to https://DNS:9980</li>
  219. <li>If everything is working as expected the message OK should be shown</li>
  220. </ol>
  221. <h2>Adding Collabora Office to ownCloud</h2>
  222. <ol>
  223. <li>Log into ownCloud with an administrative user</li>
  224. <li>Click the hamburger menu in the top left corner &gt; Market</li>
  225. <li>Click Integration under the Categories heading</li>
  226. <li>Find and click on Collabora Online</li>
  227. <li>Click the Install button</li>
  228. <li>Once the installation completes, click the username dropdown &gt; Settings</li>
  229. <li>Select Admin &gt; Additional from the left navigation menu</li>
  230. <li>Enter the DNS name for the Collabora Online server URL</li>
  231. <li>Click Apply</li>
  232. <li>If the above option does not appear, you can complete the same terminal by running:
  233. <div class="codeBlock">cd /var/www/owncloud<br />
  234. sudo -u www-data php occ config:app:set --value https://nettools.i12bretro.local:9980 richdocuments wopi_url</div>
  235. </li>
  236. </ol>
  237. <p>Source: <a href="https://www.collaboraoffice.com/code/linux-packages/" target="_blank">https://www.collaboraoffice.com/code/linux-packages/</a></p>
  238. </div>
  239. </div>
  240. </body>
  241. </html>