This question already has an answer here:
Every website (e.g. Stack Overflow, Server Fault) of the Stack Exchange network has the same code base (cf. Does StackExchange 2.0 Share the Same CodeBase with SO?), but also has unique features like a custom theme and data (e.g. questions, users).
How do you manage this?
Is it a single instance that responds to multiple domains (multi-tenant)?
Or do you have multiple instances with different configurations?
If so, how do you tell the code base which instance should be run? Environment variables? Symlinks to custom code?
Same question for the database: do you have separate databases or one large database?