Skip to content

Instantly share code, notes, and snippets.

@azharuddinkhan3005
Last active October 26, 2018 12:22
Show Gist options
  • Save azharuddinkhan3005/18259d624973449da0cea7c2e350767d to your computer and use it in GitHub Desktop.
Save azharuddinkhan3005/18259d624973449da0cea7c2e350767d to your computer and use it in GitHub Desktop.

Download the files from google drive!!.

pttgc setup

  • Install VirtualBox 5.2.14 and Vagrant 2.0.2

  • Download the custom vagrant box pttgc-dev-env-v1.box and the Vagrantfile

  • Install the vagrant-disksize plugin

    • vagrant plugin install vagrant-disksize
  • Windows user's install git bash (or cygwin (preferable))

  • Generate the SSH keys(if not already present):

    • ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  • Then add your SSH key to the ssh-agent (This step is to be performed on HOST Machine)

    • ssh-add -K ~/.ssh/id_rsa
    • For Windows users if the above step did not work then run eval $(ssh-agent -s)
  • Check whether your SSH key are added to the ssh-agent

    • ssh-add -l or ssh-add -l -Emd5
  • Go to you Documents(preferable) folder on you system and create a folder pttgc_env(preferable)

  • Within this folder place the above downloaded pttgc-dev-env-v1.box and Vagrantfile

  • From within this folder through your Terminal (or command prompt) run

    • vagrant box add pttgc-dev-env-v1 pttgc-dev-env-v1.box (this will take a while)
  • Then after that run

    • vagrant up (this will bring up the vagrant machine)
  • Then after than run

    • vagrant ssh (this will take us inside the vagrant box (which has ubuntu xenial LTS will all the tools that we need) which will act as out development environment)
  • When inside the vagrant box go to the /home/vagrant/web folder by running

    • cd /home/vagrant/web
  • Then clone the gcmarketplace repository by running

    • git clone git@github.com:srijanaravali/gcmarketplace.git pttgc (it will ask Are you sure you want to continue connecting (yes/no)? then enter yes) this will clone the gcmarketplace repo.
    • Then navigate inside the pttgc directory and run chmod -R 0777 . and then run git config core.fileMode false
  • Then edit the hosts file by running sudo vi /etc/hosts and at the end add these two lines and save the hosts file.

    • 192.168.68.8 localdev
    • 192.168.68.8 localdev.pttgc
  • Then in your browser navigate to http://localdev it will show us apache's default page which means It Works :) .

  • To manage files, connect via network share using NFS or CIFS to 192.168.68.8

    • Windows: start -> run -> \192.168.68.8\pttgc
    • macOS: ⌘+K -> nfs://192.168.68.8/home/vagrant/web/pttgc
    • linux: mount -t nfs 192.168.68.8:/home/vagrant/web/pttgc MOUNT_POINT

Configuring Drupal part

  • In the browser navigate to http://localdev.pttgc and complete the drupal setup.
  • In the database details enter the following:
    • Database Name as pttgc
    • Database User as vagrant
    • Database Password as Vagrant@123
    • In the Advanced Options enter the Host as 127.0.0.1
  • Navigate to the mounted point directory.
  • The navigate to the sites/default directory
  • Make a copy of default.settings.php file as settings.php and make sure it is writable

Installing Drupal console in the guest machine (if anyone wants to use it)

curl https://drupalconsole.com/installer -L -o drupal.phar
sudo mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment