How do I handle a VirtualHost/Passenger entry for a Rails site that solely handles subdomains?
I want to use Rails 3's new subdomain features to handle all subdomain paths except www and nil.
Oppositely in a second rails app, I want to solely handle www and nil in the url path.
What would my two VirtualHost entries look like for Apache with Passenger? And in the code, for the fir开发者_高级运维st subdomain handling app, so long as I handle the new exposed :subdomain constraint in routes properly to ignore www and nil, that should prevent any conflict right?
Thanks for any input.
Looks like a ServerFault question.
NameVirtualHost *:80
# handles www.mydomain.com and mydomain.com
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /data/website1/public
<Directory /data/website1/public>
Allow from all
Options -Multiviews
</Directory>
</VirtualHost>
# handles *.mydomain.com
<VirtualHost *:80>
ServerName anything.mydomain.com
ServerAlias *.mydomain.com
DocumentRoot /data/website2/public
<Directory /data/website2/public>
Allow from all
Options -Multiviews
</Directory>
</VirtualHost>
精彩评论