how should I implement dynamic subdomains?

Jamon Camisso jamon.camisso-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Sat Jul 10 17:35:08 UTC 2010


On 07/10/2010 10:42 AM, Yanni Chiu wrote:
> Thanks. That's a lot easier than what I was thinking about - run a DNS,
> update the DNS records, then refresh.
> 
> I think that I will still have to update/refresh the Apache2
> configuration (using a2ensite), since I want to serve each new domain on
> a different portno. These servers would be started/stopped on demand.
> Any suggestions on this aspect? Otherwise, I'm thinking that I need to
> write a few scripts.

That seems terribly inefficient, forking or restarting incurs a large
performance penalty.

Using the application you're deploying to handle new subdomains instead
of reloading Apache would be easier. For example, Drupal, Wordpress etc.
have multi-site support that runs off a single codebase.

That way you can have a static Apache VirtualHost for *.foo.com and let
your application handle the logic or serving up particular subdomains.
It also keeps things limited to ports 80 and 443 as Ted Leslie pointed out.

Jamon
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list