iredmail-doc/html/sogo-centos-6-mysql.html

238 lines
9.3 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SOGo: install SOGo on CentOS 6 with iRedMail (MySQL backend)</title>
<link href="./css/markdown.css" rel="stylesheet"></head>
</head>
<body>
<div id="navigation">
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
// <a href="./index.html">Document Index</a>
</div><h1 id="sogo-install-sogo-on-centos-6-with-iredmail-mysql-backend">SOGo: install SOGo on CentOS 6 with iRedMail (MySQL backend)</h1>
<div class="toc">
<ul>
<li><a href="#sogo-install-sogo-on-centos-6-with-iredmail-mysql-backend">SOGo: install SOGo on CentOS 6 with iRedMail (MySQL backend)</a><ul>
<li><a href="#requirements">Requirements</a></li>
<li><a href="#install-sogo">Install SOGo</a></li>
<li><a href="#create-sql-database-to-store-sogo-data">Create SQL database to store SOGo data</a></li>
<li><a href="#configure-sogo">Configure SOGo</a></li>
<li><a href="#enable-activesync-support">Enable ActiveSync support</a><ul>
<li><a href="#apache-web-server">Apache web server</a></li>
<li><a href="#nginx-web-server">Nginx web server</a></li>
</ul>
</li>
<li><a href="#start-sogo-and-dependent-services">Start SOGo and dependent services</a></li>
<li><a href="#access-sogo">Access SOGo</a></li>
<li><a href="#how-to-configure-client-applications">How to configure client applications</a><ul>
<li><a href="#apple-devices">Apple Devices</a></li>
</ul>
</li>
<li><a href="#todo">TODO</a></li>
<li><a href="#references">References</a></li>
</ul>
</li>
</ul>
</div>
<h2 id="requirements">Requirements</h2>
<ul>
<li>A working iRedMail server (MySQL backend) on CentOS 6.</li>
</ul>
<h2 id="install-sogo">Install SOGo</h2>
<ul>
<li>Make sure you have EPEL repo enabled, if not, please follow <a href="https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F">this wiki
tutorial</a>
to enable it.</li>
</ul>
<pre><code># yum repolist | grep -i 'epel'
epel Extra Packages for Enterprise Linux 6 - x86_64 11,109
</code></pre>
<ul>
<li>Add yum repo file <code>/etc/yum.repos.d/sogo.repo</code>:</li>
</ul>
<pre><code>[SOGo]
name=Inverse SOGo Repository
baseurl=http://inverse.ca/downloads/SOGo/RHEL6/$basearch
gpgcheck=0
</code></pre>
<ul>
<li>Install SOGo and dependences:</li>
</ul>
<pre><code># yum install sogo sope49-gdl1-mysql sogo-activesync libwbxml
</code></pre>
<h2 id="create-sql-database-to-store-sogo-data">Create SQL database to store SOGo data</h2>
<pre><code>$ mysql -u root -p
mysql&gt; CREATE DATABASE sogo CHARSET='UTF8';
mysql&gt; GRANT ALL ON sogo.* TO sogo@localhost IDENTIFIED BY 'password';
mysql&gt; GRANT SELECT ON vmail.mailbox TO sogo@localhost;
mysql&gt; CREATE VIEW sogo.users (c_uid, c_name, c_password, c_cn, mail, home) AS SELECT username, username, password, name, username, maildir FROM vmail.mailbox;
</code></pre>
<h2 id="configure-sogo">Configure SOGo</h2>
<p>Default SOGo config file is <code>/etc/sogo/sogo.conf</code>:</p>
<pre><code>{
WOPort = 127.0.0.1:20000;
SOGoProfileURL = &quot;mysql://sogo:password@localhost:3306/sogo/user_profiles&quot;;
OCSFolderInfoURL = &quot;mysql://sogo:password@localhost:3306/sogo/folders&quot;;
OCSSessionsFolderURL = &quot;mysql://sogo:password@localhost:3306/sogo/sessions&quot;;
// Enable email-based alarms on events and tasks.
SOGoEnableEMailAlarms = YES;
OCSEMailAlarmsFolderURL = &quot;mysql://sogo:password@localhost:3306/sogo/alarms&quot;;
// Use TLS
//SOGoIMAPServer = &quot;imaps://127.0.0.1:143/?tls=YES&quot;;
// Local connection is considered as secure by Dovecot.
SOGoIMAPServer = &quot;imap://127.0.0.1:143/&quot;;
SOGoMailingMechanism = smtp;
SOGoSMTPServer = 127.0.0.1;
// Enable managesieve service
//
// WARNING: Sieve scripts generated by SOGo is not compatible with Roundcube
// webmail, don't use sieve service in both webmails, otherwise
// it will be messy.
//
//SOGoSieveServer = sieve://PH_MANAGESIEVE_BIND_HOST:PH_MANAGESIEVE_PORT;
//SOGoSieveScriptsEnabled = YES;
//SOGoVacationEnabled = YES;
//SOGoForwardEnabled = YES;
SOGoMemcachedHost = 127.0.0.1;
SOGoTimeZone = &quot;Europe/Berlin&quot;;
SOGoFirstDayOfWeek = 1;
SOGoMailMessageCheck = every_5_minutes;
SOGoForceExternalLoginWithEmail = YES;
SOGoAppointmentSendEMailNotifications = YES;
SOGoFoldersSendEMailNotifications = YES;
SOGoACLsSendEMailNotifications = YES;
SOGoPasswordChangeEnabled = YES;
// User authentication
SOGoUserSources =
(
{
type = sql;
id = directory;
viewURL = &quot;mysql://sogo:password@127.0.0.1:3306/sogo/users&quot;;
canAuthenticate = YES;
userPasswordAlgorithm = md5;
prependPasswordScheme = YES;
// SOGo can use SQL database as address book, but it's able to
// query ALL mail accounts. Enable it on your own.
isAddressBook = NO;
}
);
}
</code></pre>
<p><strong>NOTE</strong>: SOGo will create required SQL tables automatically (<code>user_profiles</code>,
<code>folder</code>, <code>sessions</code>, ...), we don't need to create them manually.</p>
<h2 id="enable-activesync-support">Enable ActiveSync support</h2>
<h3 id="apache-web-server">Apache web server</h3>
<p>SOGo installs config file <code>/etc/httpd/conf.d/SOGo.conf</code> by default, please
open it and find below lines:</p>
<pre><code>#ProxyPass /Microsoft-Server-ActiveSync \
# http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync \
# retry=60 connectiontimeout=5 timeout=360
</code></pre>
<p>Remove <code>#</code> at the beginning to enable ActiveSync support:</p>
<pre><code>ProxyPass /Microsoft-Server-ActiveSync \
http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync \
retry=60 connectiontimeout=5 timeout=360
</code></pre>
<h3 id="nginx-web-server">Nginx web server</h3>
<p>If you're running Nginx web server, please open file
<code>/etc/nginx/conf.d/default.conf</code>, add some lines in <code>server {}</code> block which
is configured for HTTPS:</p>
<pre><code>server {
listen 443;
...
# Add below lines for SOGo
# SOGo
location ^~ /SOGo {
proxy_pass http://127.0.0.1:20000;
#proxy_redirect http://127.0.0.1:20000/SOGo/ /SOGo;
# forward user's IP address
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header Host $host;
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
#proxy_set_header x-webobjects-remote-host 127.0.0.1;
#proxy_set_header x-webobjects-server-name $server_name;
#proxy_set_header x-webobjects-server-url $scheme://$host;
}
location ^~ /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;
proxy_redirect http://127.0.0.1:20000/Microsoft-Server-ActiveSync /;
}
location ^~ /SOGo/Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;
proxy_redirect http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync /;
}
location /SOGo.woa/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
}
location /SOGo/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
}
location ^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$ {
alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
}
}
</code></pre>
<p><strong>Important note</strong>: You should replace directory <code>/usr/lib/GNUstep/SOGo</code> the
the real directory which contains SOGo files:</p>
<ul>
<li>on RHEL/CentOS: it's <code>/usr/lib/GNUstep/SOGo</code> on x86 platform,
<code>/usr/lib64/GNUstep/SOGo</code> on x86_64 platform.</li>
<li>on Debian/Ubuntu, it's <code>/usr/lib/GNUstep/SOGo</code>.</li>
<li>on OpenBSD, it's `/</li>
</ul>
<h2 id="start-sogo-and-dependent-services">Start SOGo and dependent services</h2>
<pre><code>service sogod start
service httpd restart
service memcached start
</code></pre>
<h2 id="access-sogo">Access SOGo</h2>
<p>Open your favourite web browser, access URL: <code>https://[your_server]/SOGo</code>.</p>
<h2 id="how-to-configure-client-applications">How to configure client applications</h2>
<h3 id="apple-devices">Apple Devices</h3>
<p>URL for calendar service: <code>http://[host]/SOGo/dav/[user]/</code></p>
<h2 id="todo">TODO</h2>
<h2 id="references">References</h2><br /><p style="text-align: center;">If you found something wrong
in this document, please do
<a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.</p><p style="text-align: center; color: grey;">This tutorial is published under a <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">CC BY-ND 3.0</a> license.<!-- Google Analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-3293801-14");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body></html>