This Playbook can be used to setup multiple vHosts on a single server. Take a look at group_vars/all.example
to get an idea of what it does.
Each item in sites_to_set_up
will create:
- An directory where the website data lives:
/var/www/<vhost-name>/www
- An nginx vhost config (HTTP or HTTPS)
- A user with access to the website directory (chrooted)
- A MySQL database
- Get a fresh Ubuntu 18.04 server
- Rename
hosts.example
tohosts
and modify the contents (Add server IP or hostname.tld). - Rename
group_vars/all.example
togroup_vars/all
and modify the contentes.
Run ansible-playbook site.yml -i hosts
.
- MySQL
- PHP 7.2
- Nginx
- Memcached
- Postfix
- Unattended-Upgrades
- vHosts
- Wordpress (mainly permissions)