This Ansible playbook is designed to be a one command setup of an entire LEMP server with webroot directories created for CakePHP ( but easily overridable for any PHP system)
-
PHP 7 - with Modules:
- FPM
- GD
- Intl
- Json
- Mbstring
- PgSQL
-
Nginx (Ubuntu package)
-
PostgreSQL
-
Git
It has pretty sane defaults (for development only!), a single FPM pool (all customisable).
- Edit
defaults/user.yml
and enter your own details - If you wish to populate SQL then place a dump called
dump.sql
ordump.sql.gz
into thesql
directory - If you are using Vagrant then you can simply issue a
sudo vagrant up
in the root directory and it should download everything and set up your system - If you are just using this on a server then you can clone this repo somewhere on your server and then run
sudo ansible-playbook setup.yml
- CakePHP latest version is installed automatically to
/var/www/vhosts/<domain>/
- Install josediazgonzalez/dotenv and enable programatically (point to .env file in config)
- Use a DSN to connect to the DB with .env variables (DATABASE_URL is used by default)
- Source ENV file for environment
- Check Sphinx works
- Set up Cake to use Redis for caching
Adapted from: https://github.com/chusiang/php7.ansible.role