
I often need to raise a “clean drupal” to test a feature or a new module. For a quick installation of the drupal, there are corresponding drash commands, but you still need to create a host, directory, restart the Apache. In general, a bunch of little things that do not want to do every time. I wrote a small script that automatically creates a host for Apache and installs Drupal into the specified directory.
The script is launched using the drush command drush idi - install Drupal instantly.
I think the source code makes no sense. If someone is interested, you can get acquainted yourself. I will only sign for the main actions that are performed when the script is running.
')
Operating procedure.
1. Creating a virtual host Apache:
- a host file is created in / etc / apache2 / sites-available and a symlink to enable the site (you enter the host name yourself);
- add the appropriate host entry in / etc / hosts;
- creates a directory specified as document root.
2. In the directory specified as document root, Drupal files are downloaded (you can choose version 6 or version 7). The command drush dl drupal is used.
3. Installation of drupal (database creation and standard installation). The drush site-install command is used.
4. Restart Apache (optional) and the site is ready to go.
Thus, it is possible to raise a host with Drupal in just 30 seconds, and this is the time required for downloading Drupal files, creating a database and other operations. You just need to wait a little bit.
Installation and configuration.
Installation is extremely simple:
1. You need to download the idi.drush.inc file and place it in the .drush folder in your home directory. For example /home/user/.drush/idi.drush.inc
2. It is necessary to clean the drush cache with the drush cache-clear drush command.
3. Now you can run the command sudo drush idi
Nuance.
Perhaps it confuses someone, but the script must be run from under sudo. it places the hosts in the / etc / apache2 folder and modifies the / etc / hosts file, this is possible only with root rights.
Limitations.
1. The script is written in PHP using exec functions, etc. to execute shell commands, they must be enabled.
2. You must have installed and configured Drush.
3. The script is focused on working with apache server and mysql DBMS, since This kit is often used on development computers.
Link to the project -
DRUSH IDI
I will be glad reviews!