Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Magic Index is currently a simple form for installing Drupal sites as subdirectories of a root virtual host on a local development server. At the very least, you'll need a LAMP stack, drush, and drush_make to get started. If you develop on a Gnu/Linux machine (preferably Ubuntu) and have inotify-tools installed, it will also automatically chown your site directories after they are installed so that Eclipse can create a new PHP project at the site's location using the site's existing source.

The long-range plan is to grow this into a full-featured Module, then later into an Install Profile that can itself be installed using the original Magic Index form itself. A developer will then be able to use her local Magic Index site to manage all of her other local Drupal development installations. Think Aegir's site-management capabilities, but for isolated local Drupal installs. In fact, the big idea is that a developer will be able to use her local Magic Index site to install, upgrade and backup her other local isolated Drupal development sites, which can then be migrated to Aegir for deployment. But all that is a long way off. For now, it's just a simple web form for installing sites locally.

Why not Acquia Dev Desktop, Quickstart or Drubuntu?
If I didn't already have an existing dev environment (and Aegir) setup on my Ubuntu machine, and was looking for a quick way to setup a local dev environment, I'd probably go with Acquia Dev Desktop -- except that Acquia Dev Desktop is only available for Mac OS X and that other OS (whats-it-called? ...the one based on all of Gary Kildall's hard work?). Anyway, as I understand it, the Ubuntu/Debian .deb package of Acquia Drupal only sets up a single local Drupal installation, not multiple local dev sites for developing different drupal projects concurrently in isolation of each other.

On the other hand, if someone wanted to take an Ubuntu dev environment for a quick test-drive, I'd recommend Quickstart. It's a great way to have a look-see of how Ubuntu, Drupal, and Eclipse (and optionally Aegir) can work together in one environment. And creating one VM per dev project is an interesting approach to really keeping the dev sites isolated. But I find Quickstart a little sluggish for my needs (despite my 8 gigs of RAM). Plus it seems rather redundant to have one Ubuntu virtual machine per dev site running on an Ubuntu machine which can already handle multiple dev sites and Aegir at the same time.

Which brings us to Drubuntu. There's a lot to like about the development environment that Drubuntu sets up on an already existing Ubuntu Maverick (10.10) machine, but then I've already grown a very similar dev environment over the years on my (now) Ubuntu Natty (11.04) machine, component-by-component. Beyond the fact that Drubuntu doesn't yet work in Ubuntu 11, blasting away my entire dev environment and rebuilding it from scratch just to get a few more features isn't a realistic option.

Don't get me wrong, I think Acquia Dev Desktop, Quickstart and Drubuntu are great projects for their particular use cases, they're just not suited to my particular web development needs.

Currently, the following files make up Magic Index:

  • magicindex.info
  • magicindex.html
  • magicindex.php
  • magicindex.sh
  • magic_hat (dir)
  • makefiles (dir)
    • drupal6x.make
    • drupal7x.make
    • drupal8x.make (experimental: user must create database manually)

Minimum Requirements:
LAMP
drush
drush_make

  • change (sudo chown) the owner of your local development server root directory (/var/www in Ubuntu) from root:root to [username]:www-data
  • Place magicindex.html, magicindex.php, and magic_hat in the root directory of your local web server
  • chmod 777 magic_hat
  • sudo chown [username]:www-data magic_hat

Optional Requirements for Ubuntu (Gnu/Linux):
The form works fine without magicindex.sh, but if you want the installed sites to also be Eclipse-ready:

  • apt-get install inotify-tools
  • Move magicindex.sh someplace convenient, but NOT in /var/www. Someplace like $HOME/shell-scripts wouls be nice.
  • sudo chown root:root magicindex.sh
  • sudo ./magicindex.sh to "watch the rabbit disappear from the hat (in terminal) after you submit the form". Once you have it working, add magicindex.sh (as root) to your startup applications.

Note to Aegir users in Ubuntu:
If you have Aegir installed on your local machine, then you already know that it installed its own drush and drush_make extension system-wide. You will need to also install drush for your regular user, since Aegir won't have permission to edit anything in /var/www. You will also need to remove/rename Aegir's system-wide drushrc.php, so that your regular user can use its own drush:
1. mkdir $HOME/local if it doesn't exist
2. git clone drush to $HOME/local
3. create a symlink for your regular user to run drush ln -s /home/[username]/local/drush/drush /home/[username]/bin/drush
4. sudo mv /etc/drush/drushrc.php /etc/drush/drushrc.php.old
5. drush version as the Aegir user, then as the regular user, in order to verify that they are using different versions of drush.

In addition, you'll need to modify Aegir's virtual host configuration so that your web browser can access your local non-aegir web server:
6. sudo vim /etc/apache2/conf.d/aegir.conf
7.

#NameVirtualHost *:80

<VirtualHost *:80>
  ServerName default
#  Redirect 404 /   (comment this out so you can browse to your nonaegir site)
</VirtualHost>

## nonaegir.local (for example, change here and below)

<VirtualHost *:80>
  DocumentRoot "/var/www"
  ServerName nonaegir.local
  <Directory "/var/www">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

8. sudo vim /etc/hosts
9. 127.0.0.1 nonaegir.local
10. sudo /usr/sbin/apache2ctl graceful

Project information