The following are the steps I used to install Baikal CalDAV / CardDAV server on Debian 9 stretch using Nginx and MySQL. This setup was for a lab environment.
Install Prerequisites
apt-get install nginx mysql-server php-fpm php-mysql php-sabre-dav git
Start PHP-FPM
service php7.0-fpm start
Set PHP-FPM to always start on boot
systemctl enable php7.0-fpm
Configure Nginx
Backup the default config file
cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.backup
Create a new config file
nano /etc/nginx/sites-available/default
Replace all text with the following
server { listen 80; server_name _; root /var/www/html/baikal/html; index index.php; rewrite ^/.well-known/caldav /dav.php redirect; rewrite ^/.well-known/carddav /dav.php redirect; charset utf-8; location ~ /(\.ht|Core|Specific) { deny all; return 404; } location ~ ^(.+\.php)(.*)$ { try_files $fastcgi_script_name =404; include /etc/nginx/fastcgi_params; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } }
Start nginx
service nginx start
Set nginx to always start on boot
systemctl enable nginx
Creating the MySQL database
Log into MySQL
myqsl -u root -p
Create the Baikal database
create database baikal;
Create a user for the database
create user 'baikaluser'@'localhost' identified by 'baikalPass';
Grant permissions to the database for the created user
grant all on baikal.* to 'baikaluser'@'localhost';
Install Baikal
Clone the repository to the document root
git clone https://github.com/sabre-io/baikal.git /var/www/html
Set permissions for the web user
chown -R www-data:www-data /var/www/html/baikal
Start nginx
service nginx start
Configure Baikal
You can being configuring Baikal at http://YOURSERVER/admin/install/