Running your own instance

This guide will explain how to setup you're own Zer.ooo CA, for a VPN node see here

Installing needed dependencies

The needed dependencies are php, php-openssl, php-zip, composer and openssl (or any varition of it e.g. libressl)

if you're planning to use MySQL or SQLite you may also need te respective php module.

Getting the source

To make it easy to keep your instance up to date, we use the branch release with the current tested and deployablecode, so go to your site folder (for simplicity in this document we will use /sites/zer.ooo) and run the following:

cd /sites/zer.ooo;
git clone https://github.com/EaterOfCode/zer.ooo.git .;
git checkout release;

replace /sites/zer.ooo with your own site folder

Setting up the environment

Now we will need to setup the current environment, this means installing the composer dependecies, and touching the sqlite database

cd /sites/zer.ooo;
./bin/setup_web;

Using a different database then the standard sqlite

On default a sqlite database is used in storage/db.sqlite this may not be what you want but can be easily changed.

Open propel.yml

and replace the default connection with e.g.

default:
    adapter: mysql
    dsn: mysql:host=localhost;dbname=zerooo
    user: 'zerooo'
    password: 'my-super-secret-password'
    settings:
        charset: utf8

After changing propel.yml don't forget to run

cd /sites/zer.ooo;
./vendor/bin/propel config:convert
./vendor/bin/propel sql:build
./vendor/bin/propel sql:insert

this will let zer.ooo connect to the MySQL (or MariaDB) server running on localhost with the database zerooo.

Setting up the webserver

For this example we will use nginx, and your config would look something like this

server {
    listen 80;
    server_name zer.ooo;

    # CRL NEEDS to be available via http without redirect
    location /crl {
        add_header Content-Type text/plain;
        alias /sites/zer.ooo/storage/ca/crl.pem;
    }

    location / {
        return 301 https://$server_name$request_uri;
    }
}

server {
    listen 443 ssl;
    server_name  zer.ooo;
    root         /sites/zer.ooo/public;

    include certs/zer.ooo;

    index index.php index.html;

    location ~ \.php$ {
        fastcgi_pass   unix:/var/run/php-fpm.sock;
        fastcgi_index  index.php;
        include        fastcgi.conf;
    }

    location / {
        try_files $uri $uri/ /index.php?$uri&$args;
    }
}

We aggresively recommend you to use SSL, if you don't have money for a certificate use Let's Encrypt

Finish install

After you've been through this all, you can now visit https://[yourdomain]/install and finish you installation