Skip to content

rcuny/vagrant-apache2-xdebug-solr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant dev box for PHP: Apache2 + Solr + Xdebug

Companion repository

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.

What is in this box

This repo contains Vagrant provisionning script to setup a base virtual machine with the following components:

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).

Before starting

Dependencies / Prerequisites

Note to Windows users

NFS will not work on Windows. Keep it disabled in Vagrantfile.

Important note on security

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.

How to use this Vagrant box

Creating and provisionning your box

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:

Packaging your box for redistribution

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.

Sources & Thanks

This project is a compilation of many already existing pieces. Thanks to all of the authors for their work.

Original provisionning box

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 install script

Xdebug provisionning is based on an article by Anthony Curreri.

Apache Solr install script

Install Apache Solr provisionning is based on article from Tomasz Muras

MySQL configuration for Vagrant

Thanks to mdurao for is contribution on this post

Additional resources

About the author

Renaud CUNY is a Drupal consutant & developer.

About

Vagrant dev box for PHP: Apache2 + Solr + Xdebug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published