Learn How To Install Bludit CMS on Ubuntu 18.04 LTS

May 1, 2019

Table of Contents

If you are using a different system, please check our other tutorials.

Bludit is a simple, fast and flexible blogging CMS written in PHP. Bludit uses files in JSON format to store content, so you don’t need to install or configure a database. Bludit source code is hosted on Github. This guide will show you how to install Bludit CMS on a fresh Ubuntu 18.04 LTS IT Web Services instance.

Requirements

  • PHP version 5.3 or greater with the following extensions:
    • mbstring
    • gd
    • dom
    • json
  • A web server with PHP support like Nginx, Apache, Lighttpd or H2O. This guide will use Nginx.

Before you begin

Check the Ubuntu version.

lsb_release -ds
# Ubuntu 18.04 LTS

Create a new non-root user account with sudo access and switch to it.

adduser johndoe --gecos "John Doe"
usermod -aG sudo johndoe
su - johndoe

NOTE: Replace johndoe with your username.

Set up the timezone.

sudo dpkg-reconfigure tzdata

Ensure that your system is up to date.

sudo apt update && sudo apt upgrade -y

Install the unzip package.

sudo apt install -y unzip

Install PHP

Install PHP and required PHP extensions.

sudo apt install -y php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-gd php7.2-xml php7.2-json

Check the version.

php --version
# PHP 7.2.7-0ubuntu0.18.04.2 (cli) (built: Jul  4 2018 16:55:24) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
#     with Zend OPcache v7.2.7-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies

Install Nginx

Bludit can work with many web servers with PHP support. In this guide we will use Nginx.

Install Nginx.

sudo apt install -y nginx

Check the version.

sudo nginx -v
# nginx version: nginx/1.14.0 (Ubuntu)

Run sudo vim /etc/nginx/sites-available/bludit.conf and configure Nginx for Bludit.

server {
  listen 80;
  server_name example.com;
  root /var/www/bludit;
  index index.php;
  location ~ .php$ {
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
  }
  location / {
    try_files $uri $uri/ /index.php?$args;
  }
  location ^~ /bl-content/tmp/ { deny all; } 
  location ^~ /bl-content/pages/ { deny all; } 
  location ^~ /bl-content/databases/ { deny all; } 
}

Activate the new bludit.conf configuration by linking the file to the sites-enabled directory.

sudo ln -s /etc/nginx/sites-available/bludit.conf /etc/nginx/sites-enabled/

Test the configuration.

sudo nginx -t

Reload Nginx.

sudo systemctl reload nginx.service

Install Bludit

Create a document root directory.

sudo mkdir -p /var/www/bludit

Change ownership of the /var/www/bludit directory to johndoe.

sudo chown -R johndoe:johndoe /var/www/bludit

Download the latest version from the official page and extract the zip file..

cd /var/www/bludit
wget https://bludit.s3.nl-ams.scw.cloud/bludit-3-5-0.zip
unzip bludit-3-5-0.zip
rm bludit-3-5-0.zip
mv bludit-3-5-0/* . && mv bludit-3-5-0/.* .
rmdir bludit-3-5-0

Change ownership of the /var/www/bludit directory to www-data.

sudo chown -R www-data:www-data /var/www/bludit

Open your site in a web browser. The Bludit installer page will appear.

Follow the Bludit installer to configure your website. To access the Bludit admin area, append /admin to your site URL.

Need help?

Do you need help setting up this on your own service?
Please contact us and we’ll provide you the best possible quote!