Install Flarum on OpenBSD

Guide to setup Flarum on OpenBSD 6.5.

Instructions (WIP!)

Instructions: https://flarum.org/docs/install.html#installing

Install dependencies: curl, dom, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip

pkg_add curl
pkg_add php-7.3 
pkg_add php-curl php-gd php-pdo_mysql php-zip

Link dependencies to init file

ln -sf /etc/php-7.3.sample/curl.ini /etc/php-7.3/
...

Start fast cgi for php

doas rcctl enable httpd php73_fpm
doas rcctl start httpd

Setup nginx

server {
    listen          9000;
    server_name     flarum.lounge.se;

    root            /var/www/pages/rails/flarum;

    access_log  /var/www/pages/rails/flarum/access.log;
    error_log   /var/www/pages/rails/flarum/error.log;

    index index.html index.htm index.php;

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

#   location ~ \.php$ {
#     fastcgi_split_path_info ^(.+\.php)(/.+)$;
#     fastcgi_pass unix:/var/run/php7.2-fpm-wordpress-site.sock;
#     fastcgi_index index.php;
#     include fastcgi.conf;
#  }
}

Setup database.

For MySQL 8.

CREATE DATABASE flarum;
CREATE USER flarumadmin@localhost IDENTIFIED BY 'password';
GRANT ALL ON flarum.* to flarumadmin@localhost WITH GRANT OPTION;

NOT DONE YET !!

References