Linux Tutorials & Things letsencrypt

How to generate a Free SSL cert using Lets encrypt [nginx]

STEP1

Clone letsencrypt git repo;

git clone https://github.com/letsencrypt/letsencrypt

cd letsencrypt

sudo ./letsencrypt-auto --help  

Ensure your webserver is not running
For my case - Nginx

sudo service nginx stop

STEP2

Run the script - Change the YOUR_DOMAIN.COM to your own domain before running. Also make sure to include the www. subdomain for one of the entries as shown;

./letsencrypt-auto certonly --standalone --standalone-supported-challenges http-01 -d www.YOUR_DOMAIN.com,YOUR_DOMAIN.com --renew-by-default

If successfull the Cert files will be stored in the following directory;

sudo ls /etc/letsencrypt/live/www.DOMAINNAME.com

Check if files have been created


FIX PERMISIONS

sudo chown root:www-data /etc/letsencrypt/live /etc/letsencrypt/archive/
sudo chmod 750 /etc/letsencrypt/live/ /etc/letsencrypt/archive/

How to Install Baikal CalDav/CardDav Server on Debian [nginx]

This tutorial assumes you have configured NGINX and php as explained Here.

What is Baikal?

Baïkal offers ubiquitous and synchronized access to your calendars and address books over CalDAV and CardDAV. Baïkal implements the current IETF recommendation drafts of these industry standards for centralized calendar and address book collections.1

Baikal Admin Page

STEP1

Generate SSL Cert for new subdomain:
If you followed my Letsencrypt guide simply run;
Substitute YOURDOMAIN for the domain you will be using.

cd ~/letsencrypt/
sudo ./letsencrypt-auto certonly --standalone --standalone-supported-challenges http-01 -d dav.YOURDOMAIN --renew-by-default

STEP2

Install Dependencies;

sudo apt-get install sqlite3 sqlite php5-sqlite

STEP3

Configure Nginx Virtual-hosts file

sudo nano /etc/nginx/sites-available/dav.YOURDOMAINNAME

Check out my example file here

Link Virtual-hosts files;

sudo ln -s /etc/nginx/sites-available/dav.YOURDOMAINNAME /etc/nginx/sites-enabled/dav.YOURNOMAINNAME

STEP4

Make Dir and generate new dhparam (for improved SSL/TLS Security);

sudo mkdir /et/nginx/ssl/dav.YOURDOMAIN

sudo openssl dhparam -out /etc/nginx/ssl/dav.YOURDOMAIN/dhparam.pem 2048

Test Nginx Config for errors;

sudo service nginx configtest

STEP5

Make Directory ready for installing Baikal files;

sudo mkdir /var/www/dav.YOURDOMAIN

cd /var/www/dav.YOURDOMAIN

Download latest Baikal regular package;

sudo wget http://baikal-server.com/get/baikal-regular-0.2.7.tgz

sudo tar -xvzf baikal-regular-0.2.7.tgz

sudo mv baikal-regular/* .

sudo rm -rf baikal-regular

STEP6

Restart Nginx;

sudo service nginx restart

Navigate to https://dav.YOURDOMAIN/admin and complete setup;


Errors

Official Troubleshooting Document

If 403 permission errors;

    sudo chmod -R 770 /var/www/dav.YOURDOMAIN
    sudo chown www-data:www-data /var/www/dav.YOURDOMAIN -Rf