I've got a client with some very specific multi-site/domain needs. I suspect the not-yet-released multi-domain module for not-yet-ready-for-production Drupal 5 is what they need. I'm really uncertain how to proceed. Before I take the possibility of using Drupal 5 to the client for discussion and certainly before I nuke the sorta inadequate, but working, Drupal 4.7 multi-site set-up, I'd like to try Drupal 5 with the multi-domain module to see if it really does the things I imagine and need. Can I just install Drupal 5.0 in a different directory on the same domain/account with a different database and give it a spin? Or am I heading into shark-infested waters? Thanks.

Comments

soupp’s picture

Installing different version of Drupal in a directory (with separate database) is totally ok. I have some dozens Drupal installs on my localhost. But I would not recommend to have any Drupal installed in root in this case.

Drupal Top Sites | Drupal Sites Directory

vjordan’s picture

I have a single hosting account where I run a series of test Drupal installations. I have one area which is set-up for the kind of configuration you want to explore. I didn't want to affect a production site so I used a couple of subdirectories and a subdomain to get the test installations up.

The directories for the drupal installations look like this:

  home/demo/drupal4
  home/demo/drupal5

I defined a subdomain (through my hosting provider) called "demo" from my main site: demo.example.com
This points to home/demo.

I then installed drupal4 and drupal5 into the same mysql test database. It would be a bit cleaner to use separate databases but I'm close to the available limit from my hosting service so I put them both into the same database. I use the table prefix "drupal4_" and "drupal5_" for each installation which keeps all the tables independent. The table prefix was straightforward with V5 but I needed to modify the database installation script (SQL) to get the prefix on V4.

Using the following URLs I can access the installations:
demo.example.com/drupal4
demo.example.com/drupal5

Using these installations to test multi-sites is fine. Multi-sites are easy if you have a good handle on configuring apache, php, mysql and drupal and you can also work your way around the patchwork of multi-site guidance on drupal.org. I didn't so I faced a steep learning curve. It was worth persisting though and it's given a whole new flexibility on site set ups.

kdebaas’s picture

I have a similar setup at home, where I am developing sites for later deployment: two separate, single Drupal installations.

 var/www/drupal4
 var/www/drupal5

One of the sites has content with root-relative links. I.E, the body of a node contains full html, with an image that is linked in this way:
<img src="/files/imported/image.jpg">

However, because the real root is not var/www/drupal4 but var/www, the links do not work. It would work if I have just relative links, but I have been importing hundreds of pages with root-relative links from an old non-Drupal site.

How do I make each site in their respective subfolders behave as if they are in root?

soupp’s picture

I didn't digg this issue. There were less issues with relative links in 4.6 vs 4.7. But sometimes it works fine if you make links just like:

<img src="files/imported/image.jpg">

Drupal Top Sites | Drupal Sites Directory

voipfc’s picture

Consider a rewrite rule in .htaccess. I am not that knowledgeable in that area, but you should be able to get some help here.

dman’s picture

Root-relative links and subsites are not happy bedfellows.
There is no short answer.

If you are just needing development space on a small-scale setup, and are not able to set up your own multiple hosts, you can still set up your server to listen on development ports, and serve your sites there too -
http://localhost:8001/
http://localhost:8002/
...
root-relative links will work right there.

or tweak your HOSTS file and use local name-based virtual hosts... all resolving to 127.0.0.1 or whatever.

Just some approaches, depending on the scale and number of your dev servers...

Neither of these work-arounds are quite right for production sites... but may be all you need

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

cog.rusty’s picture

If you make your subdirectories accessed as subdomains

drupal4.localhost instead of localhost/drupal4
drupal5.localhost instead of localhost/drupal5

then links like <img src="/files/imported/image.jpg"> will work ok (no subdirectories will appear).

In a local installation you can easily do this using vhosts in apache's httpd.conf
Don't forget to change the names of the settings directories under /sites.

kdebaas’s picture

I have an ISP who allows me one subdomain under their own for my internet connection, which I am using to serve my websites to the outside world. For example: myname.myisp.nl. They do the DNSsing, and don't make extra subdomains for free. am by the way also assuming that I can't "make" them myself.

So, I can't work with drupal4.myname.myisp.nl. I tried setting up vhosts in Apache for myname.myisp.nl/drupal4 but that didn't work. I scoured the internet to see if this is even a valid thing to do, and though I didn't find anything, I am now assuming it isn't.

To make things more complicated: I am working on a LAN, behind my router, working on one computer with the server set up on another. Of course I can't access the sites by their urls from behind the router, unless I surf by proxy. Until I set vhosts, I happily connected to them by the internal IP adress of the server computer.

It's been a long day ;-)

I'll work around the relative links for now, and maybe try out some of the other suggestions (rewrites etc...) some other time, and open a new topic for them if I don't get anywhere.

Thanks

cog.rusty’s picture

With sites in subdirectories, the available solutions are (AFAIK):

1. Use <img src="/subdir/files/imported/image.jpg">
(Problem: If you move the site you'll have to edit the paths in the database)

2. Use the php input format and <img src="<?php print base_path() .'files/imported/image.jpg'?>">
(Problem: An annoyance and also you can't give this permission to anyone)

3. Don't use html but tags interpreted by an input filter which will add the base_path when rendering. For example with this module:

http://drupal.org/project/pathfilter

(Problem: Dependence on a filter)

See also this discussion http://drupal.org/node/106608 where it becomes clear why a relative path like "files/imported/image.jpg" won't work.

kdebaas’s picture

So my problem is actually much bigger than I thought...
Well, for the moment I parked a duplicate of the /drupal4/files folder at /files, so my root-relative links work. I will investigate further on the other thread.
Thanks