Consolidate multiple site files into single location

Posted by seengee on Stack Overflow See other posts from Stack Overflow or by seengee
Published on 2010-05-08T11:28:29Z Indexed on 2010/05/08 11:38 UTC
Read the original article Hit count: 245

Filed under:
|
|
|

We have a custom PHP/MySQL CMS running on Linux/Apache thats rolled out to multiple sites (20+) on the same server. Each site uses exactly the same CMS files with a few files for each site being customised.

The customised files for each site are:

/library/mysql_connect.php
/public_html/css/*
/public_html/ftparea/*
/public_html/images/*

There's also a couple of other random files inside /public_html/includes/ that are unique to each site. Other than this each site on the server uses the exact same files. Each site sitting within /home/username/. There is obviously a massive amount of replication here as each time we want to deploy a system update we need to update to each user account. Given the common site files are all stored in SVN it would make far more sense if we were able to simply commit to SVN and deploy to a single location direct from there. Unfortunately, making a major architecture change at this stage could be problematic. In my mind the ideal scenario would mean creating an account like /home/commonfiles/ and each site using these common files unless an account specific file exists, for example a request is made to /home/user/public_html/index.php but as this file doesnt exist the request is then redirected to /home/commonfiles/public_html/index.php. I know that generally this approach is possible, similar to how Zend Framework (and probably others) redirect all requests that dont match a specific file to index.php. I'm just not sure about how exactly to go about implementing it and whether its actually advisable. Would really welcome any input/ideas people have got.

Thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about deployment