Ubuntu 22.04 setup chyrp lite environment and more

You must have known that I just migrated this blog site to a VPS hosted on oracle cloud, while this wiki page is too brief to get a workable environment easily.

Here is the note for this migration.

  1. sudo -i
  2. Install packages that chyrp will need
    apt install php8.1 php8.1-xml php8.1-fpm php8.1-mysql php8.1-mbstring mysql-server nginx certbot python3-certbot-nginx
  1. Set a password for 'root'@'localhost' account on this new mysql server
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_password';
    FLUSH PRIVILEGES;
  1. Run mysql_secure_installation to
  • Remove anonymous users
  • Disallow root login remotely
  • Remove test database and access to it
  1. Create a common user for the blog database, and the blog database
    CREATE USER 'blog'@'localhost' IDENTIFIED BY 'superdifficultpassword';
    GRANT ALL PRIVILEGES ON blog.* To 'blog'@'localhost' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    CREATE DATABASE `blog` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
  1. Put .my.cnf with the following content in home directory
[client]
user=blog
password=yoursuperdifficultpassword
host=localhost
  1. Restore the database backup
    mysql blog < blog_20230408-030501.sql
  1. Setup nginx and https certificate with certbot
  2. Setup renew the certificate by crontab
SHELL=/usr/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15 0 * * * /usr/bin/certbot --nginx renew > /dev/null
  1. Restore previous installation, overwrite with the latest version, do the upgrade, that's it!

This site just moved to Oracle Cloud and upgrated to the latest chyrp-lite version (2023.01)

If you found anything unusal or incorrect, please press Ctrl+Shift+R to reload the page first. If you still found something wrong, please leave a comment here or contact me at telegram https://t.me/shukebeta

Many thanks

Why did I decide to move/upgrade?

Previously, this site is hosted at my home, on an old dell laptop (4G ram/250G hdd). In general, it works great. However, sometimes, housewife displug this laptop and forget to plug it back. It didn't happen often but it happened several times. Two days ago, we went camping and my wife turned off the whole wiring board to avoid some danger in her mind!

As wife is always right, I decided to move this site to one of the free VM on oracle cloud. And, it is done today! By the way, I upgraded this site to a most recent release. Hope you guys love it.

Tailscale on Ubuntu put too many logs into /var/log/syslog

answer:

  1. Edit the file /etc/systemd/system/multi-user.target.wants/tailscaled.service,
  2. Add the line "LogLevelMax=3" in the [Service] section.
  3. systemctl daemon-reload
  4. systemctl restart tailscaled

Reference

Power shell: Start-Transcript and Stop-Transcript help you log a session.

12 Angry Men (1957)/ 十二怒汉

I watched this movie at Last Friday night. I love it.