Skip to content

SchoolStickers/vagrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

School Stickers Vagrant Box

This Vagrant box is for use with School Stickers projects.

While we're happy for the community at large to use it for their own purposes, it is highly opinionated to the requirements of School Stickers, and we'll be unable to provide you with any support for it.

Instead, we recommend you use Vaprobash, on which this project is based.

First things first

  1. Install VirtualBox.
  2. Install Vagrant.
  3. Install vagrant-cachier plugin by running vagrant plugin install vagrant-cachier.
  4. Install vagrant-vbguest plugin by running vagrant plugin install vagrant-vbguest.

Using rsync?

As with all things Windows related, this isn't as simple as one might hope. Vagrant 1.5's new Rsync folder syncing does work, but (we ever) there are a few hops to jump though. The following works for me with Vagrant 1.5.1 using git bash/MinGW.

  1. Download cwRsync to your machine and add its directory to your path. [Source]
  2. Edit C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.5.1\plugins\synced_folders\rsync\helper.rb and add hostpath = "/cygdrive" + hostpath to line 74. [Source]

Don't forget, if you're using rsync, you need to use the vagrant rsync or vagrant rsync-auto command to update the files on the VM.

Using in your project

  1. Copy Vagrantfile from this repo into the root of your project.
  2. Ensure the following files/folders exist in the root of your project:
  • public_html/ served by nginx.
  • log/ used for log files.
  • import.sql SQL dump for any databases you need (optional).
  • vhosts/* any custom vhosts you want your box to use (optional).
  1. Run vagrant up from the root of your project.
  2. Go have a coffee while it's provisioning.

Settings

  • Base:
  • IP address: 192.168.33.10.
  • URL: 192.168.33.10.xip.io
  • Nginx:
  • HTTP port: 5580.
  • HTTPS port: 443 .
  • Varnish:
  • HTTP port: 80.
  • Forwarding to: 5580.
  • MySQL/MariaDB:
  • Username: root.
  • Password: no password.
  • Database: The import.sql script needs to create the required databases.

Todo

  • Install MailCatcher.

Xdebug and fixing the Unidentified Network issue

If you wish to use Xdebug with your own IDE, you might encounter an issue where the IDE isn't able to see the connection from the server. I won't pretend to understand the exact cause of this, rather I'll just say it's related to the Windows firewall rejecting the connection because it's from an Unidentified Network (as shown below).

Thankfully, fixing the issue is easy, simply follow these instructions (borrowed from the internet):

  1. Open regedit.
  2. Navigate to HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}
  3. Browse through the subkeys (named 0000, 0001, etc) until you find any subkeys containing the virtualbox network adapter. You're looking for ones where the “DriverDesc” key has “VirtualBox Host-Only Ethernet Adapter” as a value.
  4. Add a new DWORD (32) value with a name of *NdisDeviceType (don't forget the *), and set it's value to 1.
  1. Disable/re-enable all the network adaptors you've just edited (or simply reboot)