This playbook installs NGINX, PHP7 and Grav. It also installs required and recommended PHP modules and tweaks php.ini and NGINX configs based on Grav recommendations. These configs come from what appear in the Grav documentation.
Master branch will install Grav Admin 'Vanilla' single page site. If you would like to experiment with the Gantry 5 Helium Skeleton site, you will need to clone that branch instead. Instructions are below.
The latest versions of Amazon Linux, CentOS, Debian, Fedora and Ubuntu are currently supported, though there are a few inconsistencies in the configuration (specific PHP7 version, inclusion of YAML parser, etc). Check the QA section for an up-to-date distro/host compatibility matrix. If you don't care what distro you run I would recommend Ubuntu 16.04/16.04.2 at this time.
Install Ansible on your host or 'control' machine per the instructions
- macOS:
$ sudo easy_install pip && sudo pip install ansible
Two branches are available:
- Master will install Grav Admin 'Vanilla' single-page site
- Gantry will install Grav Gantry 5 Helium Skeleton site
-
$ cd /your/dev/folder
-
$ git clone https://github.com/andywimmer/ansible-grav.git && cd ansible-grav
-
$ cd /your/dev/folder
-
$ git clone -b gantry https://github.com/andywimmer/ansible-grav.git && cd ansible-grav
[prod]
server-ip domain= ansible_python_interpreter=/usr/bin/python3
-
Change
server-ip
to target IP -
Add FQDN after
domain=
such as:-
domain=yourdomain.com
-
or
-
domain=subdomain.example.xyz
-
do not include the 'www'
-
Note that some targets (like Ubuntu) ship with Python3 only, so the hosts file must contain the parameter ansible_python_interpreter=/usr/bin/python3
[defaults]
inventory=hosts
stdout_callback=skippy
remote_user=root
private_key_file=/path/to/.ssh/key_rsa
-
Change
remote_user
if necessary -
Change
private_key_file
accordingly
-
$ cd /path/to/ansible-grav
-
$ ansible -m ping all
Should result in:
XX.XX.XX.XX | SUCCESS => {
"changed": false,
"ping": "pong"
}
$ ansible-playbook provisions.yml
-
Navigate to FQDN or IP.
-
Grav Admin will prompt you to create an admin user. Fill out the form and continue to the dashboard.
-
The dashboard my display purple bar(s) indicating update(s) to Grav and/or Plugins are available. Ensure Grav update is applied before attempting to update Plugins via Dashboard > Plugins > Update All Plugins.
-
Navigate to Configuration > System > Caching section and set Cache driver to APCu.
-
Use your browser to navigate to your FQDN or IP address to view the default Grav welcome page.
-
Get Grav'n!
-
Fully explore the Configuration tabs and hover over the option title to display a bit more info on that setting.
-
Enabling Markdown extra in Configuration > System > Markdown section is recommended.
-
Caching is critical and Grav flushes caches upon system changes, so you will probably never want to disable caching - however the setting is there in Configuration > System > Caching.
-
If you aren't developing a custom theme for Grav or otherwise modifying the CSS or JS, you should enable those two pipelines under the Configuration > System > Assets section.
-
The Configuration > Site tab is where you may specify a site title, author name & email address, custom taxonomies, etc.
-
The Configuration > Info tab serves as a phpinfo();
This playbook does not create any users or lock down your sshd_config by disabling root login or password authentication - all of which are recommended if using for production.
This playbook deletes /var/www/html prior to installing Grav. For a fresh VPS you're probably fine with that - but you know, warning anyway. Also /var/www/html is the default webroot regardless of the standard distribution defaults. This will likely change.
This playbook does not install Grav with SSL enabled in the NGINX site. Read the documentation for more information on enabling SSL with an origin certificate.
I have a deep QA background and test heavily before pushing commits. If you find a bug please file a ticket in the issue tracker and I will investigate 🤓
The following matrix outlines current distro/host compatibility for this playbook. Click ❌s to view the ticket in the issue tracker. Version numbers displayed come from the host's UI.
These are the only hosts I have accounts with currently - they seem like popular ones. If you run this playbook on a different host/distro combination with success or failure, please let me know in the issue tracker, or send me a referral to said host so I can verify.
AWS | DigitalOcean | Google Cloud | Vultr | |
---|---|---|---|---|
Amazon Linux 2017.03.1 | ✅ | ⚫ | ⚫ | ⚫ |
CentOS '7' | ⚫ | ⚫ | ✅ | ❌ |
CentOS 7.3.1611 | ⚫ | ✅ | ⚫ | ⚫ |
Debian '8' | ⚫ | ⚫ | ✅ | ✅ |
Debian 8.8 | ⚫ | ✅ | ⚫ | ⚫ |
Debian 9.0 | ⚫ | ✅ | ✅ | ✅ |
Fedora 25 | ⚫ | ✅ | ⚫ | ❌ |
Ubuntu 16.04 | ✅ | ⚫ | ✅ | ✅ |
Ubuntu 16.04.2 | ⚫ | ✅ | ⚫ | ⚫ |
Ubuntu 16.10 | ⚫ | ✅ | ✅ | ✅ |
Ubuntu 17.04 | ⚫ | ✅ | ✅ | ✅ |