0

until now, we had multiple web servers with multiple IPs and a lot of domains pointing to them (most of the domain logic was inside our CMS). I liked this aproach because a lot of configuration could be handled with wildcards, keeping the apache stuff simple.

Now I need to gather the different servers on one or two central machines with only one IP each.

My question: Since I cannot use simple wildcards anymore (only 1 IP but 6 config-templates) would it be advisable to rather create 6 VirtualHost entries with a lot of ServerAliases, or create a VirtualHost entry per domain name (with obviously a lot of files in the sites-enabled folder)?

Are there any benchmarks? Are there memory implications by choosing one of the options (are variables like LogFormat, DocumentRoot... stored per Virtual Host or per ServerAlias)?

(config itself will be generated from db)

1 Answer 1

0

Every block must have at least one 'ServerAlias', so every configuration option is per virtual host. You can have as many ServerAlias' as you want per virtual host but there is a small memory overhead for processing VirtualHosts. I don't, however think the overhead increases considerably the more ServerAlias' you have.

However the preferred solution (At least the solution we use), is to have one IP per domain, then we don't have to worry about wildcards or ServerAlias'. IPs are cheap ($5 one off fee and $2/year from our host).

Unless your site is huge, ServerAlias' will be fine, you could even get something like CPanel/WHM which would manage it all for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .