lazydubuntu
lazydubuntu copied to clipboard
Virtual Host Support with Drush
Problem:
In order to setup a Drupal installation, we need to created a new virtual host and then move to a directory and then install download a Drupal core and then setup the database.
Solution:
We need to integrate Drush 7x as flag. For instance
newsite hostname -d7
This is going to run create a virtual host and configure all the drupal files similar to the following steps.
cd /var/www/hostname #Move to working directory. Remember that newwebsite can change depends on your hostname.
sudo rm index.html # Remove the test website
sudo drush dl drupal-7 # For D8 just change to drush dl drupal-8
cd drupal-7*
sudo mv * .[^.]* ..
cd ..
sudo rm -rf drupal-7* # Remove unnecessary folder
sudo cp sites/default/default.settings.php sites/default/settings.php
sudo chmod a+w sites/default/settings.php
sudo chmod a+w sites/default