helpcenter/Web/Controls/Help/Server/Linux/Document/CompileSourceCodeDocLinux/CompileSourceCodeDocLinux.ascx
alexandervnuchkov 1542b141e2 Refactoring
2017-07-20 18:16:25 +03:00

170 lines
9.6 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ Control Language="C#" Inherits="BaseContentUserControls"%>
<%@ Register Namespace="TeamLab.Controls" Assembly="__Code" TagPrefix="cc" %>
<script runat="server">
protected override void Init()
{
PageTitle = PageCaption = "Compiling Document Server for a local server";
MetaKeyWords = "";
MetaDescription = "";
}
</script>
<div class="MainHelpCenter">
<h1 class="subHeaderFeaturesCaption Guides_Video_Captions">Compiling Document Server for a local server</h1>
<cc:localizecontent runat="Server" controlname="~/Controls/Help/VariousControls/Versions/DocumentServer/DocumentServer_Current.ascx" />
<div class="keyword_block">
<ul>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/local-server/local-server.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/server-version/server-version.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/install-ONLYOFFICE/install-ONLYOFFICE.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/document-server/document-server.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/linux-version/linux-version.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/open-source-version/open-source-version.ascx" /></li>
</ul>
</div>
<div class="video_ground video_trips">
<h2 id="introduction">Introduction</h2>
<div class="block_of_step">
<div class="screen_text">
<p><b>Document Server</b> is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time. This installation guide is designed to give the user the possibility to compile and deploy <b>Document Server</b> from the source codes without any additional help. The guide is intended for the users with the knowledge and skills of Linux OS based server administration.</p>
</div>
</div>
</div>
<h2 id="SystemRequirements">System requirements</h2>
<div class="block_of_step">
<div class="screen_text">
<p><b>Hardware</b></p>
<ul>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_CPU/SysReqs_CPU.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_RAM/SysReqs_RAM.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_HDD3/SysReqs_HDD3.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_Add_Hard/SysReqs_Add_Hard.ascx" /></li>
</ul>
<p><b>Software</b></p>
<ul>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_OS3/SysReqs_OS3.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_Add_Soft12/SysReqs_Add_Soft12.ascx" /></li>
</ul>
<div class="notehelp">All the below actions are described for <b>Ubuntu Server 14.04</b>. Other distributives might require some specific actions not described here.</div>
</div>
</div>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CompilingServerDesktop/InstallDependencies/InstallDependencies.ascx" />
<h2 id="Getting&Building">Getting and building Document Server source code</h2>
<div class="block_of_step">
<div class="screen_text">
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CompilingServerDesktop/BuildSource/BuildSource.ascx" />
</div>
</div>
<h2 id="Installing">Installing and configuring Document Server</h2>
<div class="block_of_step">
<div class="screen_text">
<h5>Installing dependencies</h5>
<p>First install the dependencies necessary for <b>Document Server</b> correct work:</p>
<pre><code>sudo apt-get update
sudo apt-get install adduser redis-server rabbitmq-server nodejs libstdc++6 libcurl3 libxml2 libboost-regex-dev zlib1g fonts-dejavu fonts-liberation ttf-mscorefonts-installer fonts-crosextra-carlito fonts-takao-gothic fonts-opensymbol libxss1 libcairo2 xvfb libxtst6 libgconf2-4 libasound2
</code></pre>
<h5>Copying Document Server to its folder</h5>
<p>Switch to the <b>server</b> folder of <b>Document Server</b> and build and install it using the command:</p>
<pre><code>cd ../server && sudo make install
</code></pre>
<p>The built <b>Document Server</b> will be copied to the <code>/var/www/onlyoffice/documentserver/</code> folder, the <b>onlyoffice</b> user will be created. Also <b>Document Server</b> work folders will be created, the font list and the font thumbnails will be created automatically.</p>
<h5>Installing and configuring NGINX</h5>
<p></p>
<ol>
<li>Install NGINX:
<pre><code>sudo apt-get install nginx
</code></pre>
</li>
<li>Disable the default website:
<pre><code>sudo rm -f /etc/nginx/sites-enabled/default
</code></pre>
</li>
<li>Now you need to set up the new website. To do that create the <code>/etc/nginx/sites-available/onlyoffice-documentserver</code> file with the following contents:
<pre class="prettyprint source linenums"><code>map $http_host $this_host {
"" $host;
default $http_host;
}
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $this_host;
}
map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
server {
listen 0.0.0.0:80;
listen [::]:80 default_server;
server_tokens off;
rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
}
location /spellchecker/ {
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
}
}</code></pre>
</li>
<li>Ad the symlink to the newly created website to the <code>/etc/nginx/sites-available</code> directory:
<pre><code>sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
</code></pre>
</li>
<li>And restart NGINX to apply the changes:
<pre><code>sudo nginx -s reload
</code></pre>
</li>
</ol>
<h5>Installing and configuring PostgreSQL</h5>
<p>Install PostgreSQL using the following command:</p>
<pre><code>sudo apt-get install postgresql
</code></pre>
<p>Once PostgreSQL is installed, run the following commands to create the PostgreSQL database and user:</p>
<div class="notehelp nh_notice">The created database must have <b>onlyoffice</b> both for user and password.</div>
<pre><code>sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
</code></pre>
<p>Run the following command to configure the database:</p>
<pre><code>psql -hlocalhost -Uonlyoffice -d onlyoffice -f /var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
</code></pre>
<div class="notehelp">Upon that, you will be asked to provide a password for the <code>onlyoffice</code> PostgreSQL user. Please enter the <code>onlyoffice</code> password.</div>
</div>
</div>
<h2 id="Running">Running Document Server</h2>
<div class="block_of_step">
<div class="screen_text">
<div class="notehelp">All <b>Document Server</b> components run as foreground processes. Thus you need separate terminal consoles to run them or specific tools which will allow to run foreground processes in background mode.</div>
<ol>
<li>Start the <b>FileConverter</b> service:
<pre><code>cd /var/www/onlyoffice/documentserver/server/FileConverter/sources/ && export NODE_ENV=production-linux NODE_CONFIG_DIR=/etc/onlyoffice/documentserver && sudo -u onlyoffice -E node /var/www/onlyoffice/documentserver/server/FileConverter/sources/convertermaster.js
</code></pre>
</li>
<li>And the <b>SpellChecker</b> service:
<pre><code>export NODE_ENV=production-linux NODE_CONFIG_DIR=/etc/onlyoffice/documentserver && sudo -u onlyoffice -E node /var/www/onlyoffice/documentserver/server/SpellChecker/sources/server.js
</code></pre>
</li>
<li>After that the <b>DocService</b>:
<pre><code>export NODE_ENV=production-linux NODE_CONFIG_DIR=/etc/onlyoffice/documentserver && sudo -u onlyoffice -E node /var/www/onlyoffice/documentserver/server/DocService/sources/server.js
</code></pre>
</li>
</ol>
</div>
</div>
</div>