• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Thursday, May 22, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

Setup Grav CMS On Ubuntu 14

How VPS by How VPS
January 1, 2020
in Linux
0
0
SHARES
19
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Introduction
    1. Installation
    2. Configure Server for Grav
    3. Update your local machine’s host file (Optional)
    4. Install Grav
  2. Want to contribute?


Introduction

Grav is a modern flat file CMS that is fast, extensible and open-source. It’s easy to use and has a host of impressive plugins, one of which is an admin for it.

Installation

Spin up a Ubuntu 14 Vultr instance and run below commands to install some essential utilities, PHP 7, and Nginx. Note: You can put this portion in a startup script and spin up your using it to make the process faster.

export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -y
sudo apt-get upgrade -y

# install some essential tools
sudo apt-get install -y acl curl git software-properties-common unzip zip

# install php7
sudo apt-add-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install -y --force-yes php7.0-cli php-curl php-gd php7.0-zip php7.0-mcrypt php-apcu php-xml php-mbstring php-intl

# install nginx
sudo apt-get install -y --force-yes nginx
sudo apt-get install -y --force-yes php7.0-fpm

# tweak php ini file
sudo sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/cli/php.ini
sudo sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini

# remove default site setup and restart nginx
rm -f /etc/nginx/sites-enabled/*
rm -f /etc/nginx/sites-available/*
service nginx restart

Configure Server for Grav

SSH into your server as root from your terminal.

ssh root@[vultr-instance-ip]

Note: Ideally you will want to secure ssh as prescribed in vultr.com/docs/securing-ssh-on-ubuntu-14-04 on a public facing site

Create a directory to hold grav site

# create directory
mkdir -p /sites/grav && cd /sites/grav

# set permissions
chmod -R 775 /sites
chown -R www-data:www-data /sites
chmod -R g+s /sites

# put temporary index file
echo "<h3>Welcome Home...</h3>" >> index.php
echo "<?php phpinfo();" >> index.php

Setup a nginx host to for the site:

  1. cd into nginx sites available directory cd /etc/nginx/sites-available/
  2. Create a config file for grav site sudo nano grav
  3. Paste below content into file, then save and exit (Ctrl+X -> Y -> hit Enter)

    server {
        listen 80;
        server_name vultr.dev; #NOTE: vultr.dev should be replaced with your domain name eventually
        root /sites/grav;
    
        index index.html index.htm index.php;
        charset utf-8;
    
        location / {
            try_files $uri $uri/ /index.php$is_args$args;
        }
    
        location ~ /.php$ {
            fastcgi_split_path_info ^(.+/.php)(/.+)$;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    
            fastcgi_index index.php;
            include fastcgi_params;
        }
    }
    
  4. Enable grav config

    sudo ln -s /etc/nginx/sites-available/grav /etc/nginx/sites-enabled/grav
    
  5. Restart nginx and php-fpm

    sudo service nginx restart
    sudo service php7.0-fpm restart
    
  6. Update servers host file sudo bash -c "echo '127.0.0.1 vultr.dev' >> /etc/hosts" _(Note: vultr.dev should be replaced with your domain name eventually)

  7. You should be able to browse to http://[vultr-instance-ip] and see a “Welcome Home” message along with some info on the version of PHP installed (if you don’t see this or are using vultr.dev as used above, you’ll have to perform additional step below to add a host entry for vultr.dev on your local machine)

Update your local machine’s host file (Optional)

Add below entry to your host file.

[vultr-instace-ip]     vultr.dev

Your host file should be located in one of the listed areas below depending on what OS you are running.

  • Windows – c:/windows/system32/drivers/etc/hosts
  • Linux – /etc/hosts
  • Mac – /private/etc/hosts

Install Grav

  1. Install composer and create a grav project.

    # install composer
    sudo curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
    
    # create grav project
    cd /sites
    mv grav grav-test
    composer create-project getgrav/grav
    
    # below is only needed if you logged as sudo
    # ideally you should secure ssh as prescribed in vultr.com/docs/securing-ssh-on-ubuntu-14-04
    chown -R www-data:www-data /sites
    
  2. Browse to http://vultr.dev (or your domain) and you should be greeted with a welcome page that says “Grav is Running!”.

Written by Lami Adabonyan

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Disabling SSLv3

Next Post

How to Install ResourceSpace on Ubuntu 16.10

Next Post

How to Install ResourceSpace on Ubuntu 16.10

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet