Status
This page is heavily outdated. For a more or less useful documentation refer to the Owncloud administrators manual for other webservers.
Introduction
Over the last few months I tested Owncloud so that I could move my calendars away from Google. I also want to have my contacts in sync across my devices (phone, notebook). So, this blog post is about syncing calendars (with CalDAV) and contacts (with CardDAV) between Thunderbird and my Android phone using Owncloud on Nginx.
Nginx
Just install the standard Arch Linux package from [community]. There is no need to patch Nginx with additional WebDAV modules or anything like that. Just take a look at the configuration below.
Owncloud requires a few PHP extensions, make sure you have them installed and configured as well. Take a look at the Arch Wiki for more information on setting up Nginx and PHP.
Owncloud
Get the latest tarball from Owncloud and extract it in your webroot. Here is the Nginx configuration I use:
# owncloud
server {
listen 80;
server_name owncloud.example.org;
rewrite ^ https://$server_name$request_uri? permanent; # enforce https
}
# owncloud (ssl/tls)
server {
listen 443 ssl;
server_name owncloud.example.org;
ssl_certificate /etc/nginx/certs/server.crt;
ssl_certificate_key /etc/nginx/certs/server.key;
root /srv/http/owncloud;
index index.php;
client_max_body_size 20M; # set maximum upload size
# deny direct access
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
# default try order
location / {
try_files $uri $uri/ @webdav;
}
# owncloud WebDAV
location @webdav {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi_params;
}
# enable php
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi_params;
}
}
Finish setup by creating your Owncloud admin account.
Thunderbird
To get CalDAV/CardDAV support for Thunderbird and Lightning respectively, use the SOGo Connector for Thunderbird.
Here is the CardDAV URL for your address book:
https://owncloud.example.org/apps/contacts/carddav.php/addressbooks/USERNAME/ADDRESSBOOKNAME/
Here is the CalDAV URL for your calendar (1 URL for each calendar):
https://owncloud.example.org/apps/calendar/caldav.php/calendars/USERNAME/CALENDARNAME/
Android
Marten Gajda has written sync clients for CalDAV (CalDAV-Sync) and CardDAV (CardDAV-Sync). Either use the free version from Android Play Shop (Market) or buy the paid version containing additional features. You can find the documentation for Owncloud in the dmfswiki. You could also use aCal but I haven’t tried it.
In short, use this URL for your address book (without https://
):
owncloud.example.org/apps/contacts/carddav.php/addressbooks/
Below is the URL for your calendars. If everything works as expected, you should be prompted with a list of available calendars:
owncloud.example.org/owncloud/apps/calendar/caldav.php/calendars/
Feedback? Contact me!