How to install FlatPress CMS on CentOS 7 using Nginx and PHP

To install FlatPress CMS on CentOS 7 using Nginx and PHP

FlatPress is an open source, multi-lingual extensible blogging engine which does not require a DBMS to work on. It stores all of its content on text files. It also contains features like support of various plugins, widget support and customizable themes. Backing up the FlatPress CMS is very easy, only one directory contains all the tables required for it. This tutorial explains the installation procedure of FlatPress CMS on CentOS 7 using Nginx and PHP.


Pre-Requisites
- Nginx
- PHP > 5.3.1 along with dependencies (php56w mod_php56w php56w-cli php56w-common php56w-gd php56w-mbstring php56w-mcrypt php56w-mysqlnd php56w-xml php56w-imap php56w-curl php56w-gd php56w-fpm)

Installation procedure

To proceed with the installation procedure, download the FlatPress CMS package from its official site using wget command followed by the download link.

[root@linuxhelp ~]# wget -c https://github.com/evacchi/flatpress/archive/v1.0.3.tar.gz
--2017-09-26 10:27:03--  https://github.com/evacchi/flatpress/archive/v1.0.3.tar.gz
Resolving github.com (github.com)... 192.30.255.112, 192.30.255.113
Connecting to github.com (github.com)|192.30.255.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/evacchi/flatpress/tar.gz/v1.0.3 [following]
--2017-09-26 10:27:04--  https://codeload.github.com/evacchi/flatpress/tar.gz/v1.0.3
Resolving codeload.github.com (codeload.github.com)... 192.30.255.121, 192.30.255.120
Connecting to codeload.github.com (codeload.github.com)|192.30.255.121|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 726464 (709K) [application/x-gzip]
Saving to: ‘ v1.0.3.tar.gz’ 

100%[======================================> ] 726,464      209KB/s   in 3.4s  

Extract the downloaded package using tar command.

[root@linuxhelp ~]# tar -xvf v1.0.3.tar.gz 
flatpress-1.0.3/
flatpress-1.0.3/CHANGELOG
flatpress-1.0.3/COPYING
flatpress-1.0.3/LICENSE
flatpress-1.0.3/README
flatpress-1.0.3/README.md
flatpress-1.0.3/TESTING
flatpress-1.0.3/admin.php
flatpress-1.0.3/admin/
flatpress-1.0.3/admin/admin-inline.tpl

.
.
.
.
flatpress-1.0.3/setup/tpls/
flatpress-1.0.3/setup/tpls/footer.tpl.php
flatpress-1.0.3/setup/tpls/header.tpl.php
flatpress-1.0.3/setup/tpls/locked.tpl.php
flatpress-1.0.3/setup/tpls/step1.tpl.php
flatpress-1.0.3/setup/tpls/step2.tpl.php
flatpress-1.0.3/setup/tpls/step3.tpl.php
flatpress-1.0.3/static.php

Move the extracted FlatPress directory in to Nginx root directory and list the files in the directory.

[root@linuxhelp ~]# mv flatpress-1.0.3/ /usr/share/nginx/html/
[root@linuxhelp ~]# cd /usr/share/nginx/html/
[root@linuxhelp html]# ll
total 24
-rw-r--r--  1 root root 3650 Oct 31  2016 404.html
-rw-r--r--  1 root root 3693 Oct 31  2016 50x.html
drwxrwxr-x 10 root root 4096 Jun 12  2015 flatpress-1.0.3
-rw-r--r--  1 root root 3700 Oct 31  2016 index.html
-rw-r--r--  1 root root  368 Oct 31  2016 nginx-logo.png
-rw-r--r--  1 root root 2811 Oct 31  2016 poweredby.png

Open the php-fpm configuration file using vim editor and edit the following changes in the file. Save and exit the file.

[root@linuxhelp ~]# vim /etc/php-fpm.d/www.conf

listen = /var/run/php-fpm/php-fpm.sock

listen.owner = nginx
listen.group = nginx

user = nginx
group = nginx

Restart the php-fpm service.

[root@linuxhelp ~]# systemctl restart php-fpm

Provide the owner permission and file execution permission by executing the following command.

[root@linuxhelp html]# chown -R nginx:nginx /usr/share/nginx/html/flatpress/
[root@linuxhelp html]# chmod -R 777 /usr/share/nginx/html/flatpress-1.0.3/

Open the Nginx configuration file using vim editor and enter the following content in the file. Save and exit the file.

[root@linuxhelp ~]# vim /etc/nginx/nginx.conf

    server {
        listen       80 default_server 
        listen       [::]:80 default_server 
        server_name   192.168.7.165 
        root         /usr/share/nginx/html 
        index           index.html index.php
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf 

        location ~ \.php {
    fastcgi_index index.php 
    fastcgi_split_path_info ^(.+\.php)(.*)$ 
    include /etc/nginx/fastcgi_params 
    fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name 
}
        }

Restart the Nginx service.

[root@linuxhelp html]# systemctl restart nginx

Switch over to your browser and enter http://192.168.7.165/flatpress URL. The FlatPress installation page appears on the screen.


Enter the required details to create a new user. Click next.

The installation is now complete. Click login now option to login to Flatpress.

Enter the required admin credentials and click login.

Select the back to index option.

The home page of FlatPress CMS appears on the screen.

The dashboard of FlatPress CMS is now shown to the user.


The installation procedure of FlatPress CMS on CentOS 7 using Nginx and PHP is done without any glitches.

FAQ
Q
What are the main terms of using the Flatpress CMS?
A
FlatPress is an open source, multi-lingual extensible blogging engine which does not require a DBMS to work on. It stores all of its content on text files. It also contains features like support of various plugins, widget support, customizable themes.
Q
How to download the Flatpress CMS?
A
For download the Flatpress CMS, use the following link as given below, "http://flatpress.org/home/?page=download"
Q
How to install the FlatPress CMS with on nginx?
A
For the installation of the Flatpress CMS with on Nginx, use the followinf link as given below "https://www.linuxhelp.com/how-to-install-flatpress-cms-on-centos-7-using-nginx-and-php/".
Q
What are the alternative tools available for the Flatpress CMS?
A
The following alternative tools available for the Flatpress CMS as,

Wordpress,

Drupal,

Ghost,

Joomla
Q
How to install prerequirement for the Flatpress CMS on Ubuntu?
A
For the installation of the prerequirement for the Flatpress CMS on Ubuntu, use the following command as given below, "apt-get install apache2 php5 php-pear php5-suhosin bzip2"