This repository is part of a 2 repositories Vagrant project:
- This repo, aim at provisionning your box once.
- A second repo, using the first one to build a Drupal customized box.
More info on this project is available on my blog: Vagrant for Drupal dev with Solr and Xdebug.
This repo contains Vagrant provisionning script to setup a base virtual machine with the following components:
- Ubuntu 12.04 LTS
- apache2 + mysql 5.5.x + PHP 5.3.x
- phpMyAdmin
- Apache/Lucene Solr 4.x
- Xdebug
The aim is to build this base machine once, then re-use it to make it project-specific (ex: Drupal will require some small changes to the Solr conf).
NFS will not work on Windows. Keep it disabled in Vagrantfile.
This repo is for demonstration purposes only and contains some passwords. It's stronlgy recommended to not use the resources 'as is' for production or even development environments.
Also know that for developer convenience, some default PHP variable (ex: max memory) have been modified. These modifications may not be suitable for production. See provision.sh for details.
To provision the box, use:
mkdir vagrant-apache2-xdebug-solr && cd vagrant-apache2-xdebug-solr
git clone git@github.com:rcuny/vagrant-apache2-xdebug-solr.git ./
vagrant up
Note that during the vagrant up command, you may be prompted for a password. This is your host OS asking for your local admin password, to mount network shares from the VM.
Once the provisionning is complete, simply ssh yourself to the VM and run the PhpMyAdmin install script. The provisionning script can't install PhpMyAdmin automatically, as it runs in non-interactive mode, that's why we do it manually.
vagrant ssh
/vagrant/scripts/phpmyadmin.sh
Nb: the default MySQL password set by provisionning.sh is "root".
You're done! Open a browser and check the following URLs:
- http://192.168.66.6/phpinfo.php - you should see info about Xdebug
- http://192.168.66.6/phpmyadmin - defaults values: user: root / pass: root
- http://192.168.66.6:8080/solr
The aim of this provisionning script is to get a full LAMP stack ready, with Xdebug and Solr. Once this is done, you should package the box and save it somewhere online, to use it in your web projects without the hassle of going through the entire provisionning process again.
To package your box:
VBoxManage list vms
vagrant package --base build_box_TIMESTAMP --output name_of_my_box.box
build_box_TIMESTAMP should be replaced by the ID given by the VBoxManage list vms
command.
Upload your box to a remote location, then in your next Drupal project, use the following setting:
vagrant.vm.box_url = "http://mywebsite.com/name_of_my_box.box"
When you are done with storing the box to a remote location, you can proceed to the 2nd repository, Vagrant dev box for Drupal: Apache2 + Solr + Xdebug, and learn how to reuse this box for a Drupal project.
This project is a compilation of many already existing pieces. Thanks to all of the authors for their work.
This provisionning script is based on the first part of the repository used at DrupalCamp Leuven. It was created by Jurgen Verhasselt from Wunderkraut.
Many thanks for this highly valueable work!
Xdebug provisionning is based on an article by Anthony Curreri.
Install Apache Solr provisionning is based on article from Tomasz Muras
Thanks to mdurao for is contribution on this post
Renaud CUNY is a Drupal consutant & developer.