How to install Pagekit on CentOS 7 using LEMP

To install Pagekit on CentOS 7 using LEMP

In our previous article, we have seen the installation of Pagekit on CentOS 7. In this article, we will be briefed about the installation procedure of Pagekit on CentOS 7 using LEMP. Pagekit is a free and open source content management system. It is written in PHP and uses MySQL or SQLite database for storing the data. Pagekit provides easy to use drag and drop control panel to manage the pages, menus, and widgets. It has a configurable dashboard which shows all the statistics related to your site at one place. It also provides an in-built blog feature.

Pre- Requisite
LEMP Stack
- Nginx
- Mariadb
- PHP7

To install PHP in the system, run the following commands
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum -y install php71w-fpm php71w-openssl php71w-mysql php71w-cli php71w-mbstring php71w-dom php71w-json php71w-session php71w-ctype php71w-tokenizer php71w-simplexml php71w-pcre php71w-zip php71w-pdo php71w-curl php71w-iconv php71w- xmlphp71w-apc

Installation procedure

To proceed with the installation procedure, download the latest stable version using wget command followed by the download link.

[root@linuxhelp ~]# wget http://pagekit.com/api/download/latest -O pagekit.zip
--2017-10-25 12:26:55--  http://pagekit.com/api/download/latest
Resolving pagekit.com (pagekit.com)... 213.160.72.26, 2a00:17d8:100::191
Connecting to pagekit.com (pagekit.com)|213.160.72.26|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://pagekit.com/api/download/latest [following]
--2017-10-25 12:26:56--  https://pagekit.com/api/download/latest
Connecting to pagekit.com (pagekit.com)|213.160.72.26|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github.com/pagekit/pagekit/releases/download/1.0.13/pagekit-1.0.13.zip [following]
--2017-10-25 12:26:56--  https://github.com/pagekit/pagekit/releases/download/1.0.13/pagekit-1.0.13.zip
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://github-production-release-asset-2e65be.s3.amazonaws.com/17486281/3132d080-8e6a-11e7-87d2-0185b3cd5f83?X-Amz-Algorithm=AWS4-HMAC-SHA256& X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20171025%2Fus-east-1%2Fs3%2Faws4_request& X-Amz-Date=20171025T065734Z& X-Amz-Expires=300& X-Amz-Signature=3d499dcfc005b8cbbb33c5445300d0b1ec43579d21a78f51dfa5c99eef33bb8b& X-Amz-SignedHeaders=host& actor_id=0& response-content-disposition=attachment%3B%20filename%3Dpagekit-1.0.13.zip& response-content-type=application%2Foctet-stream [following]
--2017-10-25 12:26:57--  https://github-production-release-asset-2e65be.s3.amazonaws.com/17486281/3132d080-8e6a-11e7-87d2-0185b3cd5f83?X-Amz-Algorithm=AWS4-HMAC-SHA256& X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20171025%2Fus-east-1%2Fs3%2Faws4_request& X-Amz-Date=20171025T065734Z& X-Amz-Expires=300& X-Amz-Signature=3d499dcfc005b8cbbb33c5445300d0b1ec43579d21a78f51dfa5c99eef33bb8b& X-Amz-SignedHeaders=host& actor_id=0& response-content-disposition=attachment%3B%20filename%3Dpagekit-1.0.13.zip& response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 54.231.81.136
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|54.231.81.136|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8308716 (7.9M) [application/octet-stream]
Saving to: ‘ pagekit.zip’ 

100%[======================================> ] 8,308,716    332KB/s   in 21s    

2017-10-25 12:27:19 (391 KB/s) - ‘ pagekit.zip’  saved [8308716/8308716]

Extract the downloaded package in Nginx document root using unzip command.

