Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a system where we use a bespoke CMS on one of our servers. This CMS is used by 30-40 clients. The majority of the files for each client CMS are the same (apart from a few folders)as each time we add a new feature / patch / bug fix we roll it out to all clients. We want to consolidate these files into a single place so we can deploy our changes to it from SVN more easily.

we have a structure like this for each user account:

/home/user/public_html/css/
                      /images/
                      /admin/
                      index.php
                      etc ....

In this example, the css and images folders would be unique to each client site but all other files would be common to all. Not sure if we should be looking into symlinks / NFS / something else ??

share|improve this question
1  
Note: "bespoke" is a British/UK term meaning "custom-made" or "made-to-order". It is typically used for clothing, particularly for high-end tailored suits. en.wikipedia.org/wiki/Bespoke –  tomjedrz Oct 29 '09 at 14:40
    
@tomjedrz thanks man, didnt realise it wasnt a commonly used term –  seengee Oct 29 '09 at 16:33

2 Answers 2

up vote 2 down vote accepted

Short term solution:

Move

/admin/ 
index.php
etc...

to, say, /opt/cms

Create sym-links for the files to the new location. ie:

$ ln -s /home/user/admin /opt/cms/admin
$ ln -s /home/user/index.php /opt/cms/index.php

Writing a script to do the above for all the files and all the user's should be trivial (with experience). If not, post a separate question.

Then use SVN in the /opt/cms directory, which is linked to by everyone.

Longer term solution:

Eliminate the user directories completely. Move the application into one single website location (/opt/cms or /var/www/cms, etc...). Use some sort of URL rewriting to make example.com/~user/images/* point to example/user/images/* and make a /opt/cms/user/images directory for each user. This solution means user's don't know anything's changed.

Longer term, re-write the CMS to store the difference behind the scenes, or make a new structure and give the users a new URL.

share|improve this answer
    
looking more and more like this might be the only solution, points are yours :) –  seengee Nov 2 '09 at 14:24

I'm not familiar with Bespoke's file layout, but have you thought of doing this via the svn:externals property?

It allows you to link an 'external' repository to a location inside your current repository. By having a central repository where Bespoke lives (private for your organization, or the public repos if they offer one) linked to all your project repositories, it will make rolling things out with SVN a snap.

When you run svn update or svn commit inside of a location in your repos, the changes will be pulled or pused to the external repos and keep everything in sync.

svn:externals only supports folders prior to version 1.5, so be sure you're on 1.6 or higher so you can link things like the index.php to your project properly (unless bespokes files can be placed in a single directory).

share|improve this answer
2  
thanks, going to check out externals. FYI "Bespoke" isnt the name of a CMS, its a CMS we have built internally using code that is bespoke to us. –  seengee Oct 29 '09 at 11:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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