Skip to Content

Creating a test site on VPS

Categories:

What would be the simplest way to create a test site for our Bryght VPS live site?

Requirements:
- Contain an identical copy of the production site files & database (including Drupal core). This will allow to test minor & major Drupal upgrades, adding contrib modules, patches, configurations, themes, etc.
- Accessible to multiple users via an address such as www.beta.example.com or www.example.com/beta.
- A one time setup (if at all) of any DNS entries or other configurations from Bryght.

I didn't find any article in your guides about this topic, with the closest being "Multiple Sites on One VPS" - but that one is more centered on sharing the Drupal core files.

Thank you,
Ran

Comments

Multiple versions of Drupal

Richard Eriksson's picture

The instructions on running multiple installs of Drupal on your VPS might be better suited than the multiple sites instructions. They can be the same version of the code, but two separate file bases. That way you can copy over Drupal and make changes to one of the installs while keeping the other install(s) intact. You would have to be comfortable with editing the Apache configuration file for it to work with a separate subdomain or subdomain. (This is not required for the symbolic link option outlined below.) We're working on a set of more detailed instructions and scripts for administrators to easily create test sites and quickly switch that working test site to the live, production site, and be able to quickly revert if something goes wrong.

The instructions I link to above describe having it at a separate subdomain or domain, but you can make a symbolic link called 'beta' from your existing Drupal install to the other one, and it will work as well. So you'd have

  • /var/www/DRUPAL-5-test/html
  • /var/www/DRUPAL-5/html

and inside /var/www/DRUPAL-5/html you'd have a symbolic link pointing to /var/www/DRUPAL-5-test/html The command for that would be:

ln -s /var/www/DRUPAL-5/html /var/www/DRUPAL-5/html/beta

Did not work for me

I tried using the symbolic link method, but it did not work for me.
The steps I did:
1. Create a new data base, and dump the live site's data base into it.
2. Our site is Drupal 5.1 based, but for some reason its directory structure does not follow the convention of /var/www/DRUPAL-5/html - there's no DRUPAL-5 directory; so what I did was to create an identical copy of /var/www/html/* under /var/www/test_site/html/.
3. Modified /var/www/test_site/html/sites/default/settings.php to point to the new data base, and to www.example.com/test_site.
4. I assumed there was a typo in your instructions above, so the command I typed was (equivalent to) -
ln -s /var/www/DRUPAL-5/html /var/www/DRUPAL-5-test/html/beta
The symbolic did not point correctly ("ls -la" showed it pointed to /var/www/html), and nothing was available at www.example.com/test_site.

Anything I missed or did wrong?

By the way, I noticed that in our live site's settings.php the $base_url line is commented out (the $db_url line is not) - so what governs the live site's url?

Thank you,
Ran

Will give it a try

Thank you Richard, I'll give the symbolic link method a try.
I'll be waiting for your detailed test site article - it will be a good addition to an already comprehensive and clear source of information you provide with your various guides.

Ran

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.