This is a quick guide to setup a drupal dev enviroment
TODO
- Provide a decent drush alias file
- Prodive provisioning script
Sources
- https://github.com/scotch-io/scotch-box
- https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one
- https://github.com/jakubgg/scotch-box4dev/blob/master/Vagrantfile
- https://www.carnaghan.com/2015/05/drupal-development-environment-in-less-than-10-minutes/
Setting up a dev enviromnent is an annoying and repeating task. With this README we do speed up this process a little.
Assumptions
-
Project resides in a folder structure as follows:
. .. .git .gitignore public/ example.com.aliases.drushrc.php .vagrant Vagrantfile -
all files a git controlled
-
Install Vagrant
vagrant plugin install vagrant-vbguest vagrant-share -
Clone Scotch Box
git clone https://github.com/scotch-io/scotch-box.git PROJECT vagrant up -
Add new project to the
/etc/hostsfile192.168.33.10 lo.project.comHint: for easier ssh access add (
ssh vagrant@vagrant.local)192.168.33.10 vagrant.local -
Login to your new vagrant machine, create ssh keys and add them to the destination host.
PW:vagrantssh vagrant@192.168.33.10 ssh-keygen -t rsa ssh-copy-id user@host -
Open
.bashrcon the vagrant machine go and add to the end of the filecd /var/www/public -
Install
php5-xdebugsudo apt-get update sudo apt-get install php5-xdebug sudo service apache2 restartAdd the following to your
/etc/php5/apache2/php.ini[xdebug] zend_extension="/usr/lib/php5/20131226/xdebug.so" xdebug.remote_enable=on xdebug.remote_connect_back=on xdebug.remote_host=192.168.33.10restart the server again
sudo service apache2 restart -
Setup a drush alias and symlink it on the vagrant box and on your local host
drush sql-sync @remote @local --create-db
drush rsync @remote:%files @local:%files