Make Drupal installation script more complete (less actions by user) and independent of domain name

I've subscribed to Virtualmin Pro today and the first thing I tried was Drupal installation script. Well, it generally works, but has in my opinion the biggest obstacle to be used in production environment - script requires users to finish so called "initial configuration" in their browsers by clicking on an offered by the script link, something like http://thewebsit.tld/install.php

In real life scenario, especially in hosting business, users want to install and test the website prior pointing the domain names. And this can be done either through IP address or using functional aliases. However, it will be tough task for the script to check if the website is the main one, associated with IP as if there are more than one website on the server and newly created one is not the main one, then it will be not possible to finish the installation process through IP address. And adjusting the script for the second method is also problematic since working alias can be installed after the virtual server is created first and lots' of users will attempt to install the script installer before creating a working alias.

So the only way and IMHO the best way would be using Drush, which also saves users from "initial configuration" step as it install Drupal till the very end - users will be ready just to login and start using their websites. IT will be very much easy for the script to install Drush on any Linux per https://github.com/drush-ops/drush/blob/master/README.md:

pear channel-discover pear.drush.org
pear install drush/drush

and then trigger only the following two lines:

drush dl drupal-7
drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://YourMySQLUser:RandomPassword@localhost/YourMySQLDatabase

Since the script already downloads required by user Drupal version we even can omit drush dl drupal-7.x step. Alternatively the script could be simplified to delegate this downloading part to Drush.

Using Drush would make the installation script more complete as users will not be required to finish "initial configuration" part and this method will work on all scenarios even for the cases when the domain name has not been propagated to the Virtualmin server and the newly created website is not the first (main) one on the server.

Thanks for consideration!

Status: 
Closed (fixed)

Comments

Drush would be a nice solution here - but can it operate on a drupal install that is in a domains directory? And can it be run as a non-root user?

Another way to perform this setup is to have an alias domain for each real domain that is under your company's top level domain. That way the site can be accessed and drupal configured before the site goes live.

Of course, Drush operates anywhere where it finds Drupal. And yes, even non-root users can use Drush. At the same time, Virtualmin installation scripts can act on a system level with root privileges. Drush can be used just to install and deliver ready to use Drupal website to user by the script that uses necessary privilege levels, which it doesn't have to delegate down to regular non-root user. You just try to run those three line commands and you will see how it is easy to use Drush. And Drupal installation script can only benefit from Drush by relying on Drupal-specific functionality of Drush.

Pardon me, there should be one more command per Virtualmin standards - after downloading the Drupal drush dl drupal-7, we need to move Drupal to public_html:

mv drupal-7.23 public_html

switch to the document root and then only install Drupal:

cd public_html
drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://YourMySQLUser:RandomPassword@localhost/YourMySQLDatabase

Ok, thanks - I will look into this.

Thanks for consideration. We will be looking forward to hear from you on this.

Hi Jamie,

We've written and are successfully using a bash script to auto-install Drupal with Drush. Unfortunately, we need to run it manually and that is why I've files a request to allow running custom scripts through templates on http://virtualmin.com/node/33492

If you do not want to deal with this, then can you please consult if a Virtualmin installation script can trigger a bash script at certain point and, if yes, how to do it?

Is it possible for Virtualmin installation script to fully delegate installation process to another (bash, perl, another) script?

Link to the relevant discussion on the forums http://virtualmin.com/node/15263