# Baïkal
## Structure
```
.
├── apache
| ├── baikal (83)
| └── webdav
└── mariadb
```
[https://sabre.io/baikal/install/](https://sabre.io/baikal/install/ "https://sabre.io/baikal/install/")
## mariadb
`mysql -u root -p (transatlantique)`
```
CREATE DATABASE baikal;
CREATE USER "admin"@"localhost" IDENTIFIED BY "BymQt5Z9yaL5hE";
GRANT ALL PRIVILEGES ON baikal.* TO "admin"@"localhost";
FLUSH PRIVILEGES;
EXIT;
```
| database | user | password | host |
|---|
| baikal | admin | BymQt5Z9yaL5hE | localhost |
## Installation
```
cd /var/www/baikal/
wget https://github.com/sabre-io/Baikal/releases/download/0.9.4/baikal-0.9.4.zip
unzip baikal-0.9.4.zip
cd baikal
chown -R www-data:www-data Specific config
```
## apache
> add virtualhost to /etc/apache2/sites-available/delmar.bzh.conf
```conf
DavLockDB /usr/local/apache/var/DavLock
ServerAdmin admin@delmar.bzh
DocumentRoot /var/www/baikal/html
ServerName dav.delmar.bzh
RewriteEngine on
RewriteRule /.well-known/carddav /dav.php [R=308,L]
RewriteRule /.well-known/caldav /dav.php [R=308,L]
Options None
# If you install cloning git repository, you may need the following
# Options +FollowSymlinks
AllowOverride None
# Configuration for apache-2.4:
Require all granted
# Configuration for apache-2.2:
# Order allow,deny
# Allow from all
ExpiresActive Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
```
#### Run installer :
> [https://dav.delmar.bzh](https://dav.delmar.bzh "https://dav.delmar.bzh")
## WebDAV
```
sudo a2enmod dav
sudo a2enmod dav_fs
sudo systemctl restart apache2.service
sudo mkdir /var/www/webdav
sudo chown www-data:www-data /var/www/webdav
sudo mkdir -p /usr/local/apache/var/
sudo chown www-data:www-data /usr/local/apache/var
sudo touch /usr/local/apache/var/users.password
sudo chown www-data:www-data /usr/local/apache/var/users.password
```
#### Users
```bash
sudo htpasswd /usr/local/apache/var/users.password julien SnEnfQVzqs8K9A
```
`sudo vim /etc/apache2/sites-available/delmar.bzh.conf`
```
ServerAdmin admin@delmar.bzh
DocumentRoot /var/www/baikal/html
ServerName dav.delmar.bzh
RewriteEngine on
RewriteRule /.well-known/carddav /dav.php [R=308,L]
RewriteRule /.well-known/caldav /dav.php [R=308,L]
Options None
# If you install cloning git repository, you may need the following
# Options +FollowSymlinks
AllowOverride None
# Configuration for apache-2.4:
Require all granted
# Configuration for apache-2.2:
# Order allow,deny
# Allow from all
Alias /webdav /var/www/webdav
DAV On
AuthType Basic
AuthName "webdav"
AuthUserFile /usr/local/apache/var/users.password
Require user admin
Options Indexes
AllowOverride none
Order allow,deny
allow from all
DAV On
AuthType Basic
AuthName "webdav"
AuthUserFile /usr/local/apache/var/users.password
Require valid-user
Options Indexes
AllowOverride none
Order allow,deny
allow from all
DAV on
AuthType Basic
AuthName "webdav"
AuthUserFile /usr/local/apache/var/users.password
Require user julien
Options Indexes
AllowOverride none
Order allow,deny
allow from all
DAV on
AuthType Basic
AuthName "webdav"
AuthUserFile /usr/local/apache/var/users.password
Require user eliot
ExpiresActive Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
```
```
sudo a2enmod auth_digest
sudo systemctl restart apache2.service
sudo vim /var/www/webdav/webdav-testfile.txt
sudo chown www-data:www-data /var/www/webdav/webdav-testfile.txt
```