PICO CMS How To Install
PICO CMS How To Install
This means
there is no administration backend and database to deal with. You simply create .md
files in the content folder, and that becomes a page. Pico uses the Twig templating
engine for powerful and flexible themes. Pico source code is available on Github.
In this tutorial, we will install Pico CMS with Nginx on Debian 10 (buster) system.
Requirements
Nginx
PHP version 5.3.6 or greater
Composer
Prerequisites
Initial steps
lsb_release -ds
# Debian GNU/Linux 10 (buster)
Update your operating system packages (software). This is an essential first step
because it ensures you have the latest updates and security fixes for your
operating system's default software packages:
Install some essential packages that are necessary for basic administration of the
Debian operating system:
sudo apt install -y curl wget vim git unzip socat bash-completion apt-transport-
https
php -m
ctype
curl
exif
fileinfo
. . .
. . .
Check the PHP version:
php --version
Securing your forum with HTTPS is not necessary, but it is a good practice to
secure your site traffic. To obtain a TLS certificate from Let's Encrypt we will
use acme.sh client. Acme.sh is a pure UNIX shell software for obtaining TLS
certificates from Let's Encrypt with zero dependencies.
sudo su - root
git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --install --accountemail [email protected]
source ~/.bashrc
cd ~
acme.sh --version
# v2.8.0
# RSA 2048
acme.sh --issue --standalone -d example.com --keylength 2048
# ECDSA
acme.sh --issue --standalone -d example.com --keylength ec-256
If you want fake certificates for testing, you can add --staging flag to the above
commands.
After running the above commands, your certificates and keys will be in:
acme.sh --list
mkdir -p /etc/letsecnrypt/example.com
sudo mkdir -p /etc/letsencrypt/example.com_ecc
After obtaining certs exit from root user and return back to regular sudo user:
exit
Install NGINX:
sudo nginx -v
# nginx version: nginx/1.14.2
Next, configure NGINX for Pico CMS. Run sudo vim /etc/nginx/sites-
available/pico.conf and add the following configuration.
server {
listen 80;
listen 443 ssl;
server_name example.com;
root /var/www/pico;
ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/example.com/private.key;
ssl_certificate /etc/letsencrypt/example.com_ecc/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/example.com_ecc/private.key;
index index.php;
location ~ ^/((config|content|vendor|composer\.(json|lock|phar))(/|$)|(.+/)?\.(?!
well-known(/|$))) {
deny all;
}
location / {
index index.php;
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param PICO_URL_REWRITING 1;
}
Activate the new pico.conf configuration by linking the file to the sites-enabled
directory:
sudo nginx -t
php composer-setup.php
php -r "unlink('composer-setup.php');"
composer --version
# Composer version 1.8.6 2019-06-11 15:03:05
Replace [your_username] in the command above with the username of the Linux user
that you are currently logged in.
Then navigate to the document root directory:
cd /var/www/pico
You have successfully installed Pico CMS on Debian 10 (buster) system. You can now
simply create your own content folder in Pico's root directory, create .md files in
the content directory and those files become your pages.