2012-11-09 12:26:10 +11:00
# INSTALLING Baïkal
This document is a part of the Baïkal project. Baïkal is an open
source lightweight CalDAV and CardDAV server released under the GNU GPL. Baïkal
2014-11-26 11:03:40 +01:00
is copyright (c) 2013-2014 Net Gusto.
2012-11-09 12:26:10 +11:00
2012-12-21 14:58:09 +01:00
Baïkal homepage is http://baikal-server.com
2012-11-09 12:26:10 +11:00
This document describes the system requirements for Baïkal and the
installation routine.
# 1 - System requirements
2014-11-26 11:03:40 +01:00
Baïkal is based on PHP 5.3.1+, and uses a SQLite3 or MySQL 5.5+ with PHP PDO. This
2012-11-09 12:26:10 +11:00
document does not cover the installation of these requirements.
## 1.1 - System requirements for FTP-driven hosting
The following configuration is the minimum required:
2014-11-26 11:03:40 +01:00
- an hosted webserver running apache 2 and PHP 5.3.1+
2012-11-09 12:26:10 +11:00
2014-11-26 11:05:21 +01:00
- SQLite3 or MySQL 5.5+
2013-07-07 16:49:37 +02:00
- PHP 5.3.1 or newer with the following extensions:
2012-11-09 12:26:10 +11:00
- PDO and SQLite3 or MySQL
2013-07-07 16:49:37 +02:00
- DOM (php-xml)
2012-11-09 12:26:10 +11:00
Some extensions can be optionally compiled into PHP. A list of loaded
extensions can be checked using the phpinfo() function.
- 30 MB of disk space
## 1.2 - System requirements for dedicated server hosting
The following configuration is the minimum required:
2014-01-11 01:20:40 +01:00
- an Apache2 web server capable of running PHP, and accessible through a
2012-11-09 12:26:10 +11:00
dedicated subdomain (something like "dav.mydomainname.com")
NOTE: this document only covers sub-domain based installations. Other
installations modes are possible, though not documented (yet).
- root access to a command line on this server
NOTE: tools to create and manage users are command line only. Web-based
interfaces will be produced in the future.
2013-07-07 16:49:37 +02:00
- PHP 5.3.1 or newer with the following extensions:
2012-11-09 12:26:10 +11:00
- PDO and SQLite3 or MySQL
2013-07-07 16:49:37 +02:00
- DOM (php-xml)
2012-11-09 12:26:10 +11:00
Some extensions can be optionally compiled into PHP. A list of loaded
extensions can be checked using the phpinfo() function.
2014-11-26 11:05:21 +01:00
- SQLite3 or MySQL 5.5+
2012-11-09 12:26:10 +11:00
- 30 MB of disk space
# 2 - Obtaining Baïkal
To get Baïkal, navigate to the following location:
2012-12-21 14:58:09 +01:00
http://baikal-server.com
2012-11-09 12:26:10 +11:00
# 3 - Installation
## 3.1 - Installing Baïkal on a FTP-driven hosting
To install Baïkal on a FTP-driven hosting:
* Download the "Baikal Flat package for FTP"
* Unzip the package on you computer
* Send the unzipped package on the remote host via FTP
* (optional) Rename the Baïkal folder to whatever you want
* Navigate to the HTTP URL where you just uploaded Baïkal
* Follow the instructions of the initialization web tool
## 3.2 - Installing Baïkal on a dedicated host
2013-03-21 22:49:58 +01:00
### 3.2.1 Using the Baïkal "regular package"
2012-11-09 12:26:10 +11:00
2013-03-21 22:49:58 +01:00
#### 3.2.1.1 - Unpacking files
To install Baïkal on a dedicated host, download the "Regular package".
2012-11-09 12:26:10 +11:00
Unpack the source package outside of the web site root
directory on your server. The location must be accessible to the web server.
Usually, it will be something like /var/www/
2014-02-02 12:43:04 +01:00
```sh
# a. Enter the directory where the websites are stored
$ root:~> cd /var/www
```
2012-11-09 12:26:10 +11:00
Unpacking will produce a directory with a name like baikal-x.y.z, where x.y.z
correspond to the Baïkal version. For example, the Baïkal 0.2.0 source package
will create a directory named baikal-0.2.0
2014-02-02 12:43:04 +01:00
```sh
# b. Unpack the package using:
$ root:/var/www> tar xzf baikal-0.2.0.tgz
```
2012-11-09 12:26:10 +11:00
Rename the untar'd directory to the name of your baikal dedicated subdomain.
2014-02-02 12:43:04 +01:00
```sh
# c. Rename the directory to match your domain (good practice)
$ root:/var/www> mv baikal-0.2.0 dav.mydomain.com
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# d. Enter the new Baïkal directory
$ root:/var/www> cd dav.mydomain.com
```
2012-11-09 12:26:10 +11:00
In order to grant Apache access to the files of your Baïkal installation,
you'll have to grant the user running the apache process r+w permissions on
the Baïkal files. In our example, we will suppose the linux username/usergroup
running Apache is www-data:www-data
2014-02-02 12:43:04 +01:00
```sh
# e. Change permissions on the files
$ root:/var/www/dav.mydomain.com> chown www-data:www-data Specific -Rf
```
2012-11-09 12:26:10 +11:00
2013-03-21 22:49:58 +01:00
#### 3.2.1.2 - Setting up a Web Server
2012-11-09 12:26:10 +11:00
Baikal must be bound to a domain/subdomain in order to run properly.
This package provides default virtualhost configuration files for Apache 2 and for nginx in
Specific/virtualhosts/
To enable your host to run Baikal, you'll have to add the Baikal virtualhost
to your Web Server environment.
2013-03-21 22:49:58 +01:00
##### Setting up the Apache virtualhost
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
In our example, we will assume that the apache2 configuration directory is: `/etc/apache2`
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
```sh
# a. Enter the Apache2 configuration directory
$ root:/var/www> cd /etc/apache2
# b. Enter the sites-available directory
$ root:/etc/apache2> cd sites-available
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# c. Symlink the Baikal virtualhost file to this directory
$ root:/etc/apache2/sites-available> ln -s /var/www/dav.mydomain.com/Specific/virtualhosts/baikal.apache2
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# d. Customize the virtualhost config file
$ root:/etc/apache2/sites-available> nano baikal.apache2
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# e. In baikal.apache2, replace references to dav.mydomain.com with your own domain name
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# f. Activate the new virtualhost
$ root:/etc/apache2/sites-available> cd ../sites-enabled
$ root:/etc/apache2/sites-enabled> ln -s ../sites-available/baikal.apache2
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# h. Restart apache
$ root:/etc/apache2/sites-enabled> /etc/init.d/apache2 restart
```
2012-11-09 12:26:10 +11:00
2013-03-21 22:49:58 +01:00
##### Setting up the nginx virtualhost
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
In our example, we will assume that the nginx configuration directory is: `/etc/nginx`
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
```sh
# a. Enter the nginx configuration directory
$ root:/var/www> cd /etc/nginx
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# b. Enter the sites-available directory
$ root:/etc/nginx> cd sites-available
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# c. Symlink the Baikal virtualhost file to this directory
$ root:/etc/nginx/sites-available> ln -s /var/www/dav.mydomain.com/Specific/virtualhosts/baikal.nginx
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# d. Customize the virtualhost config file
$ root:/etc/nginx/sites-available> nano baikal.nginx
2012-11-09 12:26:10 +11:00
2015-09-22 10:48:29 +02:00
# e. In baikal.nginx, replace references to dav.mydomain.com with your own domain name.
# It may be possible that you have to modify the value of the fastcgi_pass directive too.
# Please consult your server's documentation if you receive a 404 error.
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# f. Activate the new virtualhost
$ root:/etc/nginx/sites-available> cd ../sites-enabled
$ root:/etc/nginx/sites-enabled> ln -s ../sites-available/baikal.nginx
2012-11-09 12:26:10 +11:00
2014-02-02 12:43:04 +01:00
# h. Restart nginx
$ root:/etc/nginx/sites-enabled> /etc/init.d/nginx restart
```
2013-07-07 16:49:37 +02:00
2013-03-21 22:49:58 +01:00
#### 3.2.1.3 - Setting up Baïkal
2012-11-09 12:26:10 +11:00
2015-09-22 10:48:29 +02:00
To enable the installation tool you have to create a temporary file.
```sh
# Replace with your actual document root
$ root: cd /var/www/dav.mydomain.com touch Specific/ENABLE_INSTALL
```
2012-11-09 12:26:10 +11:00
In a web browser, navigate to http://dav.mydomain.com and follow the instructions of the initialization web tool
2014-01-11 01:20:40 +01:00
### 3.2.2 Using Baïkal "Bleeding-edge" version for developers (requires git and composer)
2013-03-21 22:49:58 +01:00
Baïkal "Bleeding-edge" is using composer to install its dependencies. Please check that you have git and composer installed on your system before going any further.
2014-02-02 12:43:04 +01:00
```sh
# a. Checkout the Baïkal source code
$ root:/var/www> git clone https://github.com/jeromeschneider/Baikal.git dav.mydomain.com
2013-03-21 22:49:58 +01:00
2014-02-02 12:43:04 +01:00
# b. Enter the new dav.mydomain.com directory
$ root:/var/www> cd dav.mydomain.com
```
2013-03-21 22:49:58 +01:00
In order to grant Apache access to the files of your Baïkal installation,
2014-02-02 12:43:04 +01:00
you'll have to grant the user running the apache process `r+w` permissions on
2013-03-21 22:49:58 +01:00
the Baïkal files. In our example, we will suppose the linux username/usergroup
2014-02-02 12:43:04 +01:00
running Apache is `www-data:www-data`
2013-03-21 22:49:58 +01:00
2014-02-02 12:43:04 +01:00
```sh
# c. Install Baïkal dependencies using composer
$ root:/var/www/dav.mydomain.com> composer install
2013-03-21 22:49:58 +01:00
2014-02-02 12:43:04 +01:00
# d. Change permissions on the files
$ root:/var/www/dav.mydomain.com> chown www-data:www-data . -Rf
```
2013-03-21 22:49:58 +01:00
2014-01-11 01:20:40 +01:00
You now have to declare Baïkal in your webserver. You may follow instructions in ** "3.2.1.2 - Setting up a Web Server"** above to do so.
2013-03-21 22:49:58 +01:00
2012-11-09 12:26:10 +11:00
# 4 - Accessing the Baïkal Web Admin
Navigate to http://dav.mydomain.com/admin/
# 5 - Connecting your CalDAV / CardDAV client to Baïkal
2014-01-03 11:36:47 +01:00
## 5.1 - Apple Calendar (OS X):
Note: Calendar is called iCal on older OS X versions.
2012-11-09 12:26:10 +11:00
Add a new CalDAV account:
2014-01-03 11:36:47 +01:00
* In Preferences... > Accounts click the `+` button
* Follow the wizard:
* Account Type: CalDAV
* User Name: the username you just created (in our example, jerome)
* Password: the password you just defined
* Server Address: http://dav.mydomain.com/cal.php/principals/jerome (replace domain and username)
* Change the account description if you want
2012-11-09 12:26:10 +11:00
## 5.2 - Apple Calendar (iOS):
2013-10-21 20:37:09 +02:00
Add a new CalDAV account:
2012-11-09 12:26:10 +11:00
2014-01-03 11:36:47 +01:00
* In Settings > Mail, Contacts, Calendar > Add Account > Other
* Tap Add CalDAV Account under CALENDARS
* Configure your account:
* Server: http://dav.mydomain.com/cal.php/principals/jerome (replace domain and username)
* User Name: the username you just created (in our example, jerome)
* Password: the password you just defined
* Description: optional, whatever you want
* Tap Next
## 5.3 - Apple Contacts (OS X):
2012-11-09 12:26:10 +11:00
2014-01-03 11:36:47 +01:00
Note: Contacts is called Address Book on older OS X versions.
2012-11-09 12:26:10 +11:00
Add a new CardDAV account:
2014-01-03 11:36:47 +01:00
* In Preferences... > Accounts click the `+` button
* Follow the wizard:
* Account Type: CardDAV
* User name: the username you just created (in our example, jerome)
* Password: the password you just defined
* Server address: http://dav.mydomain.com/card.php/addressbooks/jerome/default (replace domain and username)
* Change the account description if you want
2012-11-09 12:26:10 +11:00
## 5.4 - Apple Contacts (iOS):
Add a new CardDAV account:
2014-01-03 11:36:47 +01:00
* in Settings > Mail, Contacts, Calendar > Add Account > Other
* Tap Add CardDAV Account under CONTACTS
* Configure your account:
* Server: dav.mydomain.com/card.php (note: no http:// nor https://, and no trailing slash)
* User Name: the username you just created (in our example, jerome)
* Password: the password you just defined
* Description: optional, whatever you want
* Tap Next
It can take a little while as iOS seems to look for a secure connection first. It will show a popup when it doesn't find any certificates. Accept this when you are **not** using Baikal over SSL.
2012-11-09 12:26:10 +11:00
2013-11-29 09:21:37 +01:00
## 5.5 - Thunderbird/SOGo connector:
2013-10-21 20:37:09 +02:00
Add a new CardDAV account:
2013-11-29 09:21:37 +01:00
* Install "SOGo Connector Thunderbird extension" (http://sogo.nu/downloads/frontends.html)
* Navigate to "Address book" > "New" > "Remote address book"
* paste this URL: http://dav.mydomain.com/card.php/addressbooks/username/default/ of and replace the domain name, and the username with the correct values
* When asked, provide user/password; your CardDAV account should be up and running
* **Important notes**: some users reported that, for SOGo to work, you have to host your baikal on a **https** line, and keep usernames simple (no '@' in the username or any non ascii-alphanumeric char)
2013-10-21 20:37:09 +02:00
2013-10-21 20:37:44 +02:00
## 5.6 - Thunderbird/Lightning:
2012-11-09 12:26:10 +11:00
Add a new CalDAV account:
2013-11-29 09:21:37 +01:00
* Navigate to "Lightning" > "New account" > "On the network" > "URL"
* paste this URL: http://dav.mydomain.com/cal.php/calendars/username/default of and replace the domain name, and the username with the correct values
* When asked, provide user/password; your CalDAV account should be up and running
2014-11-26 11:38:00 +01:00
* Note: if you need to get access to multiple Baikal accounts on the same server, you need to change the multirealm settings in Thunderbirds about:config. Go to "Tools" => "Options" => "Advanced" => "Config Editor". Search for "calendar.network.multirealm" and change the default (false) to "true". Delete all passwords and restart Thunderbird. Now each calendar asks for a user / password.
**Hint**: Thunderbird's password manager can only store one authentication per auth realm. Thus you can't use two calendars with two different credentials. This problem can be solved by adding the credentials to the URL, like `http://username:password@dav.mydomain.com/cal.php/calendars/username/default`
2014-10-16 11:26:56 +02:00
2012-11-09 12:26:10 +11:00
2013-10-29 19:30:30 +01:00
## 5.7 BlackBerry OS10
Add a new CalDAV account:
2014-02-02 12:43:04 +01:00
* in Settings > Accounts > Add Account > Advanced
* Select "CalDAV"
* Username: the username you just created
* Password: the password you just defined
* Server Address: `dav.mydomain.com/cal.php/calendars/username/default` and replace domain and username with the correct values
2013-10-29 19:30:30 +01:00
Add a new CardDAV account:
2014-02-02 12:43:04 +01:00
* in Settings > Accounts > Add Account > Advanced
* Select "CardDAV"
* Username: the username you just created
* Password: the password you just defined
* Email Address: an email address you want this CardDAV account to be assigned to
* Server Address: `dav.mydomain.com/card.php/addressbooks/username/default` and replace domain and username with the correct values
2013-10-29 19:30:30 +01:00
2014-01-03 16:36:43 +01:00
__Important notes:__
2014-01-03 16:37:51 +01:00
* Make sure you've configured Baikal to use `basic` as authentication mechanism.
* Its required to use SSL for CardDAV!
2013-10-29 19:30:30 +01:00
2014-11-28 14:25:25 +01:00
## 5.8 Windows Phone 8.1 (Developer Preview)
Add a new CalDAV/CardDAV account:
* in Settings > email+accounts > Add an Account > iCloud
* Username: the username you just created
* Password: the password you just defined
* Select Advanced Settings
* Contacts server (CardDAV): `dav.mydomain.com/card.php/addressbooks/username/default` and replace domain and username with the correct values
* Calendar server (CalDAV): `dav.mydomain.com/cal.php/calendars/username/default` and replace domain and username with the correct values
* You can optional activate/deactivate content that will be synced
2014-11-28 14:38:04 +01:00
## 5.9 Android (4.1.2) SG2
Add a new CalDAV account:
2014-11-28 14:58:21 +01:00
* Download a DAV Sync Client (i.e. DAVdroid; if DAVdroid, see 5.10 below also)
2014-11-28 14:38:04 +01:00
* Add a new DAVdroid account
* I.e. enter the following URL-Format for CalDAV: `http://dav.mydomain.com/cal.php/calendars/<username>/default/ or http://YOUR_IP/cal.php/calendars/<username>/default/`
* Use your email-address as account name
* Mark your calendar as active on your device: In the Calendar-App select Settings/Calendar and activate it.
* Sync it
Add a new CardDAV account:
* Add a new DAVdroid account
* I.e. enter the following URL-Format for CalDAV: `http://dav.mydomain.com/card.php/addressbooks/<username>/default/ or http://YOUR_IP/card.php/addressbooks/<username>/default/`
* Use your email-address as account name
* In the Phone-App select Contacts/Accounts select the 2nd DAVdroid and Synchronize Contacts.
* Sync it
__Note__
* If you want to synchronize your current contacts to the server export it to USB and Import it again as DAVdroid contacts
* Sync it
2014-11-28 14:25:25 +01:00
2014-11-28 14:58:21 +01:00
## 5.10 DAVdroid (Android)
Android does not support CardDAV or CalDAV out of the box so you'll need a 3rd party client. There are multiple options available. Here we'll have a look at [DAVdroid ](http://davdroid.bitfire.at/ ), an open-source CalDAV/CardDAV synchronization app for Android 4+. The app is available on [many different stores ](http://davdroid.bitfire.at/download ), and even on the FOSS [F-Droid ](https://f-droid.org/repository/browse/?fdfilter=carddav&fdid=at.bitfire.davdroid ) one. Install the app from your favourite store.
Add a CalDAV account:
* In Settings > Accounts > Add account
* Tap DAVdroid
* Follow the wizard
* Select `http://` or `https://` and add the path to your CalDAV server: `dav.mydomain.com/cal.php/principals/jerome` (replace domain and username)
* User name: the username you just created (in our example, jerome)
* Password: the password you just defined
* Leave the preemptive authentication `checked`
* Tap `→`
* Select the calendar(s) you want to sync
* Tap `→`
* Choose a unique account name (has to be different from the CardDAV one)
* Tap `✓`
DAVdroid should now start syncing your calendar(s), give it some time.
Add a CardDAV account:
* In Settings > Accounts > Add account
* Tap DAVdroid
* Follow the wizard
* Select `http://` or `https://` and add the path to your CardDAV server: `dav.mydomain.com/card.php/addressbooks/jerome/default` (replace domain and username)
* User name: the username you just created (in our example, jerome)
* Password: the password you just defined
* Leave the preemptive authentication `checked`
* Tap `→`
* Select the address book you want to sync
* Tap `→`
* Choose a unique account name (has to be different from the CalDAV one)
* Tap `✓`
DAVdroid should now start syncing your address book, give it some time.
2012-11-09 12:26:10 +11:00
# 6 - You're done
2013-07-07 16:49:37 +02:00
You may now create new calendars, new events, new contact (: Enjoy.
2012-11-09 12:26:10 +11:00
# 7 - Troubleshooting
2013-03-21 22:49:58 +01:00
Please read TROUBLESHOOTING.md in this folder.
2013-11-04 09:16:06 +01:00
# 8 - User contributed quick & dirty install guides
2014-02-02 12:14:00 +01:00
## Ubuntu 12.04 - James Lay & Frederic Hemberger
2013-11-04 09:16:06 +01:00
2014-02-02 12:14:00 +01:00
```sh
cd /var/www
sudo chown -R www-data:www-data baikal
mysql -u root -p #password #
```
2013-11-04 09:16:06 +01:00
2014-02-02 12:14:00 +01:00
```mysql
CREATE DATABASE baikal;
2014-12-07 01:16:06 +01:00
GRANT DELETE, INSERT, SELECT, UPDATE, CREATE ON baikal.* TO 'baikal'@'localhost' IDENTIFIED BY '#password #';
2014-02-02 12:14:00 +01:00
exit
```
2013-11-04 09:16:06 +01:00
2014-02-02 12:14:00 +01:00
```sh
mysql -u root -p #password # -D baikal < /var/www/baikal/Core/Resources/Db/MySQL/db.sql
sudo touch /var/www/baikal/Specfic/ENABLE_INSTALL
sudo chown www-data /var/www/baikal/Specific/ENABLE_INSTALL
sudo vi /etc/apache2/sites-available/baikal
```
2013-11-04 09:16:06 +01:00
```plain
< VirtualHost * :80 >
ServerName baikal
DocumentRoot /var/www/baikal
ErrorLog /var/logsbaikal.error_log
TransferLog /var/log/baikal.access_log
LogLevel warn
< Directory " / var / www / baikal " >
Order allow,deny
Allow from all
< / Directory >
< / VirtualHost >
```
2014-02-02 12:14:00 +01:00
```sh
sudo ln -s /etc/apache2/sites-available/baikal /etc/apache2/sites-enabled
sudo service apache2 restart
```
2013-11-04 09:16:06 +01:00
2014-02-02 12:43:04 +01:00
Point your browser to http://hostname/baikal and there you go.