|
| 1 | +--- |
| 2 | +title: Chyrp Lite |
| 3 | +author: Neel Chauhan |
| 4 | +contributors: |
| 5 | +tested_with: 9.5 |
| 6 | +tags: |
| 7 | + - cms |
| 8 | +--- |
| 9 | + |
| 10 | +# Chyrp Lite |
| 11 | + |
| 12 | +## Introduction |
| 13 | + |
| 14 | +[Chyrp Lite](https://chyrplite.net/) is an ultra-lightweight blogging engine written in PHP. |
| 15 | + |
| 16 | +## Prerequisites and assumptions |
| 17 | + |
| 18 | +The following are minimum requirements for using this procedure: |
| 19 | + |
| 20 | +* The ability to run commands as the root user or use `sudo` to elevate privileges |
| 21 | +* Familiarity with a command-line editor. The author is using `vi` or `vim` here, but substitute in your favorite editor |
| 22 | + |
| 23 | +## Installing Caddy |
| 24 | + |
| 25 | +We will use Caddy as the web server. To install Caddy, you need to first install the EPEL (Extra Packages for Enterprise Linux) and run updates: |
| 26 | + |
| 27 | +```bash |
| 28 | +dnf -y install epel-release && dnf -y update |
| 29 | +``` |
| 30 | + |
| 31 | +Then install Caddy: |
| 32 | + |
| 33 | +```bash |
| 34 | +dnf -y install Caddy |
| 35 | +``` |
| 36 | + |
| 37 | +Subsequently, open the `Caddyfile`: |
| 38 | + |
| 39 | +```bash |
| 40 | +vi /etc/caddy/Caddyfile |
| 41 | +``` |
| 42 | + |
| 43 | +Add the following to your Caddyfile: |
| 44 | + |
| 45 | +```bash |
| 46 | +your.domain.name { |
| 47 | + root * /var/www/chyrp-lite |
| 48 | + file_server |
| 49 | + php_fastcgi 127.0.0.1:9000 |
| 50 | +} |
| 51 | +``` |
| 52 | + |
| 53 | +Save the file with `:wq!` and then open the corresponding firewall ports: |
| 54 | + |
| 55 | +```bash |
| 56 | +sudo firewall-cmd --permanent --zone=public --add-service=http |
| 57 | +sudo firewall-cmd --permanent --zone=public --add-service=https |
| 58 | +sudo firewall-cmd --reload |
| 59 | +``` |
| 60 | + |
| 61 | +Finally, start Caddy: |
| 62 | + |
| 63 | +```bash |
| 64 | +systemctl enable --now caddy |
| 65 | +``` |
| 66 | + |
| 67 | +## Installing PHP |
| 68 | + |
| 69 | +To install PHP, we will need the Remi repository. To install the Remi repository run (note: if you are using Rocky Linux 8.x, substitute in 8 next to `release-` below): |
| 70 | + |
| 71 | +```bash |
| 72 | +dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm |
| 73 | +``` |
| 74 | + |
| 75 | +Then install PHP and the required modules: |
| 76 | + |
| 77 | +```bash |
| 78 | +dnf install -y php83-php php83-php-session php83-php-json php83-php-ctype php83-php-filter php83-php-libxml php83-php-simplexml php83-php-mbstring php83-php-pdo php83-php-curl |
| 79 | +``` |
| 80 | + |
| 81 | +Next, open the PHP configuration file: |
| 82 | + |
| 83 | +```bash |
| 84 | +vi /etc/opt/remi/php83/php-fpm.d/www.conf |
| 85 | +``` |
| 86 | + |
| 87 | +Navigate down to the `listen =` line and set it to the following: |
| 88 | + |
| 89 | +```bash |
| 90 | +listen = 127.0.0.1:9000 |
| 91 | +``` |
| 92 | + |
| 93 | +Now exit `vi` with `:wq!` and enable PHP: |
| 94 | + |
| 95 | +```bash |
| 96 | +systemctl enable --now php83-php-fpm.service |
| 97 | +``` |
| 98 | + |
| 99 | +## Installing Chyrp |
| 100 | + |
| 101 | +Now we are going to install Chyrp Lite. To do so, download the latest release: |
| 102 | + |
| 103 | +```bash |
| 104 | +cd /var/www |
| 105 | +wget https://github.com/xenocrat/chyrp-lite/archive/refs/tags/v2024.03.zip |
| 106 | +``` |
| 107 | + |
| 108 | +Next, unzip and move the extracted folder: |
| 109 | + |
| 110 | +```bash |
| 111 | +unzip v2024.03.zip |
| 112 | +mv chyrp-lite-2024.03/ chyrp-lite |
| 113 | +``` |
| 114 | + |
| 115 | +Set the correct permissions on the `chyrp-lite` folder: |
| 116 | + |
| 117 | +```bash |
| 118 | +chown -R apache:apache chyrp-lite/ |
| 119 | +``` |
| 120 | + |
| 121 | +Set up a data directory for storing the SQLite database: |
| 122 | + |
| 123 | +```bash |
| 124 | +mkdir chyrp-lite-data |
| 125 | +chown -R apache:apache chyrp-lite-data/ |
| 126 | +``` |
| 127 | + |
| 128 | +Next set up the SELinux file contexts: |
| 129 | + |
| 130 | +```bash |
| 131 | +semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/chyrp-lite(/.*)?" |
| 132 | +semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/chyrp-lite-data(/.*)?" |
| 133 | +restorecon -Rv /var/www/chyrp-lite |
| 134 | +restorecon -Rv /var/www/chyrp-lite-data |
| 135 | +``` |
| 136 | + |
| 137 | +Now on a client machine, open up a web browser to `https://your.domain.name/install.php` and run the installer (replace `your.domain.name` with your actual domain name or hostname): |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | +In the **Database** section, select a pathname in the `chyrp-lite-data` directory made above, such as `/var/www/chyrp-lite-data/sqlite.db`. |
| 142 | + |
| 143 | +Then fill in the other fields, which should be self-explanatory. |
| 144 | + |
| 145 | +Next click **Install me** and then **Take me to my site**. Your Chyrp site should be installed and visitable: |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | +## Conclusion |
| 150 | + |
| 151 | +Considering that WordPress has evolved into a swiss army knife of web development, it's not surprising some webmasters (the author included) would prefer a lightweight blogging engine. Chyrp Lite is perfect in for those users. |
0 commit comments