SOGo: backend on Debian, Web frontend on NetBSD

       416 words, 2 minutes

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 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|'`";        \

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/
# vi /etc/ldap/ldap.conf
TLS_CACERT /etc/ssl/certs/

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 \

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
 # 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/(.*) 
 <Directory /SOGo/>
 AllowOverride None
 Order deny,allow
 Allow from all

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

 SetEnv proxy-nokeepalive 1

 ProxyPass /SOGo retry=0

 RequestHeader set "x-webobjects-server-port" "443"
 RequestHeader set "x-webobjects-server-name" ""
 RequestHeader set "x-webobjects-server-url" ""
 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

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

 ProxyPass /principals
 ProxyPass /SOGo
 ProxyPass /

 AddDefaultCharset UTF-8

Reload Apache and enjoy!


How to install SOGo on Debian ?