Based on: Ubuntu 20.04
- blackfire
- clamav
- docker
- elasticsearch (7)
- kafka (2.5)
- mariadb (10.3-original, 10.3)
- memcached
- mongodb (4.2)
- nginx
- nodejs (12)
- php (7.4-original, 7.4, 8.0)
- postfix
- postgresql (12-original, 12)
- rabbitmq (3.8)
- redis
- MacOSX and Windows: Download and install the newest version of virtualbox.
- Linux: Download and install the newest version of virtualbox or add a package mirror for your distribution.
Download and install the newest version of vagrant.
vagrant plugin install vagrant-hostmanager
vagrant plugin install vagrant-vbguest
Needed to use disksize option:
vagrant plugin install vagrant-disksize
needs to be done once
cd /path/to/my/project
git submodule add -b 20.04 https://github.com/vagrant-php/ubuntu.git vagrant-php
needs to be done after clone the project
cd /path/to/my/project
git submodule update --init -- vagrant-php
needs to be done, when you want to upgrade vagrant-php in your project
cd /path/to/my/project
git submodule update --remote -- vagrant-php
Add generic user specific settings, for example git email which are relevant for all projects using vagrant-php. Overrides the settings of vagrant-default.yml.
cd ~
(code|nano|vi) .vagrant-default-user.yml
git:
config:
user:
email: [email protected]
name: "'John Doe'"
Add project specific settings, for example the hostname. Overrides the settings of vagrant-default.yml and ~/.vagrant-default-user.yml.
cd /path/to/my/project
(code|nano|vi) vagrant.yml
hostname: &hostname projectname.development
network:
ip: 10.11.12.13
role:
nginx: true
nginx:
server:
-
root: /vagrant
server_name: *hostname
template: default
Add user and project specific settings. Overrides the settings of vagrant-default.yml, ~/.vagrant-default-user.yml and vagrant.yml. Add this file to .gitignore.*
cd /path/to/my/project
(code|nano|vi) vagrant-user.yml
memory: 2048
cd /path/to/my/project
cd vagrant-php
vagrant up
vagrant ssh
There are 2 possibilities:
* Generate SSL cert with 'mkcert' and add it to vagrant machine
* Let the vagrant machine generate your certificates and import them to your local environment
After provisioning all vhost certificates are generated in vagrant-php/certs
* Open your key-chain application and import all certificates in vagrant-php/certs
* set all certificates to trusted
* enjoy ssl on your local dev environment
$ sudo apt-get install libnss3-tools
* for each cert file run:
$ certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n CERT_FILE -i CERT_FILE
* enjoy ssl on your local dev environment
$ certutil -d sql:$HOME/.pki/nssdb -L
$ certutil -D -d sql:$HOME/.pki/nssdb -n -.lee.dev
Before provisioning add your .crt
and .key
files to vagrant-php/certs-import
e.g. domain.tld.crt
and domain.tld.key
- notation matters!
-
generate your files to
vagrant-php/certs-import
with:mkcert --cert-file=HOSTNAME.crt --key-file=HOSTNAME.key HOSTNAME
-
run vagrant provision:
-
Enjoy SSH
It's possible to include additional ansible roles defined per project.
- Create a folder for your additional roles on PROJECT_ROOT eg. ansible_roles
- Add as many roles in your vagrant.yml as you want like this:
include_roles:
- "ansible_roles/dependencies/main.yml"