LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-20-2011, 03:05 PM   #1
iantresman
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Rep: Reputation: Disabled
Joining /mapping / linking directory?


Is it possible for to join /map / link the contents of one directory with another? For example, I have the following

var/www/vhosts/drupal6/d6/ (master installation)
var/www/vhosts/drupal6/d6/subdir1 etc
var/www/vhosts/drupal6/d6/subdir2 etc

And then I'd like the contents of the following directories to show the contents of (or access) the above (in addition to their own files):

var/www/vhosts/knowledgecomputing.co.uk/httpdocs/
var/www/vhosts/anotherdomain.co.uk/my-directory.com/
var/www/vhosts/customer.com/domain.co.uk/

In this way I can have a single master installation of Drupal, and have other domains access it, and subsequently make it easier to update the one installation, rather than having to update several.

Ideally, I don't want to modify Apache configuration files, but perhaps there is something I can do easily to a new directory (some can of "hard link", change to htaccess?)
 
Old 11-20-2011, 03:24 PM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by iantresman View Post
Is it possible for to join /map / link the contents of one directory with another?
Yes (there you go, the answer to the question that you asked).

Quote:
Originally Posted by iantresman View Post
For example, I have the following

var/www/vhosts/drupal6/d6/ (master installation)
var/www/vhosts/drupal6/d6/subdir1 etc
var/www/vhosts/drupal6/d6/subdir2 etc

And then I'd like the contents of the following directories to show the contents of (or access) the above (in addition to their own files):

var/www/vhosts/knowledgecomputing.co.uk/httpdocs/
var/www/vhosts/anotherdomain.co.uk/my-directory.com/
var/www/vhosts/customer.com/domain.co.uk/
So, are you saying:
  • it is impossible for the two 'overlaid' directories ever to have files of the same name?
  • it is possible for the two overlaid directories to have files of the same name, but there is some algorithm which determines which file is served, and it is something simple like 'when there is a potential conflict, always serve the file from directory 2'?
  • are you also saying, when writes occurs to the directories which are overlaying on another, the write always occurs to, for example, only directory 2?
  • are you also saying that you do not care if there is a performance penalty in achieving this?

(I know that you didn't explicitly say any of the above, but the answers to those questions, some of which I think I can guess, but if I have guessed any of them wrong, I could send you off in a direction that would turn out to be problematic.)

Quote:
Originally Posted by iantresman View Post
In this way I can have a single master installation of Drupal, and have other domains access it, and subsequently make it easier to update the one installation, rather than having to update several.

Ideally, I don't want to modify Apache configuration files, but perhaps there is something I can do easily to a new directory (some can of "hard link", change to htaccess?)
"can of hard link?" - don't understand.

I also need to ensure that, given that you seem to want to access this from several places, that you do want genuinely to see the same image, irrespective of which of those places that you look from.
 
Old 11-20-2011, 04:52 PM   #3
iantresman
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks for the feedback. No, it would not be possible for the overlaid directories to have duplicate files.

In my example above, the single master directory holding the Drupal files are effectively read-only and executable, since the virtual directory which sees them, doesn't have the permissions to change or delete them. So if the Drupal directory has a subdirectory called "images", then I could not have another subdirectory with the same name. All the virtual directories see exactly the same master directory holding the Drupal files.

Of course my virtual directory may have other files and subdirectories of its own, which can be written to (by the linked to Drupal program). I was hoping there would be only a minor impact on performance.

I think this is similar to how my server handles its Webmail facility. Webmail is installed on just one place on my server (out of any specific domain space), but all website can execute the one Webmail installation at http://webmail.domain.com and http://webmail.domain2.com etc, and all data is stored in the domain's own space.

In my case, I want selected domains such as www.domain1.com and www.domain2.com etc, to access my single read-only Drupal installation (as if they were running form their own directory).

Ignore my comments regarding hard (symbolic) links, which I had read somewhere as "something" to do with this, but I didn't understand it.
 
Old 11-20-2011, 06:28 PM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
OK, I am sure that there is a userspace fielsystem for this (and also this (those links may not work without a login to the linux-mag site) and, of course the series starting here, here and here which shouldn't need a login; I can't remember whether unionFS is the most appropriate choice; there is certainly another similar FS (aufs??) and I can't currently bring to mind the similarities/differences.

In any of these userspace filesystems, there will always be a performance overhead; pulling a number out of thin air, I'd have to expect a number in the 10 - 20 % (but I've done no testing to verify that guess). For most applications this will not be a disaster, but, if you already tight on performance, then any real loss of performance will be a problem.
 
Old 11-20-2011, 06:46 PM   #5
iantresman
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Many thanks for the suggestions, looks like I have a bit of homework to do, as I'd not heard of any of them, but it's great to get a pointer in the right direction.

Thanks again.
 
Old 11-21-2011, 10:36 AM   #6
iantresman
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks again for your suggestions. I was pondering over an analogous situation:

When one my websites uses PHP, I assume there is one master installation of PHP, which runs local to the website. I guess I want to do the same with my own program (Drupal), written in PHP in HTML files. Each selected domain is able to access my PHP program, which appears to run locally (ie can write locally). None of my website can change the master PHP installation, and of course, would not be able to change my Drupal installation.

I can see one difference: none of my domains can see the files that make up the master PHP installation, whereas I guess it would be necessary for my domains to each see the image of the Drupal install (otherwise I can't see how the website would "see" the HTML/PHP files ).
 
Old 11-21-2011, 11:25 AM   #7
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by iantresman View Post
Many thanks for the suggestions, looks like I have a bit of homework to do, as I'd not heard of any of them, but it's great to get a pointer in the right direction.

Thanks again.
I should have also noted that you can probably create the same overall situation by setting up a directory and copying the relevant files into that directory; that would happen, eg, on start-up, and be done every time. It would probably be easier to understand and get going first time, if you are unaware of the user space filesystem things, but is inelegant and probably easier to upcock at some later time.

About post #6: I am unclear what exactly you are asking (if anything), and I did get ready to reply, but to be honest, I am not sure whether I would have left you more confused than when you started.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR joining Linux to Active Directory gandip Linux - Desktop 1 03-24-2010 11:56 PM
Samba - Joining Active Directory error Cheza Linux - Server 5 04-04-2008 01:13 PM
Error joining Fedora 7 to Active Directory Domain OdinnBurkni Linux - Networking 3 07-06-2007 03:50 AM
Joining (linking) two lines bghayad Linux - General 3 07-03-2007 07:59 PM
Joining An Active Directory Domain Crashed_Again Linux - Networking 1 09-22-2006 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration