Installing Gila CMS on Nginx

Posted on December 9, 2019

i hope this guide will help you install Gila CMS on a local server with LEMP environment

On Linux Solus I installed Nginx 1.13.7 and MariaDB 10.1.29

my html folder of nginx server was on /usr/share/nginx/html

there I dowloaded tha last version of gila cms (1.5.0)

cd /usr/share/nginx/html
sudo wget "https://github.com/GilaCMS/gila/archive/1.5.0.zip" 
unzip 1.5.0.zip
sudo mv gila-1.5.0 gila

Then should make sure the folder and subfoders are writable from the application or else config.php won't be created in installation process, I prefer to change the owner to my user and later add permissions to access and write to all groups in my pc to subfolders

cd html
sudo chown <user> gila

 

nginx config file lies on /etc/nginx/ so we edit it

sudo gedit /etc/nginx/nginx.conf

I changed the root and location lines as following

        location / {
	    root         /usr/share/nginx/html;
            index index.php index.html index.htm;
   	    rewrite gila/(?!install)(?!src)(?!themes)(?!lib)(?!assets)(?!tmp)(?!robots.txt)(.*)$ /gila/index.php?url=$1 last;
        }

so the server will redirect all calls to gila/index.php file giving the url parameter except some folders and robots.txt

if nginx is running already type on the terminal sudo nginx -s reload to reload the chnges or sudo nginx to start the server.

Before you go to instalation 127.0.0.1/gila/install dont forget to preper your mysql database and the user with all privileges in the scema.

 

a quick quide to prepare the database with terminal:

sudo systemctl start mariadb.service
sudo mysql

create schema gila;
create user 'guser'@'localhost' identified by 'pass';
grant all privileges on gila.* to 'guser'@'localhost';
flush privileges;