Drush Command for Drupal Immediate Installation

inShare Sometimes there is a need to use the “clean Drupal” to test some of the new features or modules. For quick installation of Drupal there is an appropriate Drush command, but you still need to create a host, directory, restart apache. In general, a lot of little things that you do not want to do every time over and over again. There is a little script that automatically creates a host for apache and installs Drupal in a specified directory. Start of the script is being implemented by using Drush commands drush idi – install Drupal instantly. I think the lead source code makes no sense. If anyone is interested, they can read on their own. Here will be described the main actions that are performed during the script is working. Work order Create a virtual host apache: the host file is being created in /etc/apache2/sites-available and symlink for turning on the site (the name of the host you input by yourself); a corresponding note about the host is being added in /etc/hosts; directory is being created as a document root. Drupal downloaded files are getting into the directory, specified as the document root (you can select the version 6 or 7). Use the command drush dl drupal. Installing Drupal (creation of the database and the default installation). Use the command drush site-install. Restart Apache (optional), and the site is ready for operation. Thus, you can pick a host with Drupal literally 30 seconds, and this is the time required for downloading files Drupal, creating a database and other operations. You just have to wait a little bit. Installation and Configuration Installation is extremely simple: You need to download file idi.drush.inc and put it in a folder.drush in your home directory. For example:/home/user/.drush/idi.drush.inc You need to clean the cache drush with the help of drush command cache-clear drush. Now you can run the command sudo drush idi. Nuance Maybe someone will be confused with it, but the script must be run under sudo because it puts hosts in the folder /etc/apache2 and modifies the file /etc/hosts, this is only possible with root rights. Limitations The script is written in PHP using the exec, etc. to execute shell commands, they must be allowed. You must install and configure Drush. The script is designed to work with apache server and database mysql, because this set is often used on computers for development.