I have a directory structure with files under directory 'web', which represents a white-label web site (html files, images, js etc.). I also have some twenty different 'brands' let's call them 'web-1', 'web-2' etc. each containing specific files that should override the files in 'web' for a specific brand.
Apache is configured to find the files for each virtual site i in document root 'website-i'. In order for each 'website-i' to contain content like 'web' with the overrides for brand 'web-i', my build script first copies all of 'web' to 'website-i' and then overrides it with the source files from 'web-i'.
There several problems with this approach:
- It takes time to copy the files.
- It takes a lot of disk space
- Adding a new brand requires adding to the script.
Is there a best practice for doing this in a way that does not require duplicating files? (with Apache and Linux)