SOGo: backend on Debian, Web frontend on NetBSD

Learn more about SOGo here.

Quickly sumed up, SOGo is a kind of middleware that will provide Web, CalDAV and CardDAV access to you e-mail and web clients. You can check my NetBSD and OpenBSD articles to see how to build the backend Mail/Directory/SQL services. Once this is done, you can plug SOGo on to this architecture and provide E-Mail, Calendar, AddressBook to your users via mobile phones and mail clients.

I’ll describe here how to setup the sogod backend onto Debian GNU/Linux and the Web frontend onto NetBSD.

Install SOGo on Debian GNU/Linux

I installed Debian Lenny 5.0 on a Xen domU.

Then setup APT and install the SOGo package:

# vi /etc/apt/sources.list
(…)
deb http://inverse.ca/debian lenny lenny
(…)
# apt-get update
# apt-get install sogo

Configure the MySQL root password in the installation process.
I’m using an external MySQL instance so I disabled mysqld on the Debian machine:

# /etc/init.d/mysql stop
Stopping MySQL database server: mysqld.
# for FIC in `find /etc/rc*.d -name "S*mysql*"`; do mv "$FIC" "`echo $FIC | sed -e 's|/S|/K|'`"; done

Configure SOGo. The configuration file is located at /home/sogo/GNUstep/Defaults/.GNUstepDefaults.

Install OpenSSL:

# apt-get install openssl

Install the CA and configure LDAP for ldaps access:

# install -o root -g root -m 0644 cacert.pem /etc/ssl/certs/ca.tumfatig.net.pem
# vi /etc/ldap/ldap.conf
(…)
TLS_CACERT /etc/ssl/certs/ca.tumfatig.net.pem

Start the SOGo daemon:

# /etc/init.d/sogo start
# tail /var/log/sogo/sogo.log

Publish SOGo using Apache on NetBSD

Use Apache to run Web front-end and forward CardDAV/CalDAV request to sogod.

On the Debian server, create an archive of the Web resources:

# tar czf SOGoWebResources.tar.bz2 /usr/lib/GNUstep/SOGo/WebServerResources /usr/lib/GNUstep/SOGo/*.SOGo

Transfer it to the NetBSD server. Untar the files to create $DocumentRoot/SOGo:

# ls SOGo/
./                        Contacts.SOGo/            MainUI.SOGo/
../                       ContactsUI.SOGo/          PreferencesUI.SOGo/
AdministrationUI.SOGo/    MailPartViewers.SOGo/     SchedulerUI.SOGo/
Appointments.SOGo/        Mailer.SOGo/              WebServerResources/
CommonUI.SOGo/            MailerUI.SOGo/

Modify httpd.conf to publish SOGo:

# vi /usr/pkg/etc/httpd/httpd.conf
(...)
Listen 0.0.0.0:8800
(...)
 # SOGo AJAX-based Web interface
 ProxyRequests Off
 ProxyPreserveHost On

 Alias /SOGo.woa/WebServerResources/ /SOGo/WebServerResources/
 Alias /SOGo/WebServerResources/ /SOGo/WebServerResources/
 AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) 
 /SOGo/$1.SOGo/Resources/$2
 <Directory /SOGo/>
 AllowOverride None
 Order deny,allow
 Allow from all
 </Directory>

 <LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*.(jpg|png|gif|css|js)">
 SetHandler default-handler
 </LocationMatch>

 SetEnv proxy-nokeepalive 1

 ProxyPass /SOGo http://10.0.0.62:20000/SOGo retry=0

 <Proxy http://10.0.0.62:20000/SOGo>
 RequestHeader set "x-webobjects-server-port" "443"
 RequestHeader set "x-webobjects-server-name" "www.tumfatig.net"
 RequestHeader set "x-webobjects-server-url" "https://www.tumfatig.net"
 RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
 RequestHeader set "x-webobjects-remote-host" %{REMOTE_HOST}e env=REMOTE_HOST

 AddDefaultCharset UTF-8

 Order allow,deny
 Allow from all
 </Proxy>

 RewriteEngine On
 RewriteRule ^/SOGo/(.*)$ /SOGo/$1 [env=REMOTE_HOST:%{REMOTE_ADDR},PT]
(...)
<VirtualHost *:8800>
(...)
 ProxyRequests Off
 ProxyPreserveHost On

 ProxyPass /principals http://sogo.tumfatig.net:20000/SOGo/dav/
 ProxyPass /SOGo http://sogo.tumfatig.net:20000/SOGo
 ProxyPass / http://sogo.tumfatig.net:20000/SOGo/dav/

 AddDefaultCharset UTF-8
</VirtualHost>

Reload Apache and enjoy!

Sources

How to install SOGo on Debian ?

1 Comment

  • Marcin (YazzY) Thu, 10 Mar 2011 23:05:47 +0000 Reply

    Awesome, thanks!

Leave a Reply

%d bloggers like this: