How to install Grav on Debian 9

Hello guys, As you can see, I have moved from Wordpress to Grav!!
For those who don't know what is Grav, it is an opensource flat-file CMS (Content Management System), meaning without the need of a database. It has been developped from the start to be as performing as possible.
It is also very flexible and easy to use/maintained.
Written in PHP, it leverages Markdown files to store the content, Grav does not require a database. Everything is stored as simple files. It makes it quite fast to run (Especially on SSD) and easy to back up !! You can see all the features here.
Actually my migration experience was a bit more tricky then expected, but I'm quite happy to be on Grav now. On the main issues I faced, I can mention:
- Only 1 plugin in Wordpress to migrate to Grav called WP2Grav but it cannot keep the comments and the markdown created files required some polishing (I had to use some commands like sed -i... to replace some content)
- As I imported around 200 articles, the related-pages pluging of Grav were significantly slowing down the blog, creating even loading errors (because it needed more than 30s to display the page...)
- I had to tweak some files of my template to do what I wanted. Actually it was not difficult, but since there is little documentation yet, it was not as simple as I thoughts.
But overall I'm satisfied.
Now let's see how to install Grav on your Linux server (Debian in my case. Ubuntu should be similar)
Installation Steps
First you will need to have a working LAMP server. If it is not the case, you can check my recent article on how to install LAMP.
1) Refresh your source list and install the required php dependencies.
sudo apt update
sudo apt install php-curl php-fpm php-gd php-zip php-mbstring php-xml
2) Download the latest version of Grav
Go to the download section of the grav website: https://getgrav.org/downloads and check which version is the latest. I suggest you to download the one with the admin panel version (The 1.3.10 as of today's article). Then run:
cd /var/www/
wget https://getgrav.org/download/core/grav-admin/1.3.10 -O grav.zip
unzip grav.zip
rm grav.zip
3) Assign the correct permissions
sudo chown -R www-data:www-data /var/www/grav-admin
4) Enable required Apache modules
You will need to enable the modules 'rewrite', 'proxy' and 'proxy_fcgi'. You will need also to enable the configuration of pfp-fpm. To do so, simply run:
sudo a2enmod rewrite proxy proxy_fcgi
sudo a2enconf php-fpm
and restart apache.
sudo systemctl restart apache2
5) Create a dedicated virtualhost
I suggest you to run a dedicated virtualhost (for a subdomain, or to better tailor Grav CMS later on). To do this, run:
sudo nano /etc/apache2/sites-available/grav.conf
and copy:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName myurl.com
DocumentRoot /var/www/grav-admin
<Directory /var/www/grav-admin>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/grav_error.log
CustomLog ${APACHE_LOG_DIR}/grav_access.log combined
</VirtualHost>
I let you modify it to fit your needs.
Now enable it and reload apache:
sudo a2ensite grav
sudo systemctl restart apache2
If no issue, you should now have access to your Grav CMS using the configured URL.
The first connection will ask you to create the admin account.
Once done, you will be good to go!
We may want to enable a HTTPS connection using a SSL certificate. I have a dedicated article on how to setup SSL certificate using Let's Encrypt. Pretty easy.
I also suggest you to read the official documentation to get yourself familiar with Grav's structure.
Happy blogging!
Add a comment
Comments
Written on Mon, 16 Mar 2020 21:40:28 by Nida
Written on Fri, 13 Mar 2020 20:39:51 by Margarita
Written on Wed, 19 Feb 2020 02:25:21 by Brendan
Written on Wed, 05 Feb 2020 03:38:22 by Claude
Written on Wed, 15 Jan 2020 21:35:16 by Winona
Written on Mon, 09 Dec 2019 17:23:35 by Virginia
Written on Sat, 30 Nov 2019 12:50:24 by Kristie
Written on Fri, 29 Nov 2019 06:08:23 by Nicole
Written on Wed, 27 Nov 2019 15:09:19 by Glinda
Written on Mon, 25 Nov 2019 18:06:07 by Linda
Written on Sat, 23 Nov 2019 18:13:04 by Zoila
Written on Thu, 21 Nov 2019 06:05:30 by Sebastian
Written on Mon, 18 Nov 2019 07:30:39 by Fernando
Written on Wed, 13 Nov 2019 12:52:19 by Kristen
Written on Sun, 27 Oct 2019 15:30:46 by Lisa