This repository is based on Zivtech's development virtual server.
- On Windows, you will need to have access to an ssh client, such as Git bash (which is installed with GitHub for Windows), Cygwin, or PuTTY.
- Vagrant (tested on V1.2.7)
- VirtualBox
- Navigate to your GitHub directory (if installed with GitHub for windows), or your standard development directory. Note that the current vhost setup fails if you're using the ~/Sites folder on OSX
- Clone this repository
[email protected]:ilrWebServices/vagrant-development-vm.git - Clone a website respository (such as the ILR Website).
cd vagrant-development-vmcp Vagrantfile.example Vagrantfile. This creates a working copy Vagrantfile in the root of this repository that points your virtual web server's docroot to vm's parent folder.- Run
vagrant up - ssh into the server with
vagrant ssh - Run
sudo apt-get update && sudo apt-get upgradeon the server (click space-bar and hit enter if/when asked about grub) - Enable Drush on the server (see section below)
exitthe server- Finish the build with
vagrant provision - Reload vagrant with
vagrant reload
You should now have a working Virtual Server, which can be accessed at 33.33.33.40. If you are setting up the ILR Website, follow additional instructions there.
Assuming you are setting up the site for a project such as the ILR Website, you will need to configure mysql on vagrant to accept connections from your host environment. The instructions are as follows:
- Type
mysql - Issue the command
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; - Drush commands run on your host machine now have rights to connect as
rootto the mysql service on the virtual server exitssh andvagrant reload(orvagrant provision, if following installation steps)
This project is currently set up to initialize with the apache2-default file, which configures a VirtualDocumentRoot to serve sites. We set it up this way so we can configure and run multiple websites within this one virtual environment.
The important line in that file sets the VirtualDocumentRoot to /var/www/%2/docroot/, which uses the %2 wildcard to grab the 2nd dot segment of the url and look for a folder with that name (i.e. www.ilr-website.dev will look for a folder called 'ilr-website' in the parent folder of the vagrant-development-vm). This also means that you'll need to edit your hosts file to point www.ilr-website.dev to 33.33.33.40.
If you're working with a Drupal multi-site configuration (such as the Projects bucket), you can create a subdomain to point to the correct multi-site (i.e. hoc.projects.dev would look in for a settings.php file in projects/docroot/sites/hoc.projects.dev).