Drupal: Testing multisite/domain-access Drupal locally and on a testing server

We're using Domain Access to manage a number of related subdomains on a single server. I prefer to develop and test locallly, then push my changes out to a testing server so that other people can try the system. I use the same domain names on my computer and on the test server so that I don't have to make any changes in the database. To switch between them, I comment or uncomment a line like

127.0.0.1 example.com sub1.example.com sub2.example.com

in my /etc/hosts file.

However, Firefox caches the domain name information, and it can be confusing to figure out which server I'm on. The following setup makes this much easier:

  1. Install Domain Details to show the IP address of the server in your status bar. Good for a quick check - am I on 127.0.0.1 or elsewhere? (NOTE: I started with ShowIP, but it looks like ShowIP caches the information.)
  2. Install the Clear Cache Button extension.
  3. Restart your browser and customize your toolbar. Add the Clear Cache button. Click on this before switching sites.

In an ideal world, I'll have a plugin that automatically twiddles my DNS entries, too. =)

Save to - del.icio.us - Digg it - reddit - StumbleUpon

RSS feed | Trackback URI

4 Comments »

You could also manually edit your settings.php to override local settings. For instance, you could set the footer variable to echo the IP….

I always edit the settings.php to set the site name to " BETA"

 

Oh, that's even better. =) Thanks for the tip!

 

I usually use a different favicon for local/test/live sites. I add a 2px red border for the local site, an orange one for the test site, and the regular favicon for the live site.

 

Throw in some sym links for different sub-sites, or even different versions of modules and themes and local development is a dream.

 
Name (required)
E-mail (required - never shown publicly)
Website / Blog address:
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line=""> in your comment.

Subscribe without commenting

`

On This Day...