Skip to content

Instantly share code, notes, and snippets.

@kae76
Created October 9, 2013 15:53
Show Gist options
  • Save kae76/6903482 to your computer and use it in GitHub Desktop.
Save kae76/6903482 to your computer and use it in GitHub Desktop.

Vagrant setup

First clone the Vagrant Box repo

git clone git@github.com:kae76/drupaldev-nginx.git

Follow the following steps, inspired from the repo's ReadMe file
but only running vagrant up right at the end!

cd drupaldev-nginx

mkdir sites
All our drupal sites will go in here

cp manifests/example.pp manifests/devsites.pp
The devsites.pp is a puppet file which defines and creates the Virtualhost for your site.

edit manifests/devsites.pp by replacing every example.drupal.dev with tcs-openatrium.drupal.dev
That will be the URL used to access your local dev site.

cd sites
git clone git@github.com:ChildrensSociety/TCS-OpenAtrium.git tcs-openatrium.drupal.dev
The last bit makes sure that the repo folder is the defined name, rather than what the repo is called.

cd tcs-openatrium.drupal.dev

cp www/sites/default/default.settings.php www/sites/default/settings.php
edit settings.php, at line 213, replace $databases = array(); with:

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'db_name',
      'username' => 'db_user',
      'password' => 'db_password',
      'host' => 'localhost',
      'port' => '3306',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

DB Dump Import

We are now going to prepare the database dump for automatic import

cd db/
bzip2 -dk TCS-OpenAtrium.sql.bz2
This unzips the compressed sql file (-d) and also keeps a compressed copy (-k)

The vagrant box will automatically import any database called import.sql in the /sites/www/tcs-openatrium.drupal.dev/db so we need to rename the current sql file

mv TCS-OpenAtrium.sql import.sql

Now, all that is left is to turn the ignition
vagrant up

But don't got away just yet, it will ask you for your password (the one you use to login to your Mac)

Now make tcs-openatrium.drupal.dev point to your vagrant machine by editing the host file

sudo nano /etc/hosts

add the following line

33.33.33.10 tcs-openatrium.drupal.dev

In theory, you should be able to go to http://tcs-openatrium.drupal.dev

To SSH into your vagrant machine just
vagrant ssh

Let's import the database dump, in the likely event it didn't import automatically:

cd /var/www/tcs-openatrium.drupal.dev/www/
drush sql-cli < ../db/importsql
drush cc all just for good measure

Local Files

Follow this... https://gist.github.com/waako/a101eb0f0e4ce2588756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment