{"id":1865,"date":"2014-08-22T06:37:47","date_gmt":"2014-08-22T04:37:47","guid":{"rendered":"http:\/\/possiblelossofprecision.net\/?p=1865"},"modified":"2021-05-15T11:46:37","modified_gmt":"2021-05-15T09:46:37","slug":"baikal-a-lightweight-caldavcarddav-server","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=1865","title":{"rendered":"Baikal: A lightweight CalDAV\/CardDAV server"},"content":{"rendered":"<p><a href=\"http:\/\/baikal-server.com\/\">Baikal<\/a> is a lightweight, free and open-source CalDAV and CardDAV server implementation that allows you to synchronize your address book and appointments with multiple clients such as mobile devices or a desktop application like <a href=\"https:\/\/www.mozilla.org\/en-US\/thunderbird\/\">Thunderbird<\/a>. It lacks a couple of important features for enterprise use cases, such as address book and calendar sharing between multiple users, but it&#8217;s very suitable for a small office or home installations. Since it&#8217;s very lightweight and only depending on php and mysql, it&#8217;s also quite fast and stable.<\/p>\n<p><!--more--><\/p>\n<h2>0. Prerequisites<\/h2>\n<p>Both <a href=\"http:\/\/www.mysql.com\/\">MySQL<\/a> and <a href=\"http:\/\/www.sqlite.org\/\">SQLite<\/a> can be used as database backends for Baikal. For simplicity, I&#8217;ll use SQLite in this example. The only other software you&#8217;ll need is a webserver with php support, e.g. apache or nginx:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# yum install httpd php php-pdo php-sabre-dav\r\n<\/pre>\n<h2>1. Getting Baikal<\/h2>\n<p>Unfortunately, there&#8217;s currently no prepackaged rpm package available for Baikal, so you&#8217;ll have to download it manually. There are three different versions available: The <a href=\"http:\/\/baikal-server.com\/get\/baikal-flat-0.2.7.zip\">flat package<\/a> (suitable for hosts you only have ftp access to), the <a href=\"http:\/\/baikal-server.com\/get\/baikal-regular-0.2.7.tgz\">regular package<\/a> and <a href=\"http:\/\/github.com\/jeromeschneider\/Baikal\">bleeding-edge<\/a> (which will point you to the git repository). The best fit for servers that you have full access to is probably the <strong>regular package<\/strong>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ wget http:\/\/baikal-server.com\/get\/baikal-regular-0.2.7.tgz\r\n<\/pre>\n<h2>2. Installing Baikal<\/h2>\n<p>After <strong>extracting the tarball<\/strong> to <code>\/var\/www\/html\/<\/code> (i.e. the apache document root), <strong>fixing the access rights<\/strong> and <strong>enabling\/starting the webserver<\/strong>, point your browser to <code>http:\/\/server\/baikal-regular\/html\/<\/code> to start the installation<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# cd \/var\/www\/html\/\r\n# tar xvfz &lt;path-to-tarball&gt;\/baikal-regular-0.2.7.tgz\r\n&#x5B;...]\r\n# chown -R apache:apache \/var\/www\/html\/baikal-regular\/\r\n# systemctl enable httpd.service\r\n# systemctl start httpd.service\r\n<\/pre>\n<p>You should see a page similar to this:<\/p>\n<div id=\"attachment_1878\" style=\"width: 564px\" class=\"wp-caption aligncenter\"><a data-rokbox data-rokbox-album=\"p1865\" data-rokbox-caption=\"The &#039;Baikal Install Tool&#039; is locked per default\" href=\"wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1878\" src=\"wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall1.png\" alt=\"The &#039;Baikal Install Tool&#039; is locked per default\" width=\"554\" height=\"443\" class=\"size-full wp-image-1878\" srcset=\"https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall1.png 554w, https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall1-550x439.png 550w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/a><p id=\"caption-attachment-1878\" class=\"wp-caption-text\">The &#8216;Baikal Install Tool&#8217; is locked per default<\/p><\/div>\n<h2>3. Running the initialization wizard<\/h2>\n<p>After creating the <code>ENABLE_INSTALL<\/code> file and <strong>refreshing your browser<\/strong>,<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# touch \/var\/www\/html\/baikal-regular\/Specific\/ENABLE_INSTALL\r\n<\/pre>\n<p>you should see the Baikal initialization wizard:<\/p>\n<div id=\"attachment_1880\" style=\"width: 374px\" class=\"wp-caption aligncenter\"><a data-rokbox data-rokbox-album=\"p1865\" data-rokbox-caption=\"The &#039;Baikal Installation wizard&#039; guides you through the setup\" href=\"wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1880\" src=\"wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall2-364x550.png\" alt=\"The &#039;Baikal Installation wizard&#039; guides you through the setup\" width=\"364\" height=\"550\" class=\"size-medium wp-image-1880\" srcset=\"https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall2-364x550.png 364w, https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall2.png 594w\" sizes=\"auto, (max-width: 364px) 100vw, 364px\" \/><\/a><p id=\"caption-attachment-1880\" class=\"wp-caption-text\">The &#8216;Baikal Installation wizard&#8217; guides you through the setup<\/p><\/div>\n<p>Follow the instructions on the screen:<\/p>\n<div id=\"attachment_1881\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a data-rokbox data-rokbox-album=\"p1865\" data-rokbox-caption=\"Baikal can use a SQLite or a MySQL database backend\" href=\"wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1881\" src=\"wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall3-550x464.png\" alt=\"Baikal can use a SQLite or a MySQL database backend\" width=\"550\" height=\"464\" class=\"size-medium wp-image-1881\" srcset=\"https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall3-550x464.png 550w, https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall3.png 725w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-1881\" class=\"wp-caption-text\">Baikal can use a SQLite or a MySQL database backend<\/p><\/div>\n<div id=\"attachment_1882\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a data-rokbox data-rokbox-album=\"p1865\" data-rokbox-caption=\"After setting up the database, Baikal is ready to use\" href=\"wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1882\" src=\"wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall4-550x464.png\" alt=\"After setting up the database, Baikal is ready to use\" width=\"550\" height=\"464\" class=\"size-medium wp-image-1882\" srcset=\"https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall4-550x464.png 550w, https:\/\/possiblelossofprecision.net\/wordpress\/wp-content\/uploads\/2014\/08\/BaikalInstall4.png 725w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-1882\" class=\"wp-caption-text\">After setting up the database, Baikal is ready to use<\/p><\/div>\n<h2>4. Configuring your client<\/h2>\n<p>Baikal is now up and running. You can use the web-interface to create users, additional calendars and address books etc. CalDAV\/CardDAV will be reachable through:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nhttp:\/\/&lt;baikal-server&gt;\/baikal-regular\/html\/cal.php\/calendars\/&lt;username&gt;\/default\/\r\n<\/pre>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nhttp:\/\/&lt;baikal-server&gt;\/baikal-regular\/html\/baikal\/card.php\/addressbooks\/&lt;username&gt;\/default\/\r\n<\/pre>\n<h2>5. Optional: Setting up a vhost<\/h2>\n<p>You might want to reach your CalDAV\/CardDAV service through a subdomain, like <code>dav.mydomain.com<\/code>. This is usually done with vhosts and Baikal conveniently already comes with a proper vhost file for apache as well as nginx.<br \/>\nIt&#8217;s good practise to keep the files that belong to a specific subdomain in a folder with the same name. So let&#8217;s rename the <code>baikal-regular<\/code> directory to match our vhost:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# mv \/var\/www\/html\/baikal-regular \/var\/www\/dav.mydomain.com\r\n<\/pre>\n<p>We can then use the supplied vhost configuration file:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# cp -a \/var\/www\/dav.mydomain.com\/Specific\/virtualhosts\/baikal.apache2 \\\r\n\/etc\/httpd\/conf.d\/dav.mydomain.com.conf\r\n<\/pre>\n<pre class=\"brush: plain; title: \/etc\/httpd\/conf.d\/dav.mydomain.com.conf; notranslate\" title=\"\/etc\/httpd\/conf.d\/dav.mydomain.com.conf\">\r\n&lt;VirtualHost *:80&gt;\r\n\r\n        DocumentRoot \/var\/www\/dav.mydomain.com\/html\r\n        ServerName dav.mydomain.com\r\n        \r\n        RewriteEngine On\r\n        RewriteRule \/.well-known\/carddav \/card.php &#x5B;R,L]\r\n        RewriteRule \/.well-known\/caldav \/cal.php &#x5B;R,L]\r\n\r\n        &lt;Directory &quot;\/var\/www\/dav.mydomain.com\/html&quot;&gt;\r\n                Options None\r\n                Options +FollowSymlinks\r\n                AllowOverride All\r\n        &lt;\/Directory&gt;\r\n\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>After <strong>restarting the webserver<\/strong> your CalDAV\/CardDAV server will be available through<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nhttp:\/\/dav.mydomain.com\/cal.php\/calendars\/&lt;username&gt;\/default\/\r\n<\/pre>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nhttp:\/\/dav.mydomain.com\/card.php\/calendars\/&lt;username&gt;\/default\/\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Baikal is a lightweight, free and open-source CalDAV and CardDAV server implementation that allows you to synchronize your address book and appointments with multiple clients such as mobile devices or a desktop application like Thunderbird. It lacks a couple of important features for enterprise use cases, such as address book and calendar sharing between multiple users, but it&#8217;s very suitable&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=1865\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7],"class_list":["post-1865","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-fedora"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1865"}],"version-history":[{"count":41,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1865\/revisions"}],"predecessor-version":[{"id":2188,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1865\/revisions\/2188"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}