How to install Chyrp lite

Chyrp Lite is a blog and website generator, written in PHP. It can be installed on your server, and it's very easy to create blog pages, without having to write in html or CSS. It also has management features, and you can create users and groups, or even have signup available. It can also generate RSS feeds and sitemap files. The blog posts are easy to write in markdown, and Chyrp has a number of themes and addons to choose from to enhance the experience.

How to install and configure Chyrp

We'll install it on debian 11/12 (bullseye/bookworm)

For root privileges:

sudo su

To update the system and packages:

apt update; apt upgrade -y

We need to install a database like mariadb. The version of mariadb in the debian stable repos is quite old, so we'll add the mariadb repo. We can go to the mariadb website to generate the repo easily:

https://mariadb.org/download/?t=repo-config

On my server, I used the mirror in Japan:

sudo apt-get install apt-transport-https curl wget

sudo curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc 'https://mariadb.org/mariadb_release_signing_key.asc'

nano /etc/apt/sources.list.d/mariadb.list

We modify the mariadb.list file, and add the following:

# MariaDB 10.11 repository list - created date

# https://mariadb.org/download/

deb https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.11/debian bookworm main

# deb-src https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.11 debian bookworm main

If you have a debian 11 (bullseye) system, replace the bookworm with bullseye.

sudo mysql_secure_installation We add a good password, and leave the rest on default.

Now, we create the chyrp database: mysql -uroot -p

CREATE DATABASE chyrpdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE USER chyrpusuario@localhost identified by 'put a password here'; GRANT ALL PRIVILEGES on chyrpdb.* to chyrpusuario@localhost; FLUSH privileges; quit;

Obviously, we replace 'put a password here' with a good password.

Now, we install the PHP packages. Like mariadb, the versions in the Debian stable repos are a bit old, so we'll add the official PHP repository.

echo "deb [arch=amd64] https://packages.sury.org/php/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/php.list

wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -

apt update; apt install mariadb-server apache2 php8.2 libapache2-mod-security2 libapache2-mod-php8.2 php8.2-mbstring php8.2-mysql php8.2-gd php8.2-mcrypt php8.2-mysql php8.2-cli php8.2-curl php8.2-xml --no-install-recommends

We'll use apache2 as the webserver. Although i prefer nginx, the apache configuration is simply much easier. Well, now we can download the chyrp archive zip:

cd /var/www

wget https://github.com/xenocrat/chyrp-lite/archive/refs/tags/v2024.02.tar.gz

If it's not the newest version, you can go here to download the newest.

tar -xvf v2024.02.tar.gz

mv chyrp-* chyrp

chown -R www-data:www-data chyrp

Now we configure apache:

a2enmod rewrite headers env dir mime

nano /etc/apache2/apache2.conf

Here we find ... and change AllowOverride from 'none' to 'all'. This is so that the page URL is more legible.

We're almost done. If we use systemd, we start the services:

systemctl enable --now apache2 mariadb php8.2-fpm

If you use another init system, start the services as you would normally.

Now in a web browser we go to http://(machine's IP)/install.php

and put the database information that we created, and create an admin account.

If everything works well, we can remove the installation program as it's not necessary anymore:

rm /var/www/chyrp/install.php

I recommend putting https on the website using a2enmod ssl, but on my system i have an nginx reverse proxy on another machine, and the two communicate over a wireguard tunnel.