So I've got this site that's being served as a virtual host by Apache 2. And it has a metric ton of alternative domain names that are all supposed to resolve to it.
Up to now I've handled things like this by adding the extra domains in the ServerAlias list in the vhost configuration file. But as the number of aliased domains has grown longer, that list has gotten extremely long and unwieldy. It also requires adding both the bare domain and the 'www' version separately, which (since I have to remember to add both) leaves room for me to be an idiot and forget to add one or the other. Hasn't happened yet, but when the list is long enough omissions like that don't leap out at you the way they do when there's only a couple of domains there, so I worry it's inevitable someday.
It seems like there ought to be a way to kick the list of aliases out of the vhost configuration file to some other place where they can be managed more easily. Even a text file with each alias on its own line would be an improvement, since at least then it'd be easier to visually scan the list than it is with a long comma-separated line. And it seems like there should be a way to have the 'www' subdomain automatically handled for the vhost as well, rather than needing to manually add a 'www' alias for each domain. But I've been looking for things like this and haven't found any obvious solutions yet.
That's probably just me not looking in the right place, but just in case -- is there a more elegant way to handle ServerAliases for a vhost? And if so, what is it?