[root@linuxhelp ~]# unzip pagekit.zip &ndash d /usr/share/nginx/html
inflating: /usr/share/nginx/html/pagekit/app/assets/vue-form/src/validate.js  
  inflating: /usr/share/nginx/html/pagekit/app/assets/vue-form/src/validator.js  
  inflating: /usr/share/nginx/html/pagekit/app/assets/vue-form/src/validators.js  
  inflating: /usr/share/nginx/html/pagekit/app/assets/vue-form/yarn.lock  
  inflating: /usr/share/nginx/html/pagekit/app/assets/vue-intl/bower.json  
  inflating: /usr/share/nginx/html/pagekit/app/assets/vue-intl/build.js  
  inflating: /usr/share/nginx/html/pagekit/app/assets/vue-intl/build.locales.js  
  inflating: /usr/share/nginx/html/pagekit/app/assets/vue-intl/dist/locales/aa-dj.json  
.
.
.
extracting: /usr/share/nginx/html/pagekit/.bowerrc  
  inflating: /usr/share/nginx/html/pagekit/.htaccess  
   creating: /usr/share/nginx/html/pagekit/tmp/
   creating: /usr/share/nginx/html/pagekit/tmp/cache/
   creating: /usr/share/nginx/html/pagekit/tmp/temp/
   creating: /usr/share/nginx/html/pagekit/tmp/logs/
   creating: /usr/share/nginx/html/pagekit/tmp/sessions/
   creating: /usr/share/nginx/html/pagekit/tmp/packages/

Move to the Nginx document root by executing the cd command and list the files in the directory.

[root@linuxhelp ~]# cd /usr/share/nginx/html/
[root@linuxhelp html]# ll
total 24
-rw-r--r-- 1 root root 3650 Sep 18 14:48 404.html
-rw-r--r-- 1 root root 3693 Sep 18 14:48 50x.html
-rw-r--r-- 1 root root 3700 Sep 18 14:48 index.html
-rw-r--r-- 1 root root  368 Sep 18 14:48 nginx-logo.png
drwxr-xr-x 6 root root 4096 Oct 25 12:52 pagekit
-rw-r--r-- 1 root root 2811 Sep 18 14:48 poweredby.png

Now configure the php-fpm by opening the configuration file named www.conf and modify the changes in the file. Save and exit the file.

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

listen =  /run/php-fpm/php-fpm.sock
listen.owner = nginx
listen.group = nginx

user = nginx
group = nginx

Restart the php-fpm service.

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

Configure the Virtual host file named pagekit.conf and enter the following content in the file. Save and exit the file.

[root@linuxhelp html]# vim /etc/nginx/conf.d/pagekit.conf
server {
    listen  80 
  server_name www.linuxhelp1.com 

    location / {
        root  /usr/share/nginx/html 
        index  index.html index.htm index.php 
    }

    error_page  500 502 503 504  /50x.html 
    location = /50x.html {
        root  /usr/share/nginx/html 
    }
location ~ \.php {
    fastcgi_index index.php 
    fastcgi_split_path_info ^(.+\.php)(.*)$ 
    include /etc/nginx/fastcgi_params 
    fastcgi_pass unix:/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

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

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

Switch over to the browser and enter the URL as http://yourdomain. The installation page of Pagekit appears on the screen.

Choose the required language and click NEXT.

Create a new database by entering the following details.

Create a new site by entering the following details as shown below and click INSTALL option.

The installation is complete and now the login page of the Pagekit appears on the screen.

Enter the login page of Pagekit and click LOGIN.

The dashboard of the Pagekit appears on the screen.

Thus the installation procedure of Pagekit on CentOS 7 using LEMP.

FAQ
Q
Where is my configuration file in .deb and .rpm?
A
People using the Debian or RPM packages to integrated pagekite.py into their operating system (so it starts up on boot) can find the system-wide configuration in the folder /etc/pagekite.d/.

Note that the configuration in this case is broken up into multiple files, each ending in .rc (files with other endings are ignored).
Q
Where is my configuration file?
A
The location of your configuration file depends on your operating system and how you are using PageKite:
On any unix-based system (including the Mac and all Linux distributions), your configuration file will be created in your home directory and named .pagekite.rc (note the leading dot).
Q
Why can't I type my password? (Windows)
A
The pagekite.py signup process requests a password using Python's standard getpass() routine.
Q
How does it work?
A
PageKite creates a connection between your localhost server and the public Internet. Your local server gets a public name (something.pagekite.me) which anyone can connect to using a normal web browser.
Q
Is there any alternatives available ?
A
joomla, blogger, Grav, drupal