0277.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 NextCloud</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Linux,Nextcloud,PHP,Apache,Self-Hosted,Cloud Solution,HowTo,Web Based Tools,Collabora,Google Docs,Alternative,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Roll Your Own Google Docs with Collabora On NextCloud">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="05/24/2022 12:45:57 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Roll Your Own Google Docs with Collabora On NextCloud</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>Installing Collabora Office</h2>
  26. <ol>
  27. <li>Log into the Linux device</li>
  28. <li>Run the following commands in a terminal:
  29. <div class="codeBlock"># install signing key<br />
  30. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D<br />
  31. # add software repository<br />
  32. sudo echo &#39;deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10 ./&#39; &gt;&gt; sudo /etc/apt/sources.list<br />
  33. # update software repositories<br />
  34. sudo apt update<br />
  35. # install loolwsd and code-brand<br />
  36. sudo apt install loolwsd code-brand<br />
  37. # enable required Apache modules<br />
  38. sudo a2enmod proxy proxy_wstunnel proxy_http ssl</div>
  39. </li>
  40. </ol>
  41. <h2>Creating SSL Certificates</h2>
  42. <ol>
  43. <li>Launch XCA</li>
  44. <li>Open the PKI database if it is not already (File &gt; Open DataBase), enter password</li>
  45. <li>Click on the Certificates tab, right click on your Intermediate CA certificate</li>
  46. <li>Select New</li>
  47. <li>On the Source tab, make sure Use this Certificate for signing is selected</li>
  48. <li>Verify your Intermediate CA certificate is selected from the drop down</li>
  49. <li>Click the Subject tab</li>
  50. <li>Complete the Distinguished Name section
  51. <p>internalName: nettools.i12bretro.local<br />
  52. countryName: US<br />
  53. stateOrProvinceName: Virginia<br />
  54. localityName: Northern<br />
  55. organizationName: i12bretro<br />
  56. organizationUnitName: i12bretro Certificate Authority<br />
  57. commonName: nettools.i12bretro.local</p>
  58. </li>
  59. <li>Click the Generate a New Key button</li>
  60. <li>Enter a name and set the key size to at least 2048</li>
  61. <li>Click Create</li>
  62. <li>Click on the Extensions tab</li>
  63. <li>Select End Entity from the type list</li>
  64. <li>Click Edit next to Subject Alternative Name</li>
  65. <li>Add any DNS or IP addresses that the certificate will identify</li>
  66. <li>Update the validity dates to fit your needs</li>
  67. <li>Click the Key Usage tab</li>
  68. <li>Under Key Usage select Digital Signature, Key Encipherment</li>
  69. <li>Under Extended Key Usage select Web Server and Web Client Authentication</li>
  70. <li>Click the Netscape tab</li>
  71. <li>Select SSL Server</li>
  72. <li>Click OK to create the certificate</li>
  73. </ol>
  74. <h2>Exporting Required Files</h2>
  75. <ol>
  76. <li>In XCA, click on the Certificates tab</li>
  77. <li>Right click the Intermediate CA certificate &gt; Export &gt; File</li>
  78. <li>Set the file name CA.pem and verify the export format is PEM chain (*.pem)</li>
  79. <li>Click OK</li>
  80. <li>Right click the SSL certificate &gt; Export &gt; File</li>
  81. <li>Set the file name with a .crt extension and verify the export format is PEM (*.crt)</li>
  82. <li>Click OK</li>
  83. <li>Click the Private Keys tab</li>
  84. <li>Right click the private key generated for the SSL certificate &gt; Export &gt; File</li>
  85. <li>Set the file name with a .key extension and verify the export format is PEM private (*.pem)</li>
  86. <li>Click OK</li>
  87. </ol>
  88. <h2>Applying the Certificates</h2>
  89. <ol>
  90. <li>Download WinSCP <a href="https://winscp.net/eng/downloads.php" target="_blank">Download</a></li>
  91. <li>Extract WinSCP and run the executable</li>
  92. <li>Connect to the Collabora Online server via WinSCP</li>
  93. <li>Copy the created .crt, .key and .pem files to ~/</li>
  94. <li>On the Collabora Online server, run the following command in a terminal
  95. <div class="codeBlock">sudo cp ~/nettools.i12bretro.local.crt /etc/ssl/certs/<br />
  96. sudo cp ~/nettools.i12bretro.local.key /etc/ssl/certs/<br />
  97. sudo cp ~/CA.pem /etc/ssl/certs/<br />
  98. # edit the configuration file<br />
  99. sudo nano /etc/loolwsd/loolwsd.xml</div>
  100. </li>
  101. <li>Edit the loolwsd.xml file, find the SSL block and update the cert_file_path, key_file_path and ca_file_path values
  102. <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 />
  103. &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 />
  104. &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>
  105. </li>
  106. <li>Press CTRL+W and search for wopi</li>
  107. <li>Add a new host for the DNS name of the NextCloud server<br />
  108. <host allow="true">nettools.i12bretro.local</host></li>
  109. <li>Press CTRL+O, Enter, CTRL+X</li>
  110. <li>Continue the configuration by running the following commands in terminal:
  111. <div class="codeBlock"># create CODE proxy configuration file<br />
  112. sudo nano /etc/apache2/conf-available/code.conf</div>
  113. </li>
  114. <li>Paste the following into code.conf
  115. <p>Options -Indexes</p>
  116. <p>#Encoded slashes need to be allowed<br />
  117. AllowEncodedSlashes NoDecode</p>
  118. <p># Container uses a unique non-signed certificate<br />
  119. SSLProxyEngine On<br />
  120. SSLProxyVerify None<br />
  121. SSLProxyCheckPeerCN Off<br />
  122. SSLProxyCheckPeerName Off</p>
  123. <p># keep the host<br />
  124. ProxyPreserveHost On</p>
  125. <p># static html, js, images, etc. served from loolwsd<br />
  126. # loleaflet is the client part of Collabora Online<br />
  127. ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0<br />
  128. ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet</p>
  129. <p># WOPI discovery URL<br />
  130. ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0<br />
  131. ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery</p>
  132. <p># Capabilities<br />
  133. ProxyPass /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities retry=0<br />
  134. ProxyPassReverse /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities</p>
  135. <p># Main websocket<br />
  136. ProxyPassMatch &quot;/lool/(.*)/ws$&quot; wss://127.0.0.1:9980/lool/$1/ws nocanon</p>
  137. <p># Admin Console websocket<br />
  138. ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws</p>
  139. <p># Download as, Fullscreen presentation and Image upload operations<br />
  140. ProxyPass /lool https://127.0.0.1:9980/lool<br />
  141. ProxyPassReverse /lool https://127.0.0.1:9980/lool</p>
  142. </li>
  143. <li>Press CTRL+O, Enter, CTRL+X</li>
  144. <li>Continue the configuration by running the following commands in terminal:
  145. <div class="codeBlock"># edit default SSL configuration file<br />
  146. sudo nano /etc/apache2/sites-available/default-ssl.conf</div>
  147. </li>
  148. <li>Add the following line just above the /VirtualHost tag
  149. <p>Include /etc/apache2/conf-available/code.conf</p>
  150. </li>
  151. <li>Press CTRL+O, Enter, CTRL+X</li>
  152. <li>Continue the configuration by running the following commands in terminal:
  153. <div class="codeBlock"># edit NextCloud configuration file<br />
  154. sudo nano /var/www/nextcloud/config/config.php</div>
  155. </li>
  156. <li>Find the trusted_domains array and add the DNS used for the SSL certificate</li>
  157. <li>Press CTRL+O, Enter, CTRL+X</li>
  158. <li>Continue with the following commands to restart loolwsd and apache2 to apply the changes:
  159. <div class="codeBlock">sudo systemctl restart loolwsd apache2</div>
  160. </li>
  161. <li>Open a web browser and navigate to https://DNS:9980</li>
  162. <li>If everything is working as expected the message OK should be shown</li>
  163. </ol>
  164. <h2>Adding Collabora Office to NextCloud</h2>
  165. <ol>
  166. <li>Log into NextCloud with an administrative user</li>
  167. <li>Click the user avatar &gt; Apps</li>
  168. <li>Select Office &amp; text from the left navigation</li>
  169. <li>Scroll down to find the Collabora app &gt; Click Download and enable</li>
  170. <li>After the download completes, click the user avatar &gt; Settings</li>
  171. <li>Click Administration &gt; Collabora Online Development Edition in the left navigation</li>
  172. <li>Enter the URL in the Collabora Online-server field &gt; Click Save</li>
  173. <li>If the above option does not appear, you can complete the same terminal by running:
  174. <div class="codeBlock">cd /var/www/nextcloud<br />
  175. sudo -u www-data php occ config:app:set --value https://nettools.i12bretro.local:9980 richdocuments wopi_url</div>
  176. </li>
  177. <li>Click on Files in the top navigation</li>
  178. <li>Click the + icon &gt; Select New Document</li>
  179. <li>Give the document a name and press Enter</li>
  180. <li>The new document should load in a word processor inside the web browser and be ready for editing</li>
  181. </ol>
  182. <p>Source: <a href="https://www.collaboraoffice.com/code/linux-packages/" target="_blank">https://www.collaboraoffice.com/code/linux-packages/</a></p>
  183. </div>
  184. </div>
  185. </body>
  186. </html>