0169.html 9.4 KB

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