Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

These days I have to develop a lot of websites where each is based on a certain CMS, ie. Wordpress, Drupal or Joomla. Instead of always copying the files of each CMS to my project folder, is it possible to have a kind of lib for each CMS and only link to one of them from within my project folder?

So the following setup:

~/lib/
    |---wordpress
    |---drupal
    +---joomla

~/projects/
    |---project1
    |---project2
    .
    .
    .
    +---projectN

What I would like to do is create a structure of symbolic links (or something similar) in each project folder, so that http://localhost/projectN uses all the files of one of the cms located in the ~lib/<nameofcms>/ folder.

I have already created something like this with the following command:

ln -Ab ~/lib/wordpress | xargs -n 1 -I {} ln -s ~/lib/wordpress/{} {}

from within one of the projects folders. That actually worked, but when I tried to »override« the configuration file (in case of wordpress it is the wp-config.php), by replacing the link with a »real« file, it did not work anymore because this very file could not be found any more.

That happened because PHP resolved the symbolic links and so it was looking for:

~/lib/wordpress/wp-config.php

instead of:

~/projects/projectN/wp-config.php

Is it possible to create such a linked project structure that works on my local machine? If so, what do I have to do?

share|improve this question
2  
This question is too broad. It totally depends on the file structure. For some it would work and for other's it wont. E.g. with Typo3 it would work. Furthermore you are not mentioning the operating system etc. –  Raffael Luthiger Feb 16 '13 at 14:09
    
the operating system is Linux, more precise: Ubuntu 12.04. I am asking this because I want to find out if it is possible in general to create a setup so that the CMS does not notice that is used from somewhere else, so the tweak should happen on the operating systems layer. –  philipp Feb 16 '13 at 16:48
add comment

closed as not a real question by John Conde Feb 16 '13 at 16:46

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

At least in WordPress you have the multisite feature...

share|improve this answer
    
that is not what I want. I know about that feature. I do not want to have the same files copied over and over again on my computer. –  philipp Feb 15 '13 at 18:21
add comment

I understand that you're looking for a generic solution for a multi-site where you do not have to care about how the multi-site feature is implemented in any given CMS. I.e. you are hoping for an answer describing some fancy "scheme" where you're able to link from a project site to a set of CMS "libraries".

The short answer is: This is not possible.

Every given CMS uses a different file system layout and a different method for locating the configuration/settings file. You need to place this file outside the location it is located in the uni-site configuration to have a multi-site. Being able to use multiple configuration/settings files with a single core installation is the key to having a working multi-site layout. Since different CMSes uses different methods for locating the configuration/settings files for the multi-sites, a "generic" solution is not possible.

However, if you can live with having to implement CMS-specific solutions (i.e. a different multi-site "library" for each CMS you're interested in, and a different scheme for linking the project site to this library for each CMS), you can have a multi-site.

Here are pointers to the relevant documention for the three CMSes you mention as examples:

Since setting up a multi-site is not trivial, you need to read the documentation carefully for each CMS you're interesting in using for a multi-site. As I say initially, there is no "generic" solution for this.

share|improve this answer
    
I think my question is not clear. I want to "link" to an entire CMS from a one folder to another on harddrive. I want to have one folder that includes the files of the CMS and another that uses sysmlinks inside it to "virtually" create the same files. –  philipp Feb 15 '13 at 21:27
    
I do not know how this is implemented in WordPress of Joomla. However using a symbolic link to the core configuration in the way you describe is one of the ways you can create a multisite in Drupal 7. –  Free Radical Feb 16 '13 at 5:51
    
I am searching for a solution where I do not have to care about how it is implemented in any CMS (who knows what will come next), so just a way to share as many files as possible on a local machine. I would like to make the cms »feel«: »I live in ~/projects/projectN«, while its files origin in ~/lib/<cmsname> –  philipp Feb 16 '13 at 8:19
    
Making the CMS appear to live in ~/projects/projectN, while its files actually resides in ~/lib/<cmsname> is part of what multi-siting is about (the other part is to make management simpler by having just one core configuration to maintain). However, since each CMS do this slightly differently, there exists no solution where you do not have to care about how it is implemented in the CMS. If it is this type of solution you're looking for, you need to update your question to make this clear. I've already amended my answer. –  Free Radical Feb 16 '13 at 9:53
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.