0169.html 10.0 KB

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