Skip to content

Instantly share code, notes, and snippets.

@alexschwarz89
Created August 16, 2016 15:16
Show Gist options
  • Save alexschwarz89/6bd68e0da60c1f8708521b52e7e46e26 to your computer and use it in GitHub Desktop.
Save alexschwarz89/6bd68e0da60c1f8708521b52e7e46e26 to your computer and use it in GitHub Desktop.
Vagrant Base Boxes
Vagrant Base Boxes
==================
### List of available boxes
| Box Name | Description
|--- |
| general | A general base box PHP5.6, Apache, xDebug, mailcatcher
| craft | Prepared* to use with https://craftcms.com/
### Build a new project
* Run newproject.sh and follow the instructions
The provided shell script "newproject.sh" does everything described below and copies
the files to a directory you choose. For now, there isn't any parameter validation so double-check your inputs.
However, if you feel like you want to install it yourself, follow the steps below.
#### Manual installation
* After you choose your VM, copy `Vagrantfile` and the `vm` folder to your target project git root.
* Configure vagrantfile to match your project name and choose a *unique* project IP
```
config.vm.network "private_network", ip: "192.168.1.2"
config.vm.hostname = "myproject.dev"
config.hostsupdater.aliases = ["www.myproject.dev"]
```
* If your web root is not in www/ relative from the project root, you must change the synced folder too
`config.vm.synced_folder "www", "/var/www",id: "web-root", type: "nfs"`
* Maintain the list of assigned virtual IPs found here [tbd]
* Modify your Virtual Host (vm/vhost.conf) to match your hostname
`ServerName myproject.dev`
* Modify the bootstrap.sh file and set the xdebug IP to the IP assigned before
`echo 'xdebug.remote_host=192.168.1.2; IDE-Environments IP, from vagrant box.' | sudo tee --append /etc/php5/fpm/php.ini`
#### Side notes
*1 The craft box requires downloading and copying the craft cms files BEFORE running `vagrant up`. If you messed it up, type `vagrant destroy`, place the files and again `vagrant up`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment