helpcenter/Web/Controls/Help/Server/Docker/Mail/ConnectMailToCommunityOnLinux/ConnectMailToCommunityOnLinux.ascx

107 lines
10 KiB
Plaintext

<%@ Control Language="C#" Inherits="BaseContentUserControls"%>
<%@ Register Namespace="TeamLab.Controls" Assembly="__Code" TagPrefix="cc" %>
<script runat="server">
protected override void Init()
{
PageTitle = PageCaption = "Connecting Mail Server to Community Server on Linux";
MetaKeyWords = "";
MetaDescription = "";
}
</script>
<div class="MainHelpCenter">
<h1 class="subHeaderFeaturesCaption Guides_Video_Captions">Connecting Mail Server to Community Server on Linux</h1>
<cc:localizecontent runat="Server" controlname="~/Controls/Help/VariousControls/Versions/MailServer/MailServerDocker_Current.ascx" />
<cc:localizecontent runat="Server" controlname="~/Controls/Help/VariousControls/Versions/CommunityServer/CommunityServer_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/mail-server-server/mail-server-server.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/docker-version/docker-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">
<div class="notehelp">The possibility to connect <b>Mail Server</b> is available starting with <b>Community Server</b> version <b>8.9.2</b>.</div>
<p>To connect <b>Mail Server</b> Docker version to <b>Community Server</b> Linux version, you need to perform the following steps:</p>
<ul>
<li>Install <b>Mail Server</b> Docker version on the same network as <b>Community Server</b> or allow access to <b>Mail Server</b> over ports <b>3306</b> and <b>8081</b> for the Public IP of the machine with <b>Community Server</b> only;
<div class="notehelp nh_important"><span class="important_notice_label">Very important security condition</span> Since the database login and password are public, ports <b>3306</b> and <b>8081</b> must be closed for all except the IP of the machine where <b>Community Server</b> is installed. A configuration example can be found <a target="_blank" href="http://rudijs.github.io/2015-07/docker-restricting-container-access-with-iptables/">here</a>.</div>
</li>
<li>Find out the following <b>Mail Server</b> parameter values: <code>{PrivateIP/PublicIP}</code>, <code>{Domain}</code>, <code>{ApiAccessToken}</code>;</li>
<li>Execute an SQL script in the <b>Community Server</b> database.</li>
</ul>
</div>
</div>
</div>
<h2 id="Installing">Connecting Mail Server to Community Server</h2>
<div class="block_of_step">
<div class="screen_text">
<h6>Step 1: Download the script for installing Mail Server on a Linux machine</h6>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Docker/CommandsForPage/DownloadInstallationScript/DownloadEnterpriseEditionScript.ascx" />
<h6>Step 2: Install Mail Server in a Docker container</h6>
<p>Replace "{Domain}" with your own domain and execute the command:</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Docker/CommandsForPage/InstallMailServer/InstallMailServerUsingScript.ascx" />
<div class="notehelp nh_notice">Your domain that will be used for maintaining correspondence must be valid and configured for this machine (i.e. it should have the appropriate <b>A record</b> in the DNS settings that points your domain name to the IP address of the machine where <b>Mail Server</b> is installed).<br />In the command above, the <code>"{Domain}"</code> parameter must be understood as a <b>service domain for Mail Server</b>. It is usually specified in the <b>MX record</b> of the domain that will be used for maintaining correspondence. As a rule, the <code>"{Domain}"</code> looks like <code>mx1.onlyoffice.com</code></div>
<h6>Step 3: Enter into the running Mail Server Docker container</h6>
<p>Execute the following command:</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Docker/CommandsForPage/EnterMailServerContainer/EnterMailServerContainer.ascx" />
<h6>Step 4: Connect to the MySQL Server</h6>
<p>To do that, enter the following command:</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/ConnectToMySQL/ConnectToMySQLMail.ascx" />
<h6>Step 5: Enter the password</h6>
<p>Enter the <code>Isadmin123</code> password. After that you should see the SQL prompt:</p>
<pre><code>mysql&gt;
</code></pre>
<p>This means that you have successfully logged in to the SQL database.</p>
<h6>Step 6: Select a database for use</h6>
<p>Enter the following command (without omitting semicolon):</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/SelectMySQLDatabase/SelectMailserverDatabase.ascx" />
<h6>Step 7: Open the api_keys table and save the access_token field value</h6>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/RetrieveRowsFromMySQLTable/RetrieveRowsFromMySQLTable.ascx" />
<p>This value will be necessary at <b>Step 13</b> as <code>{ApiAccessToken}</code>.</p>
<h6>Step 8: Close the connection with MySQL and exit from the Docker container</h6>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/CloseConnectionWithMySQL.ascx" />
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Docker/CommandsForPage/ExitDockerContainer/ExitDockerContainer.ascx" />
<h6>Step 9: Go to the machine where Community Server is installed</h6>
<p>If <b>Community Server</b> is installed as a Docker container, all the following operations must be performed within the Docker container. To enter the running <b>Community Server</b> container, execute the following command:</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Docker/CommandsForPage/EnterCommunityServerContainer/EnterCommunityServerContainer.ascx" />
<h6>Step 10: Connect to the MySQL Server</h6>
<p>To do that, enter the following command:</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/ConnectToMySQL/ConnectToMySQL.ascx" />
<h6>Step 11: Enter the password</h6>
<p>Enter the password you have specified during the MySQL installation. For the Docker version, just press Enter. After that you should see the SQL prompt:</p>
<pre><code>mysql&gt;
</code></pre>
<p>This means that you have successfully logged in to the SQL database.</p>
<h6>Step 12: Select a database for use</h6>
<p>Enter the following command (without omitting semicolon):</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/SelectMySQLDatabase/SelectOnlyofficeDatabase.ascx" />
<h6>Step 13: Execute the SQL script in the Community Server database</h6>
<p>Replace the <code>{PrivateIP/PublicIP}</code>, <code>{Domain}</code>, <code>{ApiAccessToken}</code> values with actual data and execute the following script:</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/ExecuteSQLScript/ExecuteSQLScript.ascx" />
<h6>Step 14: Close the connection with MySQL</h6>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/CloseConnectionWithMySQL.ascx" />
<h6>Step 15: Open the web.appsettings.config file</h6>
<p>Now you need to change the <b>web.appsettings.config</b> that can be found in the <code>/var/www/onlyoffice/WebStudio/</code> folder. Open this file using a text editor (e.g. <b>nano</b>):</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/OpenCommunityServerConfigFile.ascx" />
<h6>Step 16: Remove the "AdministrationPage" string</h6>
<p>Go to the <code>web.hide-settings</code> string that contains disabled features list and remove the <code>"AdministrationPage"</code> value, then save the changes.</p>
<h6>Step 17: Restart the Community Server monoserve services</h6>
<p>Execute the following command:</p>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/CommandList/Linux/CommandsForPage/RestartServices/RestartMonoserveService.ascx" />
<h6>Step 18: Sign in to the portal</h6>
<p>Sign in to the portal using your administrator or owner account.</p>
<h6>Step 19: Check Mail Server for correct work</h6>
<p>On the portal start page, make sure that the <b>Mail</b> link is now displayed as the <b>Mail Server</b> one and go to this module. Follow the instructions provided <a href="<%=VirtualPathUtility.ToAbsolute("~/guides/mailserver.aspx")%>">here</a> to connect your mail domain, create a new mailbox and check if the <b>Mail Server</b> works correctly.</p>
</div>
</div>
</div>