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/hosts
file192.168.33.10 lo.project.com
Hint: for easier ssh access add (
ssh [email protected]
)192.168.33.10 vagrant.local
-
Login to your new vagrant machine, create ssh keys and add them to the destination host.
PW:vagrantssh [email protected] ssh-keygen -t rsa ssh-copy-id user@host
-
Open
.bashrc
on the vagrant machine go and add to the end of the filecd /var/www/public
-
Install
php5-xdebug
sudo apt-get update sudo apt-get install php5-xdebug sudo service apache2 restart
Add 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.10
restart 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